From 7cedfcb76030359d9b08016715e36a40dddb8f33 Mon Sep 17 00:00:00 2001 From: gregory guy Date: Sat, 12 Jan 2019 23:05:35 +0100 Subject: [PATCH] upgrade cmake building system Signed-off-by: gregory guy --- CMakeLists.txt | 39 +++++++++------- ConfigureChecks.cmake | 24 +++++----- config.h.cmake | 8 ++++ doc/CMakeLists.txt | 14 +----- doc/kimagemapeditor/CMakeLists.txt | 1 + doc/quanta/CMakeLists.txt | 1 + kimagemapeditor/CMakeLists.txt | 72 +++++++++++++++++++++++++++++ kimagemapeditor/pics/CMakeLists.txt | 14 ++++++ quanta/CMakeLists.txt | 24 +--------- 9 files changed, 134 insertions(+), 63 deletions(-) create mode 100644 doc/kimagemapeditor/CMakeLists.txt create mode 100644 doc/quanta/CMakeLists.txt create mode 100644 kimagemapeditor/CMakeLists.txt create mode 100644 kimagemapeditor/pics/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 78055bab..d18a3cae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,17 +15,17 @@ cmake_minimum_required( VERSION 2.8 ) ##### general package setup ##################### project( tdewebdev ) +set( VERSION R14.1.0 ) ##### include essential cmake modules ########### +include( FindPkgConfig ) +include( CheckFunctionExists ) +include( CheckIncludeFile ) +include( CheckLibraryExists ) +include( CheckCSourceCompiles ) include( CheckCXXSourceCompiles ) -include( CheckFunctionExists ) -include( CheckIncludeFileCXX ) -include( CheckStructHasMember ) -include( CheckSymbolExists ) -include( CheckTypeSize ) -include( FindPkgConfig ) ##### include our cmake modules ################# @@ -48,10 +48,19 @@ tde_setup_paths( ) # option( WITH_LIBGPOD "Enable iPod support from libgpod" OFF ) -##### user requested modules #################### +##### optional stuff -option( BUILD_ALL "Build all" OFF ) +option( WITH_ALL_OPTIONS "Enable all optional 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_DOC "Build documentation" ${BUILD_ALL} ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) option( BUILD_QUANTA "Build quanta" ${BUILD_ALL} ) +option( BUILD_KIMAGEMAPEDITOR "Build kimagemapeditor" ${BUILD_ALL} ) ##### configure checks ########################## @@ -61,23 +70,19 @@ include( ConfigureChecks.cmake ) ###### global compiler settings ################# -add_definitions( - -DHAVE_CONFIG_H - ${TQT_CFLAGS_OTHER} -) +add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST ) -set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include tqt.h" ) +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" ) ##### source directories ######################## -if( BUILD_QUANTA ) - add_subdirectory( lib ) -endif( ) - +tde_conditional_add_subdirectory( BUILD_QUANTA lib ) tde_conditional_add_subdirectory( BUILD_QUANTA quanta ) +tde_conditional_add_subdirectory( BUILD_KIMAGEMAPEDITOR kimagemapeditor ) +tde_conditional_add_subdirectory( BUILD_DOC doc ) ##### write configure files ##################### diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index b7d6dc10..c694d7d3 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -9,18 +9,26 @@ # ################################################# -##### check for gcc visibility support ######### -# FIXME -# This should check for [T]Qt3 visibility support +# required stuff +find_package( TQt ) +find_package( TDE ) + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + + +##### check for gcc visibility support if( WITH_GCC_VISIBILITY ) if( NOT UNIX ) - tde_message_fatal(FATAL_ERROR "\ngcc visibility support was requested, but your system is not *NIX" ) + tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" ) endif( NOT UNIX ) set( __KDE_HAVE_GCC_VISIBILITY 1 ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") -endif( ) +endif( WITH_GCC_VISIBILITY ) # libxml-2.0 @@ -43,9 +51,3 @@ if( BUILD_QUANTA ) tde_message_fatal( "libxslt are required, but not found on your system" ) endif( ) endif( ) - - -# required stuff -find_package( Qt ) -find_package( TQt ) -find_package( TDE ) diff --git a/config.h.cmake b/config.h.cmake index e69de29b..61ede3a6 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -0,0 +1,8 @@ +#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@ diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index dc6bb770..b766d1de 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,12 +1,2 @@ -################################################# -# -# (C) 2012 Golubev Alexander -# fatzer2 (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_auto_add_subdirectories( ) +tde_conditional_add_subdirectory( BUILD_QUANTA quanta ) +tde_conditional_add_subdirectory( BUILD_KIMAGEMAPEDITOR kimagemapeditor ) diff --git a/doc/kimagemapeditor/CMakeLists.txt b/doc/kimagemapeditor/CMakeLists.txt new file mode 100644 index 00000000..cd7e12b9 --- /dev/null +++ b/doc/kimagemapeditor/CMakeLists.txt @@ -0,0 +1 @@ +tde_create_handbook( DESTINATION kimagemapeditor ) diff --git a/doc/quanta/CMakeLists.txt b/doc/quanta/CMakeLists.txt new file mode 100644 index 00000000..d6073c36 --- /dev/null +++ b/doc/quanta/CMakeLists.txt @@ -0,0 +1 @@ +tde_create_handbook( DESTINATION quanta ) diff --git a/kimagemapeditor/CMakeLists.txt b/kimagemapeditor/CMakeLists.txt new file mode 100644 index 00000000..b9251f47 --- /dev/null +++ b/kimagemapeditor/CMakeLists.txt @@ -0,0 +1,72 @@ +add_subdirectory( pics ) + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + + +##### kimagemapeditorcommon (static) + +tde_add_library( kimagemapeditorcommon STATIC_PIC AUTOMOC + + SOURCES + qextfileinfo.cpp + areacreator.cpp + kimearea.cpp + kimecommands.cpp + kimedialogs.cpp + kimagemapeditor.cpp + drawzone.cpp + arealistview.cpp + imageslistview.cpp + mapslistview.cpp +) + + +##### libkimagemapeditor (kpart) + +tde_add_kpart( libkimagemapeditor AUTOMOC + + SOURCES + dummy.cpp + LINK + tdehtml-shared + + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### kimagemapeditor (executable) + +tde_add_executable( kimagemapeditor AUTOMOC + + SOURCES + main.cpp kimeshell.cpp + LINK + tdecore-shared tdeui-shared tdeio-shared tdehtml-shared + kimagemapeditorcommon-static + + DESTINATION ${BIN_INSTALL_DIR} +) +# kjs tdefx tdeparts DCOP + +##### other data + +install( + FILES kimagemapeditorui.rc kimagemapeditorpartui.rc + DESTINATION ${DATA_INSTALL_DIR}/kimagemapeditor +) + +install( + FILES kimagemapeditor.desktop + DESTINATION ${XDG_APPS_INSTALL_DIR} +) diff --git a/kimagemapeditor/pics/CMakeLists.txt b/kimagemapeditor/pics/CMakeLists.txt new file mode 100644 index 00000000..098e25a7 --- /dev/null +++ b/kimagemapeditor/pics/CMakeLists.txt @@ -0,0 +1,14 @@ +tde_install_icons( kimagemapeditor ) + + +##### other data ################################ + +install( + FILES + addpointcursor.png + freehandcursor.png + polygoncursor.png + removepointcursor.png + + DESTINATION ${DATA_INSTALL_DIR}/kimagemapeditor +) diff --git a/quanta/CMakeLists.txt b/quanta/CMakeLists.txt index 11fc0c2f..6d0aa9f3 100644 --- a/quanta/CMakeLists.txt +++ b/quanta/CMakeLists.txt @@ -1,23 +1 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( data ) -add_subdirectory( utility ) -add_subdirectory( dialogs ) -add_subdirectory( components ) -add_subdirectory( parsers ) -add_subdirectory( treeviews ) -add_subdirectory( messages ) -add_subdirectory( plugins ) -add_subdirectory( parts ) -add_subdirectory( project ) -add_subdirectory( src ) -add_subdirectory( scripts ) +tde_auto_add_subdirectories( )