aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2006-04-22 20:51:51 +0000
committerAlexander Neundorf <neundorf@kde.org>2006-04-22 20:51:51 +0000
commita509f4a028b822285e7c1f693d27131fd646ee3e (patch)
tree4cb8860416c732cb71d73feb176003c68c42cc63 /modules
parent9a75f145de53a04eca02dd5da5c2ab092f67d2f0 (diff)
downloadextra-cmake-modules-a509f4a028b822285e7c1f693d27131fd646ee3e.tar.gz
extra-cmake-modules-a509f4a028b822285e7c1f693d27131fd646ee3e.tar.bz2
-add docs for the NOGUI and RUN_UNINSTALLED options for KDE4_ADD_EXECUTABLE()
-use the new multiple-output syntax for KDE4_ADD_KCFG_FILES() -introduce a new target property WRAPPER_SCRIPT, which is set to the created wrapper script (or the executable if none is generated), which can then be easily queried and used e.g. in add_custom_command Alex Adriaan, does this fix your RPATH problem ? CCMAIL: <groot@kde.org> svn path=/trunk/KDE/kdelibs/; revision=532800
Diffstat (limited to 'modules')
-rw-r--r--modules/FindKDE4Internal.cmake7
-rw-r--r--modules/KDE4Macros.cmake19
2 files changed, 18 insertions, 8 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake
index a2f957a3..5366970d 100644
--- a/modules/FindKDE4Internal.cmake
+++ b/modules/FindKDE4Internal.cmake
@@ -156,10 +156,15 @@
# A library named kdeinit_<name> will be created and a small executable which links to it.
# It supports KDE3_ENABLE_FINAL
#
-# KDE4_ADD_EXECUTABLE (name file1 ... fileN)
+# KDE4_ADD_EXECUTABLE (name [ NOGUI | RUN_UNINSTALLED] file1 ... fileN)
# Equivalent to ADD_EXECUTABLE(), but additionally adds support for KDE4_ENABLE_FINAL.
# If you don't need support for KDE4_ENABLE_FINAL, you can just use the
# normal ADD_EXECUTABLE().
+# 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.
#
# KDE4_ADD_LIBRARY (name [STATIC | SHARED | MODULE ] file1 ... fileN)
# Equivalent to ADD_LIBRARY(), but additionally it supports KDE4_ENABLE_FINAL
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake
index 96c64b9d..60ae50c0 100644
--- a/modules/KDE4Macros.cmake
+++ b/modules/KDE4Macros.cmake
@@ -99,7 +99,7 @@ MACRO (KDE4_ADD_DCOP_STUBS _sources)
ENDMACRO (KDE4_ADD_DCOP_STUBS)
-MACRO (KDE4_ADD_KCFG_FILES _sources)
+macro (KDE4_ADD_KCFG_FILES _sources)
foreach (_current_FILE ${ARGN})
get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
@@ -113,16 +113,12 @@ MACRO (KDE4_ADD_KCFG_FILES _sources)
set(_moc_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
# the command for creating the source file from the kcfg file
- ADD_CUSTOM_COMMAND(OUTPUT ${_src_FILE}
+ add_custom_command(OUTPUT ${_header_FILE} ${_src_FILE}
COMMAND ${KDE4_KCFGC_EXECUTABLE}
ARGS ${_abs_PATH}/${_kcfg_FILE} ${_tmp_FILE} -d ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${_tmp_FILE}
DEPENDS ${_abs_PATH}/${_kcfg_FILE} ${_KDE4_KCONFIG_COMPILER_DEP} )
- # the above command generates both the source and the header files
- # this custom command creates the appropriate dependency
- ADD_CUSTOM_COMMAND(OUTPUT ${_header_FILE} DEPENDS ${_src_FILE} )
-
QT4_GENERATE_MOC(${_header_FILE} ${_moc_FILE} )
MACRO_ADD_FILE_DEPENDENCIES(${_src_FILE} ${_moc_FILE} )
@@ -130,7 +126,7 @@ MACRO (KDE4_ADD_KCFG_FILES _sources)
endforeach (_current_FILE)
-ENDMACRO (KDE4_ADD_KCFG_FILES)
+endmacro (KDE4_ADD_KCFG_FILES)
GET_FILENAME_COMPONENT(KDE4_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
@@ -413,6 +409,15 @@ macro (KDE4_HANDLE_RPATH _target_NAME _type)
macro_additional_clean_files(${_executable}.sh)
+ # 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)
+
+ else (UNIX)
+ # under windows, set the property WRAPPER_SCRIPT just to the name of the executable
+ # maybe later this will change to a generated batch file (for setting the PATH so that the Qt libs are found)
+ get_target_property(_executable ${_target_NAME} LOCATION )
+ set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable})
endif (UNIX)
endmacro (KDE4_HANDLE_RPATH)