diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-09-12 21:00:13 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-09-12 21:00:13 +0000 |
commit | 86f74e86a9374826bab70dc1d75542ef7bcf4e87 (patch) | |
tree | b1e547f44ab105e653834ac8873d385a3a5ec172 | |
parent | 7685f61ca2a72bee7316f428fd9e392bf17ffa33 (diff) | |
download | extra-cmake-modules-86f74e86a9374826bab70dc1d75542ef7bcf4e87.tar.gz extra-cmake-modules-86f74e86a9374826bab70dc1d75542ef7bcf4e87.tar.bz2 |
-finally require cmake >= 2.4.3
-remove the LIST command hack
-always use the simpler and more powerful cmake 2.4.3 CMAKE_INSTALL_RPATH_USE_LINK_PATH option
-rename the shell wrapper scripts from *.sh to *.shell, this fixes the build with OpenBSD make,
which otherwise sometimes doesn't build the binaries but just copies the .sh scripts to the
binaries via implicit rules
-move KDELIBSUFF from FindKDE4Internal.cmake to ConfigureChecks.cmake, since this is used only in kdelibs, if
it needs to be used somewhere else, LIB_SUFFIX can be used instead
Alex
svn path=/trunk/KDE/kdelibs/; revision=583638
-rw-r--r-- | modules/FindKDE4Internal.cmake | 41 | ||||
-rw-r--r-- | modules/KDE4Macros.cmake | 26 |
2 files changed, 14 insertions, 53 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index 5e89a7e4..e16c0980 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -178,7 +178,7 @@ INCLUDE (MacroEnsureVersion) -cmake_minimum_required(VERSION 2.4.1 FATAL_ERROR) +cmake_minimum_required(VERSION 2.4.3 FATAL_ERROR) set(QT_MIN_VERSION "4.2.0") #this line includes FindQt4.cmake, which searches the Qt library and headers @@ -196,11 +196,8 @@ include (MacroLibrary) include (CheckCXXCompilerFlag) - - #add some KDE specific stuff - # the following are directories where stuff will be installed to set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) set(SHARE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share CACHE PATH "Base directory for files which go to share/") @@ -286,9 +283,9 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/kdecore/kglobal.h) set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets ) else (WIN32) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib ) - set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler.sh ) - set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc.sh ) - set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets.sh ) + set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler.shell ) + set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc.shell ) + set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets.shell ) endif (WIN32) set(KDE4_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) @@ -513,26 +510,11 @@ if (UNIX) if (APPLE) set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) else (APPLE) - if (CMAKE_PATCH_VERSION) # at least cmake 2.4.3, in earlier version CMAKE_PATCH_VERSION is empty - # add our LIB_INSTALL_DIR to the RPATH and use the RPATH figured out cmake when compiling - set(CMAKE_INSTALL_RPATH ${LIB_INSTALL_DIR} ) - set(CMAKE_SKIP_BUILD_RPATH ON) - set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - else (CMAKE_PATCH_VERSION) # at least cmake 2.4.3 - - set(CMAKE_INSTALL_RPATH ${LIB_INSTALL_DIR} ${QT_LIBRARY_DIR} ) - # building something else than kdelibs/ ? - # then add the dir where the kde libraries are installed - if (NOT EXISTS ${CMAKE_SOURCE_DIR}/kdecore/kglobal.h) - set(CMAKE_INSTALL_RPATH ${KDE4_LIB_DIR} ${CMAKE_INSTALL_RPATH} ) - endif (NOT EXISTS ${CMAKE_SOURCE_DIR}/kdecore/kglobal.h) - - set(CMAKE_SKIP_BUILD_RPATH TRUE) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - - endif (CMAKE_PATCH_VERSION) # at least cmake 2.4.3 - + # add our LIB_INSTALL_DIR to the RPATH and use the RPATH figured out by cmake when compiling + set(CMAKE_INSTALL_RPATH ${LIB_INSTALL_DIR} ) + set(CMAKE_SKIP_BUILD_RPATH TRUE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif (APPLE) endif (UNIX) @@ -735,10 +717,7 @@ endif (NOT KDE4Internal_FIND_QUIETLY) #add the found Qt and KDE include directories to the current include path set(KDE4_INCLUDES ${QT_INCLUDES} ${KDE4_INCLUDE_DIR} ${_KDE4_PLATFORM_INCLUDE_DIRS} ) -set(KDE4_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS ) - -set( KDELIBSUFF ${LIB_SUFFIX} ) - +set(KDE4_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS ) if (NOT _kde4_uninstall_rule_created) set(_kde4_uninstall_rule_created TRUE) diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 1de6f3dc..4bdc2b37 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -386,16 +386,16 @@ macro (KDE4_HANDLE_RPATH _target_NAME _type) # use add_custom_target() to have the sh-wrapper generated during build time instead of cmake time add_custom_command(TARGET ${_target_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} - -D_filename=${_executable}.sh -D_library_path_variable=${_library_path_variable} + -D_filename=${_executable}.shell -D_library_path_variable=${_library_path_variable} -D_ld_library_path="${_ld_library_path}" -D_executable=${_executable} -P ${KDE4_MODULE_DIR}/kde4_exec_via_sh.cmake ) - macro_additional_clean_files(${_executable}.sh) + macro_additional_clean_files(${_executable}.shell) # under UNIX, set the property WRAPPER_SCRIPT to the name of the generated shell script # so it can be queried and used later on easily - set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable}.sh) + set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable}.shell) else (UNIX) # under windows, set the property WRAPPER_SCRIPT just to the name of the executable @@ -457,24 +457,6 @@ MACRO (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX) ENDMACRO (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX) -# hmm this is a hack -# the behaviour of LIST(REMOVE_ITEM ... ) changed from 2.4.1 beta to 2.4.2 stable -# detect this here -# this can be removed once we require cmake >= 2.4.2 -set(remove_item_test_list one two) -# with cmake 2.4.1 this means remove index 0, -# with >= 2.4.2 this means remove the items which have the value "0" -list(REMOVE_ITEM remove_item_test_list 0) -list(LENGTH remove_item_test_list _test_list_length) -# so with 2.4.1 the list will have only one item left, with 2.4.2 two -if (${_test_list_length} EQUAL 2) - set(_REMOVE_AT_INDEX_KEYWORD REMOVE_AT) -else (${_test_list_length} EQUAL 2) - set(_REMOVE_AT_INDEX_KEYWORD REMOVE_ITEM) -endif (${_test_list_length} EQUAL 2) - - - # this macro checks is intended to check whether a list of source # files has the "NOGUI" or "RUN_UNINSTALLED" keywords at the beginning # in _output_LIST the list of source files is returned with the "NOGUI" @@ -521,7 +503,7 @@ MACRO(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst) endif (${second_PARAM} STREQUAL "RUN_UNINSTALLED") if (NOT "${remove}" STREQUAL "NOTFOUND") - list(${_REMOVE_AT_INDEX_KEYWORD} ${_output_LIST} ${remove}) + list(REMOVE_AT ${_output_LIST} ${remove}) endif (NOT "${remove}" STREQUAL "NOTFOUND") ENDMACRO(KDE4_CHECK_EXECUTABLE_PARAMS) |