diff options
-rw-r--r-- | modules/FindKDE4Internal.cmake | 20 | ||||
-rw-r--r-- | modules/KDE4Macros.cmake | 32 |
2 files changed, 24 insertions, 28 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index d95a851a..74439e3b 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -152,22 +152,28 @@ # Create a KDE application in the form of a module loadable via kdeinit. # A library named kdeinit_<name> will be created and a small executable which links to it. # It supports KDE4_ENABLE_FINAL -# If the executable has to be run from the buildtree (e.g. unit tests and code generators -# used later on when compiling), set the option RUN_UNINSTALLED. # If the executable doesn't have a GUI, use the option NOGUI. By default on OS X # application bundles are created, with the NOGUI option no bundles but simple executables -# are created. Currently it doesn't have any effect on other platforms. +# are created. Under Windows this flag is also necessary to separate between applications +# with GUI and without. On other UNIX systems this flag has no effect. +# RUN_UNINSTALLED is deprecated and is ignored, for details see the documentation for +# KDE4_ADD_EXECUTABLE(). # # KDE4_ADD_EXECUTABLE (name [NOGUI] [TEST] [RUN_UNINSTALLED] file1 ... fileN) # Equivalent to ADD_EXECUTABLE(), but additionally adds some more features: # -support for KDE4_ENABLE_FINAL # -support for automoc # -automatic RPATH handling -# If the executable has to be run from the buildtree (e.g. unit tests and code generators -# used later on when compiling), set the option RUN_UNINSTALLED. # If the executable doesn't have a GUI, use the option NOGUI. By default on OS X # application bundles are created, with the NOGUI option no bundles but simple executables -# are created. Currently it doesn't have any effect on other platforms. +# are created. Under Windows this flag is also necessary to separate between applications +# with GUI and without. On other UNIX systems this flag has no effect. +# The option TEST is for internal use only. +# The option RUN_UNINSTALLED is ignored. It was necessary with KDE 4.0 and 4.1 +# if the executable had to be run from the build tree. Since KDE 4.2 all +# executables can be always run uninstalled (the RPATH of executables which are not +# yet installed points since then into the buildtree and is changed +# to the proper location when installing, so RUN_UNINSTALLED is not necessary anymore). # # KDE4_ADD_LIBRARY (name [STATIC | SHARED | MODULE ] file1 ... fileN) # Equivalent to ADD_LIBRARY(), but additionally it supports KDE4_ENABLE_FINAL @@ -590,7 +596,7 @@ option(KDE4_ENABLE_FPIE "Enable platform supports PIE linking") if (WIN32) find_package(KDEWin REQUIRED) - OPTION(KDE4_ENABLE_UAC_MANIFEST "add manifest to make vista uac happy" OFF) + option(KDE4_ENABLE_UAC_MANIFEST "add manifest to make vista uac happy" OFF) if (KDE4_ENABLE_UAC_MANIFEST) find_program(KDE4_MT_EXECUTABLE mt PATHS ${KDEWIN_INCLUDE_DIR}/../bin diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 288b33c6..13efea0d 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -522,7 +522,7 @@ endmacro (KDE4_CREATE_FINAL_FILES) # If RPATH is not disabled, these scripts are also used but only for consistency, because # they don't really influence anything then, because the compiled-in RPATH overrides # the LD_LIBRARY_PATH env. variable. -macro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE _target_NAME _type) +macro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE _target_NAME) if (UNIX) if (APPLE) set(_library_path_variable "DYLD_LIBRARY_PATH") @@ -618,15 +618,14 @@ endmacro (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX) # if "NOGUI" is in the list of files, the _nogui argument is set to # "NOGUI" (which evaluates to TRUE in cmake), otherwise it is set empty # (which evaluates to FALSE in cmake) -# if "RUN_UNINSTALLED" is in the list of files, the _uninst argument is set to -# "RUN_UNINSTALLED" (which evaluates to TRUE in cmake), otherwise it is set empty -# (which evaluates to FALSE in cmake) +# "RUN_UNINSTALLED" in the list of files is ignored, it is not necessary anymore +# since KDE 4.2 (with cmake 2.6.2), since then all executables are always built +# with RPATH pointing into the build dir. # if "TEST" is in the list of files, the _test argument is set to # "TEST" (which evaluates to TRUE in cmake), otherwise it is set empty # (which evaluates to FALSE in cmake) -macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test) +macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _test) set(${_nogui}) - set(${_uninst}) set(${_test}) set(${_output_LIST} ${ARGN}) list(LENGTH ${_output_LIST} count) @@ -646,7 +645,6 @@ macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test) endif (${first_PARAM} STREQUAL "NOGUI") if (${first_PARAM} STREQUAL "RUN_UNINSTALLED") - set(${_uninst} "RUN_UNINSTALLED") set(remove 0) endif (${first_PARAM} STREQUAL "RUN_UNINSTALLED") @@ -661,7 +659,6 @@ macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test) endif (${second_PARAM} STREQUAL "NOGUI") if (${second_PARAM} STREQUAL "RUN_UNINSTALLED") - set(${_uninst} "RUN_UNINSTALLED") set(remove 0;1) endif (${second_PARAM} STREQUAL "RUN_UNINSTALLED") @@ -671,7 +668,6 @@ macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test) endif (${second_PARAM} STREQUAL "TEST") - if (NOT "${remove}" STREQUAL "NOTFOUND") list(REMOVE_AT ${_output_LIST} ${remove}) endif (NOT "${remove}" STREQUAL "NOTFOUND") @@ -681,7 +677,7 @@ endmacro(KDE4_CHECK_EXECUTABLE_PARAMS) macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME ) - kde4_check_executable_params(_SRCS _nogui _uninst _test ${ARGN}) + kde4_check_executable_params(_SRCS _nogui _test ${ARGN}) configure_file(${KDE4_MODULE_DIR}/kde4init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp PROPERTIES SKIP_AUTOMOC TRUE) @@ -707,10 +703,10 @@ macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME ) if (KDE4_ENABLE_FINAL) kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS}) - kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}" ${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp ${_separate_files} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile}) + kde4_add_executable(${_target_NAME} "${_nogui}" ${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp ${_separate_files} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile}) else (KDE4_ENABLE_FINAL) - kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}" ${_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile}) + kde4_add_executable(${_target_NAME} "${_nogui}" ${_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile}) endif (KDE4_ENABLE_FINAL) set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME}) @@ -731,7 +727,7 @@ macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME ) set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME}) - kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}" ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp) + kde4_add_executable(${_target_NAME} "${_nogui}" ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp) target_link_libraries(${_target_NAME} kdeinit_${_target_NAME}) endif(WIN32) @@ -875,10 +871,9 @@ endmacro(_KDE4_ADD_MANIFEST) macro (KDE4_ADD_EXECUTABLE _target_NAME) - kde4_check_executable_params( _SRCS _nogui _uninst _test ${ARGN}) + kde4_check_executable_params( _SRCS _nogui _test ${ARGN}) set(_add_executable_param) - set(_type "GUI") # determine additional parameters for add_executable() # for GUI apps, create a bundle on OSX @@ -892,14 +887,9 @@ macro (KDE4_ADD_EXECUTABLE _target_NAME) endif (WIN32) if (_nogui) - set(_type "NOGUI") set(_add_executable_param) endif (_nogui) - if (_uninst OR _test) - set(_type "RUN_UNINSTALLED ${_type}") - endif (_uninst OR _test) - if (_test AND NOT KDE4_BUILD_TESTS) set(_add_executable_param ${_add_executable_param} EXCLUDE_FROM_ALL) endif (_test AND NOT KDE4_BUILD_TESTS) @@ -923,7 +913,7 @@ macro (KDE4_ADD_EXECUTABLE _target_NAME) set_target_properties(${_target_NAME} PROPERTIES COMPILE_FLAGS -DKDESRCDIR="\\"${CMAKE_CURRENT_SOURCE_DIR}/\\"") endif (_test) - kde4_handle_rpath_for_executable(${_target_NAME} ${_type}) + kde4_handle_rpath_for_executable(${_target_NAME}) if (WIN32) target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY}) |