Conversion to cmake building system

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/30/head
Michele Calgaro 2 months ago
parent a8bf4dbf8a
commit bc9bda10c9
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -0,0 +1,86 @@
############################################
# #
# Improvements and feedbacks are welcome #
# #
# This file is released under GPL >= 3 #
# #
############################################
cmake_minimum_required( VERSION 3.5 )
#### general package setup
project( gwenview )
#### include essential cmake modules
include( FindPkgConfig )
include( CheckSymbolExists )
include( CheckIncludeFile )
include( CheckLibraryExists )
include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )
enable_testing()
#### include our cmake modules
include( TDEMacros )
##### set version number ########################
tde_set_project_version( )
##### setup install paths
include( TDESetupPaths )
tde_setup_paths( )
##### optional stuff
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_KIPI "Enable kipi support" ${WITH_ALL_OPTIONS} )
option( WITH_MNG "Enable mng support" ${WITH_ALL_OPTIONS} )
option( WITH_XCURSOR "Enable xcursor support" ${WITH_ALL_OPTIONS} )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
##### user requested modules
option( BUILD_ALL "Build all" ON )
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
##### configure checks
include( ConfigureChecks.cmake )
###### global compiler settings
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
##### directories
add_subdirectory( icons )
add_subdirectory( src )
##### other data ################################
tde_conditional_add_project_docs( BUILD_DOC )
##### write configure files
configure_file( config.h.cmake config.h @ONLY )

@ -0,0 +1,134 @@
###########################################
# #
# Improvements and feedback are welcome #
# #
# This file is released under GPL >= 3 #
# #
###########################################
# required stuff
find_package( TQt )
find_package( TDE )
tde_setup_architecture_flags( )
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
tde_setup_largefiles( )
set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}:${LIB_INSTALL_DIR}/pkgconfig" )
##### check for gcc visibility support
if( WITH_GCC_VISIBILITY )
tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )
##### check for libexiv2
pkg_search_module( EXIV2 exiv2 )
if( NOT EXIV2_FOUND )
tde_message_fatal( "exiv2 is required, but was not found on your system" )
endif( NOT EXIV2_FOUND )
check_include_file_cxx( "exiv2/exiv2.hpp" HAVE_EXIV2_EXIV2_HPP )
##### check for libjpeg
find_package( JPEG )
if( NOT JPEG_FOUND )
tde_message_fatal( "jpeg library is required, but was not found on your system" )
endif()
##### checks for libkipi
if( WITH_KIPI )
pkg_search_module( LIBKIPI libkipi )
if( NOT LIBKIPI_FOUND )
tde_message_fatal( "libkipi was requested but not found on your system." )
endif( )
set( GV_HAVE_KIPI 1 )
endif( )
##### checks for libmng
if( WITH_MNG )
find_file( HAVE_LIBMNG_H "libmng.h" )
if( NOT HAVE_LIBMNG_H )
tde_message_fatal( "libmng was requested but not found on your system." )
endif( )
set( MNG_LIBRARY mng )
set( HAVE_LIBMNG 1 )
endif( )
##### check for libpng
find_package( PNG )
if( NOT PNG_FOUND )
tde_message_fatal( "png library is required, but was not found on your system" )
endif()
##### check for libxcursor
if( WITH_XCURSOR )
pkg_search_module( XCURSOR xcursor )
if( XCURSOR_FOUND )
set( GV_HAVE_XCURSOR 1 )
else( )
tde_message_fatal( "xcursor library is required, but was not found on your system" )
endif( )
endif()
##### check for lround function
tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "m" )
check_symbol_exists ( lround "math.h" HAVE_LROUND )
tde_restore( CMAKE_REQUIRED_LIBRARIES )
if( NOT HAVE_LROUND )
set( HAVE_LROUND 0 )
endif( NOT HAVE_LROUND )
##### check architecture
if( NOT CMAKE_ARCHITECTURE )
execute_process(
COMMAND ${CMAKE_C_COMPILER} -dumpmachine
OUTPUT_VARIABLE CMAKE_ARCHITECTURE
ERROR_VARIABLE CMAKE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE )
set( CMAKE_ARCHITECTURE "${CMAKE_ARCHITECTURE}" CACHE INTERNAL "" FORCE )
message( STATUS "Detected ${CMAKE_ARCHITECTURE} target architecture" )
endif( )
##### check specific architecture dependant support
if( ${CMAKE_ARCHITECTURE} MATCHES "i.86" )
# MMX support
message( STATUS "Performing MMX support test" )
check_c_source_compiles( "
int main() {
#if defined(__GNUC__)
__asm__(\"pxor %mm0, %mm0\");
#else
#error Not gcc on x86/x86_64
#endif
return 0;
}"
HAVE_X86_MMX
)
endif( )

@ -0,0 +1,26 @@
#define VERSION "@VERSION@"
// Defined if you have fvisibility and fvisibility-inlines-hidden support.
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
// Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
// significant byte first (like Motorola and SPARC, unlike Intel).
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
// Defined if you have exiv2/exiv2.hpp header
#cmakedefine HAVE_EXIV2_EXIV2_HPP 1
// Defined if you have libkipi install
#cmakedefine GV_HAVE_KIPI 1
// Defined if you have libmn install
#cmakedefine HAVE_LIBMNG 1
// Defined if you have libxcurso install
#cmakedefine GV_HAVE_XCURSOR 1
// Defined if you have lround function
#cmakedefine HAVE_LROUND 1
// Defined if you have MMX support
#cmakedefine HAVE_X86_MMX 1

@ -0,0 +1,4 @@
add_subdirectory( action )
add_subdirectory( app )
add_subdirectory( cursor )
add_subdirectory( thumbnail )

@ -0,0 +1 @@
tde_install_icons( DESTINATION ${DATA_INSTALL_DIR}/gwenview/icons )

@ -0,0 +1 @@
tde_install_icons( )

@ -0,0 +1,4 @@
install(
FILES zoom.png
DESTINATION ${DATA_INSTALL_DIR}/gwenview/cursors
)

@ -0,0 +1,4 @@
install(
FILES wait.png
DESTINATION ${DATA_INSTALL_DIR}/gwenview/thumbnail
)

@ -0,0 +1,24 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${TQT_INCLUDE_DIRS}
${TDE_INCLUDE_DIR}
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### subfolders
add_subdirectory( app )
add_subdirectory( desktopfiles )
add_subdirectory( gvcore )
add_subdirectory( gvdirpart )
add_subdirectory( gvimagepart )
add_subdirectory( imageutils )
add_subdirectory( tools )
add_subdirectory( tsthread )
add_subdirectory( updates )

@ -0,0 +1,56 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
##### libgwenshared (static)
tde_add_library( gwenshared STATIC_PIC AUTOMOC
SOURCES vtabwidget.cpp
)
##### gwenview (shared)
set( gwenview_SRCS
bookmarkowner.cpp
bookmarkviewcontroller.cpp
bookmarkdialogbase.ui
bookmarkdialog.cpp
configfileoperationspage.ui
configfullscreenpage.ui
configimagelistpage.ui
configimageviewpage.ui
configmiscpage.ui
configslideshowpage.ui
kipiinterface.cpp
mainwindow.cpp
metaedit.cpp
treeview.cpp
dirviewcontroller.cpp
configdialog.cpp
history.cpp
main.cpp
)
tde_add_tdeinit_executable( gwenview AUTOMOC
SOURCES ${gwenview_SRCS}
LINK
gwenshared-static gwenviewcore-shared
tdeutils-shared ${LIBKIPI_LIBRARIES}
DESTINATION ${LIB_INSTALL_DIR}/trinity
)
##### other files
install(
FILES gwenviewui.rc
DESTINATION ${DATA_INSTALL_DIR}/gwenview
)
install(
FILES gwenview.xpm
DESTINATION ${SHARE_INSTALL_PREFIX}/pixmaps
)

@ -0,0 +1,11 @@
##### desktop files
tde_create_translated_desktop(
SOURCE gwenview.desktop
DESTINATION ${XDG_APPS_INSTALL_DIR}
)
tde_create_translated_desktop(
SOURCE konqgwenview.desktop
DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus
)

@ -0,0 +1,90 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
##### gwenviewcore (shared)
set( gwenviewcore_SRCS
pngformattype.cpp
printdialog.cpp
printdialogpagebase.ui
thumbnailloadjob.cpp
imageview.cpp
imageviewcontroller.cpp
document.cpp
externaltoolmanager.cpp
externaltoolcontext.cpp
externaltoolaction.cpp
externaltooldialogbase.ui
externaltooldialog.cpp
fileviewcontroller.cpp
filethumbnailview.cpp
fileoperation.cpp
fileopobject.cpp
filethumbnailviewitem.cpp
filterbar.ui
qxcfi.cpp
archive.cpp
slideshow.cpp
filedetailview.cpp
filedetailviewitem.cpp
imagesavedialog.cpp
jpegformattype.cpp
mngformattype.cpp
xpm.cpp
documentimpl.cpp
documentloadingimpl.cpp
documentloadedimpl.cpp
documentjpegloadedimpl.cpp
documentanimatedloadedimpl.cpp
documentotherloadedimpl.cpp
busylevelmanager.cpp
cache.cpp
threadgate.cpp
imageviewtools.cpp
fullscreenbar.cpp
imageloader.cpp
cursortracker.cpp
captionformatter.cpp
thumbnaildetailsdialogbase.ui
thumbnaildetailsdialog.cpp
xcursor.cpp
mimetypeutils.cpp
bcgdialog.cpp
bcgdialogbase.ui
timeutils.cpp
clicklineedit.cpp
inputdialog.cpp
deletedialog.cpp
deletedialogbase.ui
miscconfig.kcfgc
slideshowconfig.kcfgc
fileoperationconfig.kcfgc
fullscreenconfig.kcfgc
imageviewconfig.kcfgc
fileviewconfig.kcfgc
)
tde_add_library( gwenviewcore SHARED AUTOMOC
SOURCES ${gwenviewcore_SRCS}
LINK
tsthread-static gvimageutils-static
tdecore-shared tdeio-shared tdemediaplayer-shared
tdeparts-shared tdeprint-shared tdeui-shared
${EXIV2_LIBRARIES} ${JPEG_LIBRARIES} ${MNG_LIBRARY}
${PNG_LIBRARIES} ${XCURSOR_LIBRARIES}
VERSION 1.0.0
DESTINATION ${LIB_INSTALL_DIR}
)
##### other files
install(
FILES
miscconfig.kcfg slideshowconfig.kcfg fileoperationconfig.kcfg
fullscreenconfig.kcfg imageviewconfig.kcfg fileviewconfig.kcfg
DESTINATION ${KCFG_INSTALL_DIR}
)

@ -0,0 +1,31 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
##### gvdirpart (shared)
tde_add_kpart( libgvdirpart AUTOMOC
SOURCES gvdirpart.cpp gvdirpartconfig.kcfgc
LINK tdeparts-shared gwenviewcore-shared
DESTINATION ${LIB_INSTALL_DIR}/trinity
)
##### other files
tde_create_translated_desktop(
SOURCE gvdirpart.desktop
DESTINATION ${SERVICES_INSTALL_DIR}
)
install(
FILES gvdirpart.rc
DESTINATION ${DATA_INSTALL_DIR}/gvdirpart
)
install(
FILES gvdirpartconfig.kcfg
DESTINATION ${KCFG_INSTALL_DIR}
)

@ -0,0 +1,26 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
##### gvimagepart
tde_add_kpart( libgvimagepart AUTOMOC
SOURCES gvimagepart.cpp
LINK tdeparts-shared gwenviewcore-shared
DESTINATION ${LIB_INSTALL_DIR}/trinity
)
##### other files
tde_create_translated_desktop(
SOURCE gvimagepart.desktop
DESTINATION ${SERVICES_INSTALL_DIR}
)
install(
FILES gvimagepart.rc gvimagepartpopup.rc
DESTINATION ${DATA_INSTALL_DIR}/gvimagepart
)

@ -0,0 +1,34 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${EXIV2_INCLUDE_DIRS}
${JPEG_INCLUDE_DIR}
)
##### gvimageutils (static)
set( gvimageutils_SRCS imageutils.cpp jpegcontent.cpp scale.cpp transupp.c croppedqimage.cpp )
if( HAVE_X86_MMX )
list( gvimageutils_SRCS APPEND _SRCS asm_scale.S )
# Force to use C compiler for asm_scale.S instead of ASM
# because it contains mixed code - ASM with C definitions
set_source_files_properties( asm_scale.S PROPERTIES LANGUAGE C )
add_compile_options( -DHAVE_X86_MMX )
endif( )
tde_add_library( gvimageutils STATIC_PIC AUTOMOC
SOURCES ${gvimageutils_SRCS}
LINK tdecore-shared tdeio-shared ${EXIV2_LIBRARIES} ${JPEG_LIBRARIES}
)
##### testjpegcontent (executable)
tde_add_check_executable( testjpegcontent AUTOMOC
SOURCES testjpegcontent.cpp
LINK gvimageutils-static
)

@ -17,9 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif
// System
#include <math.h>

@ -0,0 +1,6 @@
##### desktop files
tde_create_translated_desktop(
SOURCE gimp.desktop kolourpaint.desktop konqueror.desktop tiledwallpaper.desktop wallpaper.desktop
DESTINATION ${DATA_INSTALL_DIR}/gwenview/tools
)

@ -0,0 +1,11 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
##### tsthread (static)
tde_add_library( tsthread STATIC_PIC AUTOMOC
SOURCES tsthread.cpp tswaitcondition.cpp
)

@ -0,0 +1,11 @@
##### update files
install(
FILES gwenview_thumbnail_size.upd gwenview_1.4_osdformat.upd
DESTINATION ${DATA_INSTALL_DIR}/tdeconf_update
)
install(
PROGRAMS gwenview_thumbnail_size.sh gwenview_1.4_osdformat.sh
DESTINATION ${DATA_INSTALL_DIR}/tdeconf_update
)
Loading…
Cancel
Save