diff --git a/CMakeLists.txt b/CMakeLists.txt index 323aec3..6f9fd04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,21 @@ -project(QtCurve-KDE3) -cmake_minimum_required(VERSION 2.4.0) +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +cmake_minimum_required( VERSION 2.8 ) + +##### cpack configuration ####################### set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") set(CPACK_GENERATOR "DEB;RPM;TGZ") -set(DEBIAN_PACKAGE_DESCRIPTION "QtCurve for Qt3/KDE3") +set(DEBIAN_PACKAGE_DESCRIPTION "QtCurve for TQt/TDE") set(DEBIAN_PACKAGE_SECTION "kde") set(CPACK_SOURCE_GENERATOR "TBZ2") set(CPACK_PACKAGE_VERSION_MAJOR "1") @@ -16,111 +28,71 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${QTCURVE_VERSION_FULL set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${QTCURVE_VERSION_FULL}") include(CPack) -if(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) -endif(COMMAND cmake_policy) - -if (QTC_BUILD_CONFIG_MODULE) - if (NOT QTC_QT_ONLY) - find_package(KDE3) - if (NOT KDE3_FOUND) - set(QTC_QT_ONLY true) - message("INFO: KDE3 not found! Compiling for Qt only! (Not building the config module)") - endif (NOT KDE3_FOUND) - endif (NOT QTC_QT_ONLY) -else (QTC_BUILD_CONFIG_MODULE) - set(QTC_QT_ONLY true) -endif (QTC_BUILD_CONFIG_MODULE) - -if (NOT QTC_QT_ONLY) - include(KDE3Macros) -else (NOT QTC_QT_ONLY) - if (NOT KDE3PREFIX) - SET(KDE3PREFIX "/opt/trinity") - endif (NOT KDE3PREFIX) - - set(QT_MT_REQUIRED TRUE) - find_package(Qt3 REQUIRED) - set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ) - include(QtCurveQt3) - if (QT_PLUGINS_DIR MATCHES NOTFOUND) - MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4") - SET(QT_INCLUDE_DIR "/usr/include/qt4") - SET(QT_PLUGINS_DIR "${KDE3PREFIX}/lib/trinity/plugins") - endif (QT_PLUGINS_DIR MATCHES NOTFOUND) -endif (NOT QTC_QT_ONLY) - -#if (NOT QTC_QT_ONLY) -exec_program(kde-config - ARGS --prefix --expandvars - OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX) -#endif (NOT QTC_QT_ONLY) - -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT") - -# NASTY HACK TO FORCE COMPILATION -# REMOVE WHEN FIXED -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/opt/trinity/include") - -SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt" CACHE FILEPATH "") -SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc" CACHE FILEPATH "") - -exec_program(kde-config - ARGS --install locale --expandvars - OUTPUT_VARIABLE KDE3_LOCALE_PREFIX) - -file(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS) - -# For KDE4 kde-config has been renamed to kde4-config -find_program(KDE4_KDECONFIG_EXECUTABLE - NAMES kde4-config - PATHS ${CMAKE_INSTALL_PREFIX}/bin ${_KDEDIRS} /usr/local/bin /usr/bin /opt/kde4/bin NO_DEFAULT_PATH) - -if (NOT KDE4_KDECONFIG_EXECUTABLE) - find_program(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config ) -endif (NOT KDE4_KDECONFIG_EXECUTABLE) - -if(KDE4_KDECONFIG_EXECUTABLE) - exec_program(${KDE4_KDECONFIG_EXECUTABLE} - ARGS --prefix - OUTPUT_VARIABLE KDE4PREFIX) -endif(KDE4_KDECONFIG_EXECUTABLE) - -if(NOT KDE4PREFIX) - set(KDE4PREFIX ${KDE3PREFIX}) -endif(NOT KDE4PREFIX) - -configure_file (config.h.cmake ${CMAKE_BINARY_DIR}/config.h) -#if (NOT QTC_QT_ONLY) - add_definitions(${QT_DEFINITIONS} ${KDE3_DEFINITIONS}) - include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE3_INCLUDES}) -#else (NOT QTC_QT_ONLY) -# add_definitions(${QT_DEFINITIONS}) -# include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) -#endif (NOT QTC_QT_ONLY) - -set(DATA_INSTALL_DIR ${KDE3PREFIX}/share/apps) - -if(QTC_DEFAULT_TO_KDE3) - message("INFO: Defaulting to reading KDE3 settings if KDE_SESSION_VERSION is not set") -else(QTC_DEFAULT_TO_KDE3) - message("INFO: Defaulting to reading KDE4 settings if KDE_SESSION_VERSION is not set") -endif(QTC_DEFAULT_TO_KDE3) - -add_subdirectory(style) -#if (NOT QTC_QT_ONLY) - if (QTC_BUILD_CONFIG_MODULE) - message("**************************************************************\n" - "Warning: The KDE3 config module is deprecated, and is no longer\n" - " actively maintained. This module NO LONGER COMPILES!\n" - " It is recommended to use the KDE4 version instead.\n" - "**************************************************************\n") - add_subdirectory(config) - add_subdirectory(po) - endif (QTC_BUILD_CONFIG_MODULE) - add_subdirectory(themes) - add_subdirectory(colors) -#endif (NOT QTC_QT_ONLY) + +##### general package setup ##################### + +project( kio-locate ) + + +##### include essential cmake modules ########### + +include( CheckCXXSourceCompiles ) +include( CheckFunctionExists ) +include( CheckIncludeFileCXX ) +include( CheckLibraryExists ) +include( CheckStructHasMember ) +include( CheckSymbolExists ) +include( CheckTypeSize ) +include( FindPkgConfig ) + + +##### include our cmake modules ################# + +set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) +include( TDEMacros ) + + +##### setup install paths ####################### + +include( TDESetupPaths ) +tde_setup_paths( ) + + +##### user requested modules #################### + +option( BUILD_ALL "Build all" OFF ) +option( BUILD_CONFIG_MODULE "Build TDE configuration module" ${BUILD_ALL} ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) + + +##### configure checks ########################## + +include( ConfigureChecks.cmake ) + + +###### global compiler settings ################# + +add_definitions( + -DHAVE_CONFIG_H +) + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) +set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) + + +##### source directories ######################## + +add_subdirectory( style ) +add_subdirectory( themes ) +add_subdirectory( colors ) +tde_conditional_add_subdirectory( BUILD_CONFIG_MODULE config ) +tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) + + +##### write configure files ##################### + +configure_file( config.h.cmake config.h @ONLY ) if (QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT) message("**************************************************************\n" @@ -129,4 +101,4 @@ if (QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT) " DO NOT report errors to application authors when you have\n" " this enabled. Please reconsider DISABLING this option.\n" "**************************************************************\n") -endif (QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT) +endif (QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT) \ No newline at end of file diff --git a/CMakeLists.txt.orig b/CMakeLists.txt.orig new file mode 100644 index 0000000..323aec3 --- /dev/null +++ b/CMakeLists.txt.orig @@ -0,0 +1,132 @@ +project(QtCurve-KDE3) +cmake_minimum_required(VERSION 2.4.0) + +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") +set(CPACK_GENERATOR "DEB;RPM;TGZ") +set(DEBIAN_PACKAGE_DESCRIPTION "QtCurve for Qt3/KDE3") +set(DEBIAN_PACKAGE_SECTION "kde") +set(CPACK_SOURCE_GENERATOR "TBZ2") +set(CPACK_PACKAGE_VERSION_MAJOR "1") +set(CPACK_PACKAGE_VERSION_MINOR "6") +set(CPACK_PACKAGE_VERSION_PATCH "2") +set(CPACK_PACKAGE_CONTACT "Craig Drummond ") +set(QTCURVE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") +set(QTCURVE_VERSION_FULL "${QTCURVE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${QTCURVE_VERSION_FULL}") +set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${QTCURVE_VERSION_FULL}") +include(CPack) + +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + +if (QTC_BUILD_CONFIG_MODULE) + if (NOT QTC_QT_ONLY) + find_package(KDE3) + if (NOT KDE3_FOUND) + set(QTC_QT_ONLY true) + message("INFO: KDE3 not found! Compiling for Qt only! (Not building the config module)") + endif (NOT KDE3_FOUND) + endif (NOT QTC_QT_ONLY) +else (QTC_BUILD_CONFIG_MODULE) + set(QTC_QT_ONLY true) +endif (QTC_BUILD_CONFIG_MODULE) + +if (NOT QTC_QT_ONLY) + include(KDE3Macros) +else (NOT QTC_QT_ONLY) + if (NOT KDE3PREFIX) + SET(KDE3PREFIX "/opt/trinity") + endif (NOT KDE3PREFIX) + + set(QT_MT_REQUIRED TRUE) + find_package(Qt3 REQUIRED) + set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ) + include(QtCurveQt3) + if (QT_PLUGINS_DIR MATCHES NOTFOUND) + MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4") + SET(QT_INCLUDE_DIR "/usr/include/qt4") + SET(QT_PLUGINS_DIR "${KDE3PREFIX}/lib/trinity/plugins") + endif (QT_PLUGINS_DIR MATCHES NOTFOUND) +endif (NOT QTC_QT_ONLY) + +#if (NOT QTC_QT_ONLY) +exec_program(kde-config + ARGS --prefix --expandvars + OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX) +#endif (NOT QTC_QT_ONLY) + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT") + +# NASTY HACK TO FORCE COMPILATION +# REMOVE WHEN FIXED +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/opt/trinity/include") + +SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt" CACHE FILEPATH "") +SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc" CACHE FILEPATH "") + +exec_program(kde-config + ARGS --install locale --expandvars + OUTPUT_VARIABLE KDE3_LOCALE_PREFIX) + +file(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS) + +# For KDE4 kde-config has been renamed to kde4-config +find_program(KDE4_KDECONFIG_EXECUTABLE + NAMES kde4-config + PATHS ${CMAKE_INSTALL_PREFIX}/bin ${_KDEDIRS} /usr/local/bin /usr/bin /opt/kde4/bin NO_DEFAULT_PATH) + +if (NOT KDE4_KDECONFIG_EXECUTABLE) + find_program(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config ) +endif (NOT KDE4_KDECONFIG_EXECUTABLE) + +if(KDE4_KDECONFIG_EXECUTABLE) + exec_program(${KDE4_KDECONFIG_EXECUTABLE} + ARGS --prefix + OUTPUT_VARIABLE KDE4PREFIX) +endif(KDE4_KDECONFIG_EXECUTABLE) + +if(NOT KDE4PREFIX) + set(KDE4PREFIX ${KDE3PREFIX}) +endif(NOT KDE4PREFIX) + +configure_file (config.h.cmake ${CMAKE_BINARY_DIR}/config.h) +#if (NOT QTC_QT_ONLY) + add_definitions(${QT_DEFINITIONS} ${KDE3_DEFINITIONS}) + include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE3_INCLUDES}) +#else (NOT QTC_QT_ONLY) +# add_definitions(${QT_DEFINITIONS}) +# include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) +#endif (NOT QTC_QT_ONLY) + +set(DATA_INSTALL_DIR ${KDE3PREFIX}/share/apps) + +if(QTC_DEFAULT_TO_KDE3) + message("INFO: Defaulting to reading KDE3 settings if KDE_SESSION_VERSION is not set") +else(QTC_DEFAULT_TO_KDE3) + message("INFO: Defaulting to reading KDE4 settings if KDE_SESSION_VERSION is not set") +endif(QTC_DEFAULT_TO_KDE3) + +add_subdirectory(style) +#if (NOT QTC_QT_ONLY) + if (QTC_BUILD_CONFIG_MODULE) + message("**************************************************************\n" + "Warning: The KDE3 config module is deprecated, and is no longer\n" + " actively maintained. This module NO LONGER COMPILES!\n" + " It is recommended to use the KDE4 version instead.\n" + "**************************************************************\n") + add_subdirectory(config) + add_subdirectory(po) + endif (QTC_BUILD_CONFIG_MODULE) + add_subdirectory(themes) + add_subdirectory(colors) +#endif (NOT QTC_QT_ONLY) + +if (QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT) + message("**************************************************************\n" + "Warning: You have enabled support for the 'fix parentless dialogs'\n" + " option. This is known to BREAK some applications. Please\n" + " DO NOT report errors to application authors when you have\n" + " this enabled. Please reconsider DISABLING this option.\n" + "**************************************************************\n") +endif (QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..2cfe6d4 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,30 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE ) + find_program( MSGFMT_EXECUTABLE msgfmt ) + if( NOT MSGFMT_EXECUTABLE ) + tde_message_fatal( "msgfmt program is required, but was not found on your system" ) + endif( ) +endif( ) + +check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY ) +check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY ) + +check_include_file( stdint.h HAVE_STDINT_H ) +check_include_file( systems.h HAVE_SYSTEMS_H ) +check_include_file( linux/inotify.h HAVE_INOTIFY ) + +check_function_exists( statvfs HAVE_STATVFS ) + +# common required stuff +find_package( TQt ) +find_package( TDE ) diff --git a/cmake/QtCurveQt3.cmake b/cmake/QtCurveQt3.cmake deleted file mode 100644 index dac1b1b..0000000 --- a/cmake/QtCurveQt3.cmake +++ /dev/null @@ -1,27 +0,0 @@ -FILE(GLOB GLOB_PATHS_BIN /usr/lib/qt-3*/bin/) -FIND_PATH(QT_PLUGINS_DIR imageformats - $ENV{QTDIR}/plugins - ${GLOB_PATHS_BIN} - /usr/local/qt/plugins - /usr/lib/qt/plugins - /usr/lib/qt3/plugins - /usr/share/qt3/plugins - ) - -MACRO(QTCURVE_QT_WRAP_CPP outfiles ) - # get include dirs - GET_DIRECTORY_PROPERTY(moc_includes_tmp INCLUDE_DIRECTORIES) - SET(moc_includes) - - FOREACH(it ${ARGN}) - GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE) - GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) - SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${outfilename}.moc) - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} - COMMAND ${QT_MOC_EXECUTABLE} - ARGS -o ${outfile} ${infile} - DEPENDS ${infile}) - SET(${outfiles} ${${outfiles}} ${outfile}) - ENDFOREACH(it) - -ENDMACRO(QTCURVE_QT_WRAP_CPP) diff --git a/style/CMakeLists.txt b/style/CMakeLists.txt index cf37121..b9de27d 100644 --- a/style/CMakeLists.txt +++ b/style/CMakeLists.txt @@ -1,22 +1,47 @@ -if (NOT QTC_QT_ONLY) - set(qtcurve_SRCS qtcurve.cpp pixmaps.h) - add_definitions(-DQT_PLUGIN) - include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} ${KDE3_INCLUDE_DIR} ${QT_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/common) - link_directories(${KDE3_LIB_DIR}) - trinity_automoc(${qtcurve_SRCS}) - add_library(qtcurve MODULE ${qtcurve_SRCS}) - set_target_properties(qtcurve PROPERTIES PREFIX "") - target_link_libraries(qtcurve ${QT_LIBRARIES} kdefx) - install(TARGETS qtcurve LIBRARY DESTINATION ${KDE3_LIB_DIR}/trinity/plugins/styles) - install(FILES qtcurve.themerc DESTINATION ${KDE3PREFIX}/share/apps/kstyle/themes) -else (NOT QTC_QT_ONLY) - set(qtcurve_MOC_CLASSES qtcurve.h qtc_kstyle.h) - QTCURVE_QT_WRAP_CPP(qtcurve_MOC_SRCS ${qtcurve_MOC_CLASSES}) - set(qtcurve_SRCS qtcurve.cpp qtc_kstyle.cpp pixmaps.h) - include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} ${QT_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/common) - add_library(qtcurve MODULE ${qtcurve_SRCS} ${qtcurve_MOC_SRCS}) - set_target_properties(qtcurve PROPERTIES PREFIX "") - target_link_libraries(qtcurve ${QT_LIBRARIES}) - install(TARGETS qtcurve LIBRARY DESTINATION ${QT_PLUGINS_DIR}/styles) -endif (NOT QTC_QT_ONLY) +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# +add_subdirectory( config ) + +add_definitions( + -DQT_PLUGIN +) + +include_directories( + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES qtcurve.themerc DESTINATION ${DATA_INSTALL_DIR}/kstyle/themes ) + + +##### plastik ################################### + +set( target qtcurve ) + +set( ${target}_SRCS + qtcurve.cpp pixmaps.h +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK kdefx-shared + DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/styles +)