Switch to cmake building system
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>pull/30/head
parent
591ce28f01
commit
9d6a68cb01
@ -0,0 +1,91 @@
|
|||||||
|
############################################
|
||||||
|
# #
|
||||||
|
# Improvements and feedbacks are welcome #
|
||||||
|
# #
|
||||||
|
# This file is released under GPL >= 3 #
|
||||||
|
# #
|
||||||
|
############################################
|
||||||
|
|
||||||
|
|
||||||
|
##### set project version ########################
|
||||||
|
|
||||||
|
include( TDEVersion )
|
||||||
|
cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
|
||||||
|
tde_set_project_version( )
|
||||||
|
|
||||||
|
|
||||||
|
#### general package setup
|
||||||
|
|
||||||
|
project( ksquirrel )
|
||||||
|
|
||||||
|
|
||||||
|
#### include essential cmake modules
|
||||||
|
|
||||||
|
include( FindPkgConfig )
|
||||||
|
include( CheckSymbolExists )
|
||||||
|
include( CheckIncludeFile )
|
||||||
|
include( CheckLibraryExists )
|
||||||
|
include( CheckCSourceCompiles )
|
||||||
|
include( CheckCXXSourceCompiles )
|
||||||
|
enable_language( ASM )
|
||||||
|
|
||||||
|
|
||||||
|
#### include our cmake modules
|
||||||
|
|
||||||
|
include( TDEMacros )
|
||||||
|
|
||||||
|
|
||||||
|
##### 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_KEXIF "Enable kexif support" OFF )
|
||||||
|
|
||||||
|
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
|
||||||
|
|
||||||
|
|
||||||
|
##### user requested modules
|
||||||
|
|
||||||
|
option( BUILD_ALL "Build all" ON )
|
||||||
|
option( BUILD_CONFIGURATOR "Build configurator script" ${BUILD_ALL} )
|
||||||
|
option( BUILD_KPART "Build kpart library" ${BUILD_ALL} )
|
||||||
|
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
|
||||||
|
option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
|
||||||
|
|
||||||
|
|
||||||
|
##### configure checks
|
||||||
|
|
||||||
|
include( ConfigureChecks.cmake )
|
||||||
|
|
||||||
|
|
||||||
|
###### global compiler settings
|
||||||
|
|
||||||
|
add_definitions( -DHAVE_CONFIG_H )
|
||||||
|
add_definitions( ${KSQUIRREL_CFLAGS} )
|
||||||
|
|
||||||
|
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( pics )
|
||||||
|
add_subdirectory( src )
|
||||||
|
|
||||||
|
|
||||||
|
##### other data ################################
|
||||||
|
|
||||||
|
tde_conditional_add_project_docs( BUILD_DOC )
|
||||||
|
tde_conditional_add_project_translations( BUILD_TRANSLATIONS )
|
||||||
|
|
||||||
|
|
||||||
|
##### write configure files
|
||||||
|
|
||||||
|
configure_file( config.h.cmake config.h @ONLY )
|
@ -0,0 +1,89 @@
|
|||||||
|
###########################################
|
||||||
|
# #
|
||||||
|
# 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 pthread
|
||||||
|
|
||||||
|
find_package ( Threads REQUIRED )
|
||||||
|
|
||||||
|
|
||||||
|
##### check for OpenGL
|
||||||
|
|
||||||
|
pkg_search_module( GL gl )
|
||||||
|
if( NOT GL_FOUND )
|
||||||
|
tde_message_fatal( "opengl is required but was not found on your system" )
|
||||||
|
endif( )
|
||||||
|
|
||||||
|
|
||||||
|
##### check for libkexif
|
||||||
|
|
||||||
|
if( WITH_KEXIF )
|
||||||
|
pkg_search_module( KEXIF libkexif )
|
||||||
|
if( NOT KEXIF_FOUND )
|
||||||
|
tde_message_fatal( "libkexif was requested but not found on your system" )
|
||||||
|
endif( )
|
||||||
|
set ( SQ_HAVE_KEXIF 1 )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
##### check for libkipi
|
||||||
|
|
||||||
|
if( WITH_KIPI )
|
||||||
|
pkg_search_module( KIPI libkipi )
|
||||||
|
if( NOT KIPI_FOUND )
|
||||||
|
tde_message_fatal( "libkipi was requested but not found on your system" )
|
||||||
|
endif( )
|
||||||
|
set ( SQ_HAVE_KIPI 1 )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
##### check for libksquirrel
|
||||||
|
|
||||||
|
pkg_search_module( KSQUIRREL ksquirrellibs )
|
||||||
|
if( NOT KSQUIRREL_FOUND )
|
||||||
|
tde_message_fatal( "libksquirrel is required but not found on your system" )
|
||||||
|
endif( )
|
||||||
|
|
||||||
|
|
||||||
|
##### check specific architecture dependant support
|
||||||
|
if( CMAKE_SYSTEM_PROCESSOR MATCHES "i.86" )
|
||||||
|
|
||||||
|
# MMX support
|
||||||
|
cmake_host_system_information(RESULT HAVE_X86_MMX QUERY HAS_MMX)
|
||||||
|
if(HAVE_X86_MMX)
|
||||||
|
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -DHAVE_X86_MMX")
|
||||||
|
endif(HAVE_X86_MMX)
|
||||||
|
|
||||||
|
endif( )
|
||||||
|
|
||||||
|
|
||||||
|
##### check for required include files
|
||||||
|
|
||||||
|
check_include_file( "kregexpeditorinterface.h" SQ_HAVE_KREGEXP )
|
||||||
|
check_include_file( "utime.h" HAVE_UTIME_H )
|
@ -0,0 +1,24 @@
|
|||||||
|
#define VERSION "@VERSION@"
|
||||||
|
|
||||||
|
// Defined if you have fvisibility and fvisibility-inlines-hidden support.
|
||||||
|
#cmakedefine __TDE_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 we have libkexif
|
||||||
|
#cmakedefine SQ_HAVE_KEXIF 1
|
||||||
|
|
||||||
|
// Defined if we have libkipi
|
||||||
|
#cmakedefine SQ_HAVE_KIPI 1
|
||||||
|
|
||||||
|
// Defined if we have libkipi
|
||||||
|
#cmakedefine SQ_HAVE_KREGEXP 1
|
||||||
|
|
||||||
|
// Defined if we have utime.h
|
||||||
|
#cmakedefine HAVE_UTIME_H 1
|
||||||
|
|
||||||
|
// Defined if we have MMX support
|
||||||
|
#cmakedefine HAVE_X86_MMX 1
|
||||||
|
|
@ -0,0 +1,28 @@
|
|||||||
|
##### subfolders
|
||||||
|
|
||||||
|
add_subdirectory( imageedit )
|
||||||
|
add_subdirectory( menu )
|
||||||
|
add_subdirectory( toolbar )
|
||||||
|
|
||||||
|
|
||||||
|
##### other files
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES anime.png checker.png splash.png tray.png
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/images
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES image_win.png
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/images/listbox
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES mark_1.png mark_2.png mark_3.png mark_4.png
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/images/marks
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES thumbs_huge.png thumbs_large.png thumbs_medium.png
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/images/thumbs
|
||||||
|
)
|
@ -0,0 +1,6 @@
|
|||||||
|
file( GLOB _pngs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.png )
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${_pngs}
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/images/imageedit
|
||||||
|
)
|
@ -0,0 +1,6 @@
|
|||||||
|
file( GLOB _pngs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.png )
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${_pngs}
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/images/menu
|
||||||
|
)
|
@ -0,0 +1,6 @@
|
|||||||
|
file( GLOB _pngs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.png )
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${_pngs}
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/images/actions
|
||||||
|
)
|
@ -0,0 +1,87 @@
|
|||||||
|
# ksquirrelpart must come first to avoid conflicts
|
||||||
|
# during inclusion of sq_diroperator.moc, due to the
|
||||||
|
# same filename and object being used in different folders
|
||||||
|
tde_conditional_add_subdirectory( BUILD_KPART ksquirrelpart )
|
||||||
|
|
||||||
|
|
||||||
|
#### include and lib folders
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imageedit
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/sidebar
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/imageedit
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/sidebar
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${TDE_INCLUDE_DIR}
|
||||||
|
${TQT_INCLUDE_DIRS}
|
||||||
|
${KSQUIRREL_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
link_directories(
|
||||||
|
${TQT_LIBRARY_DIRS}
|
||||||
|
${TDE_LIB_DIR}
|
||||||
|
${GL_LIBRARY_DIRS}
|
||||||
|
${KEXIF_LIBRARY_DIRS}
|
||||||
|
${KIPI_LIBRARY_DIRS}
|
||||||
|
${KSQUIRREL_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
##### subfolders
|
||||||
|
|
||||||
|
add_subdirectory( imageedit )
|
||||||
|
add_subdirectory( mime )
|
||||||
|
add_subdirectory( sidebar )
|
||||||
|
tde_conditional_add_subdirectory( BUILD_CONFIGURATOR ksquirrel-libs-configurator )
|
||||||
|
|
||||||
|
|
||||||
|
##### ksquirrel (executable)
|
||||||
|
|
||||||
|
tde_import( libkonq )
|
||||||
|
|
||||||
|
tde_add_executable( ${PROJECT_NAME} AUTOMOC
|
||||||
|
SOURCES
|
||||||
|
sq_slideshowwidget.cpp sq_slideshow.ui sq_slideshowlisting.ui fmt_filters.cpp
|
||||||
|
sq_glwidget_stuff.cpp sq_tabopendialog.ui sq_dragprovider.cpp sq_utils_scale.cpp sq_utils.cpp
|
||||||
|
sq_thumbnailsunused.cpp sq_dirthumbs.cpp sq_downloader.cpp sq_glselectionpainter.cpp
|
||||||
|
sq_glwidget.cpp sq_glparts.cpp sq_codecsettings.cpp sq_filedialog.cpp sq_codecsettingsskeleton.ui
|
||||||
|
sq_kipimanager.cpp sq_kipiinterface.cpp sq_progressbox.cpp sq_thumbnailloadjob.cpp
|
||||||
|
sq_splashscreen.cpp sq_popupmenu.cpp sq_glinfo.ui sq_glwidget_helpers.cpp sq_imageloader.cpp
|
||||||
|
sq_pluginsinfo.ui sq_iconloader.cpp sq_selectdeselectgroup.ui sq_thumbnailcachemaster.ui
|
||||||
|
sq_errorstring.cpp sq_navigatordropmenu.cpp sq_fileiconviewbase.cpp sq_helpwidget.ui
|
||||||
|
sq_glview.cpp sq_viewcache.ui sq_filethumbviewitem.cpp sq_progress.cpp sq_thumbnailsize.cpp
|
||||||
|
sq_pixmapcache.cpp sq_filethumbview.cpp sq_dir.cpp sq_iconlistbox.cpp sq_iconlistitem.cpp
|
||||||
|
sq_widgetstack.cpp sq_options.ui sq_libraryhandler.cpp sq_imageproperties.ui sq_hloptions.cpp
|
||||||
|
sq_glu.cpp sq_filters.ui sq_fileiconview.cpp sq_filedetailview.cpp sq_externaltools.ui
|
||||||
|
sq_externaltool.cpp sq_diroperator.cpp sq_config.cpp sq_bookmarkowner.cpp sq_archivehandler.cpp
|
||||||
|
ksquirrel.cpp main.cpp sq_utils_asm_scale.S
|
||||||
|
LINK
|
||||||
|
imageedit-static sidebar-static
|
||||||
|
tdecore-shared tdeio-shared tdeui-shared tdeprint-shared tdefx-shared tdeutils-shared DCOP-shared
|
||||||
|
konq-shared tqui ${GL_LIBRARIES} ${KEXIF_LIBRARIES} ${KIPI_LIBRARIES} ${KSQUIRREL_LIBRARIES}
|
||||||
|
DESTINATION ${BIN_INSTALL_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
##### icons
|
||||||
|
|
||||||
|
tde_install_icons( ${PROJECT_NAME} )
|
||||||
|
|
||||||
|
|
||||||
|
##### other files
|
||||||
|
|
||||||
|
tde_create_translated_desktop(
|
||||||
|
SOURCE ksquirrel.desktop
|
||||||
|
)
|
||||||
|
|
||||||
|
tde_create_translated_desktop(
|
||||||
|
SOURCE konqksquirrel-dir.desktop
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus
|
||||||
|
)
|
||||||
|
|
||||||
|
tde_create_translated_desktop(
|
||||||
|
SOURCE dolphksquirrel-dir.desktop
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/dolphin/servicemenus
|
||||||
|
)
|
@ -0,0 +1,13 @@
|
|||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
##### imageedit library (static)
|
||||||
|
|
||||||
|
tde_add_library( imageedit STATIC_PIC AUTOMOC
|
||||||
|
SOURCES
|
||||||
|
sq_writeoption.ui sq_label.cpp sq_imagefilter.ui sq_imageeditoptions.ui sq_imageconvert.ui
|
||||||
|
sq_imagebcg.ui sq_converter.cpp sq_bcglabel.cpp
|
||||||
|
)
|
@ -0,0 +1,20 @@
|
|||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
##### ksquirrel-libs-configurator-real (executable)
|
||||||
|
|
||||||
|
tde_add_executable( ksquirrel-libs-configurator-real AUTOMOC
|
||||||
|
SOURCES main.cpp klc.ui
|
||||||
|
LINK tdecore-shared tdeio-shared tdeui-shared DCOP-shared
|
||||||
|
DESTINATION ${BIN_INSTALL_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
##### other files
|
||||||
|
|
||||||
|
install(
|
||||||
|
PROGRAMS ksquirrel-libs-configurator
|
||||||
|
DESTINATION ${BIN_INSTALL_DIR}
|
||||||
|
)
|
@ -0,0 +1,51 @@
|
|||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${TDE_INCLUDE_DIR}
|
||||||
|
${TQT_INCLUDE_DIRS}
|
||||||
|
${KSQUIRREL_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
link_directories(
|
||||||
|
${TQT_LIBRARY_DIRS}
|
||||||
|
${TDE_LIB_DIR}
|
||||||
|
${GL_LIBRARY_DIRS}
|
||||||
|
${KEXIF_LIBRARY_DIRS}
|
||||||
|
${KIPI_LIBRARY_DIRS}
|
||||||
|
${KSQUIRREL_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_definitions( -DKSQUIRREL_PART )
|
||||||
|
|
||||||
|
|
||||||
|
##### ksquirrelpart (shared)
|
||||||
|
|
||||||
|
tde_import( libkonq )
|
||||||
|
|
||||||
|
tde_add_kpart( libksquirrelpart AUTOMOC
|
||||||
|
SOURCES
|
||||||
|
ksquirrelpart.cpp sq_glparts.cpp sq_glu.cpp sq_glwidget.cpp sq_glwidget_stuff.cpp
|
||||||
|
sq_libraryhandler.cpp sq_downloader.cpp sq_iconloader.cpp fmt_filters.cpp sq_externaltool.cpp
|
||||||
|
sq_config.cpp sq_filedialog.cpp sq_imagefilter.ui sq_imagebcg.ui sq_glselectionpainter.cpp
|
||||||
|
sq_glwidget_helpers.cpp sq_label.cpp sq_bcglabel.cpp sq_popupmenu.cpp sq_errorstring.cpp
|
||||||
|
sq_codecsettingsskeleton.ui sq_codecsettings.cpp sq_imageproperties.ui sq_utils.cpp
|
||||||
|
sq_helpwidget.ui sq_utils_asm_scale.S sq_utils_scale.cpp sq_diroperator.cpp sq_glview.cpp
|
||||||
|
LINK
|
||||||
|
tdecore-shared tdeio-shared tdeui-shared tdeprint-shared tdefx-shared tdeutils-shared
|
||||||
|
konq-shared tqui ${GL_LIBRARIES} ${KEXIF_LIBRARIES} ${KSQUIRREL_LIBRARIES}
|
||||||
|
DESTINATION ${LIB_INSTALL_DIR}/trinity
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
##### other files
|
||||||
|
|
||||||
|
tde_create_translated_desktop(
|
||||||
|
SOURCE ksquirrelpart.desktop
|
||||||
|
DESTINATION ${SERVICES_INSTALL_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ksquirrelpart.rc
|
||||||
|
DESTINATION ${DATA_INSTALL_DIR}/ksquirrelpart
|
||||||
|
)
|
@ -0,0 +1,6 @@
|
|||||||
|
file( GLOB _mime_files *.desktop )
|
||||||
|
|
||||||
|
tde_create_translated_desktop(
|
||||||
|
SOURCE ${_mime_files}
|
||||||
|
DESTINATION ${MIME_INSTALL_DIR}/image
|
||||||
|
)
|
@ -0,0 +1,14 @@
|
|||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
##### sidebar library (static)
|
||||||
|
|
||||||
|
tde_add_library( sidebar STATIC_PIC AUTOMOC
|
||||||
|
SOURCES
|
||||||
|
sq_mountviewitem.cpp sq_mountview.cpp sq_imagebasket.cpp sq_directorybasket.cpp
|
||||||
|
sq_categorybrowsermenu.cpp sq_categoriesview.cpp sq_treeviewmenu.cpp sq_previewwidget.cpp
|
||||||
|
sq_storagefile.cpp sq_treeviewitem.cpp sq_threaddirlister.cpp sq_treeview.cpp sq_multibar.cpp
|
||||||
|
)
|
Loading…
Reference in New Issue