aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <montel@kde.org>2007-09-24 06:23:52 +0000
committerLaurent Montel <montel@kde.org>2007-09-24 06:23:52 +0000
commitaf86510dc0c1aabc1ab42ac98250812635e32323 (patch)
tree4a3477320bcb25d39e866aad4ae28d5a5e2129ce
parentfe55c51b9139309ce32ca18389c45279272a5d4a (diff)
downloadextra-cmake-modules-af86510dc0c1aabc1ab42ac98250812635e32323.tar.gz
extra-cmake-modules-af86510dc0c1aabc1ab42ac98250812635e32323.tar.bz2
Adapt CMakeLists.txt as discussed with Alex.
KDE4_ADD_TEST_EXECUTABLE is deprecated now use KDE4_ADD_EXECUTABLE(<target> TEST <files>) instead QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE and QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE are deprecated too used SET_SOURCE_FILES_PROPERTIES(<files> PROPERTIES NO_NAMESPACE TRUE) QT4_ADD_DBUS_INTERFACES(<srcList> <files>) set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) is put in each CMakeLists.txt where KDE4_ADD_EXECUTABLE(<target> TEST <files>) and KDE4_ADD_UNIT_TEST were used. svn path=/trunk/KDE/kdelibs/; revision=716146
-rw-r--r--modules/FindQt4.cmake32
-rw-r--r--modules/KDE4Macros.cmake62
2 files changed, 39 insertions, 55 deletions
diff --git a/modules/FindQt4.cmake b/modules/FindQt4.cmake
index fc58141c..2a52a5f0 100644
--- a/modules/FindQt4.cmake
+++ b/modules/FindQt4.cmake
@@ -37,22 +37,16 @@
# macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
# create a the interface header and implementation files with the
# given basename from the given interface xml file and add it to
-# the list of sources
+# the list of sources.
+# To disable generating a namespace header, set the source file property
+# NO_NAMESPACE to TRUE on the interface file.
#
# macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
# create the interface header and implementation files
# for all listed interface xml files
# the name will be automatically determined from the name of the xml file
-#
-# macro QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE(outfiles interface basename)
-# create a the interface without namespace header and implementation files with the
-# given basename from the given interface xml file and add it to
-# the list of sources
-#
-# macro QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE(outfiles inputfile ... )
-# create the interface header without namespace and implementation files
-# for all listed interface xml files
-# the name will be automatically determined from the name of the xml file
+# To disable generating namespace headers, set the source file property
+# NO_NAMESPACE to TRUE for these inputfiles.
#
# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname])
# create a dbus adaptor (header and implementation file) from the xml file
@@ -1042,11 +1036,6 @@ IF (QT4_QMAKE_FOUND)
ENDMACRO(QT4_ADD_DBUS_INTERFACE)
- MACRO(QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE _sources _interface _basename)
- SET_SOURCE_FILES_PROPERTIES(${_interface} PROPERTIES NO_NAMESPACE TRUE)
- QT4_ADD_DBUS_INTERFACE(${_sources} ${_interface} ${_basename})
- ENDMACRO(QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE)
-
MACRO(QT4_ADD_DBUS_INTERFACES _sources)
FOREACH (_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE)
@@ -1057,9 +1046,16 @@ IF (QT4_QMAKE_FOUND)
ENDFOREACH (_current_FILE)
ENDMACRO(QT4_ADD_DBUS_INTERFACES)
+ MACRO(QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE _sources _interface _basename)
+ MESSAGE(SEND_ERROR "QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE() is deprecated. Use the following instead:
+SET_SOURCE_FILES_PROPERTIES(<interface> PROPERTIES NO_NAMESPACE TRUE)
+QT4_ADD_DBUS_INTERFACE(<srcList> <interface> <basename>)\n")
+ ENDMACRO(QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE)
+
MACRO(QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE _sources)
- SET_SOURCE_FILES_PROPERTIES(${ARGN} PROPERTIES NO_NAMESPACE TRUE)
- QT4_ADD_DBUS_INTERFACES(${_sources} ${ARGN})
+ MESSAGE(SEND_ERROR "QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE() is deprecated. Use the following instead:
+SET_SOURCE_FILES_PROPERTIES(<files> PROPERTIES NO_NAMESPACE TRUE)
+QT4_ADD_DBUS_INTERFACES(<srcList> <files>)\n")
ENDMACRO(QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE)
MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName )
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake
index 87479b8b..6e69fb33 100644
--- a/modules/KDE4Macros.cmake
+++ b/modules/KDE4Macros.cmake
@@ -12,7 +12,6 @@
# KDE4_ADD_PLUGIN
# KDE4_ADD_KDEINIT_EXECUTABLE
# KDE4_ADD_UNIT_TEST
-# KDE4_ADD_TEST_EXECUTABLE
# KDE4_ADD_EXECUTABLE
# KDE4_ADD_WIDGET_FILES
# KDE4_UPDATE_ICONCACHE
@@ -607,9 +606,13 @@ endmacro (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX)
# 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)
-macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst)
+# 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)
set(${_nogui})
set(${_uninst})
+ set(${_test})
set(${_output_LIST} ${ARGN})
list(LENGTH ${_output_LIST} count)
@@ -642,6 +645,12 @@ macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst)
set(remove 0;1)
endif (${second_PARAM} STREQUAL "RUN_UNINSTALLED")
+ if (${first_PARAM} STREQUAL "TEST")
+ set(${_test} "TEST")
+ set(remove 0)
+ endif (${first_PARAM} STREQUAL "TEST")
+
+
if (NOT "${remove}" STREQUAL "NOTFOUND")
list(REMOVE_AT ${_output_LIST} ${remove})
endif (NOT "${remove}" STREQUAL "NOTFOUND")
@@ -651,7 +660,7 @@ endmacro(KDE4_CHECK_EXECUTABLE_PARAMS)
macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME )
- kde4_check_executable_params(_SRCS _nogui _uninst ${ARGN})
+ kde4_check_executable_params(_SRCS _nogui _uninst _test ${ARGN})
# if (WIN32)
# # under windows, just build a normal executable
@@ -696,7 +705,7 @@ macro (KDE4_ADD_UNIT_TEST _test_NAME)
set(_targetName ${ARGV2})
list(REMOVE_AT _srcList 0 1)
endif( ${ARGV1} STREQUAL "TESTNAME" )
- kde4_add_test_executable( ${_test_NAME} ${_srcList} )
+ kde4_add_executable( ${_test_NAME} TEST ${_srcList} )
if(NOT KDE4_TEST_OUTPUT)
set(KDE4_TEST_OUTPUT plaintext)
@@ -737,43 +746,14 @@ macro (KDE4_ADD_UNIT_TEST _test_NAME)
endmacro (KDE4_ADD_UNIT_TEST)
-# add an test executable
-# it will be built with RPATH pointing to the build dir
-# The targets are always created, but only built for the "all"
-# target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target
-# are created but not built by default. You can build them by manually building the target.
-# KDESRCDIR is set to the source directory of the test, this can be used with
-# KGlobal::dirs()->addResourceDir( "data", KDESRCDIR ); to be able to use xmlgui
-# and other things in the test, that normally require installation
macro (KDE4_ADD_TEST_EXECUTABLE _target_NAME)
-
- set(_add_executable_param)
-
- if (NOT KDE4_BUILD_TESTS)
- set(_add_executable_param EXCLUDE_FROM_ALL)
- endif (NOT KDE4_BUILD_TESTS)
-
- set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
-
- set(_SRCS ${ARGN})
- kde4_handle_automoc(${_target_NAME} _SRCS)
- add_executable(${_target_NAME} ${_add_executable_param} ${_SRCS})
-
- set_target_properties(${_target_NAME} PROPERTIES
- COMPILE_FLAGS -DKDESRCDIR="\\"${CMAKE_CURRENT_SOURCE_DIR}\\""
- SKIP_BUILD_RPATH FALSE
- BUILD_WITH_INSTALL_RPATH FALSE)
-
- if (WIN32)
- target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY})
- endif (WIN32)
-
+ MESSAGE(SEND_ERROR "KDE4_ADD_TEST_EXECUTABLE is deprecated use KDE4_ADD_EXECUTABLE(<target> TEST <files> instead")
endmacro (KDE4_ADD_TEST_EXECUTABLE)
macro (KDE4_ADD_EXECUTABLE _target_NAME)
- kde4_check_executable_params( _SRCS _nogui _uninst ${ARGN})
+ kde4_check_executable_params( _SRCS _nogui _uninst _test ${ARGN})
set(_add_executable_param)
set(_type "GUI")
@@ -794,9 +774,13 @@ macro (KDE4_ADD_EXECUTABLE _target_NAME)
set(_add_executable_param)
endif (_nogui)
- if (_uninst)
+ if (_uninst OR _test)
set(_type "RUN_UNINSTALLED")
- endif (_uninst)
+ 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)
kde4_handle_automoc(${_target_NAME} _SRCS)
if (KDE4_ENABLE_FINAL)
@@ -806,6 +790,10 @@ macro (KDE4_ADD_EXECUTABLE _target_NAME)
add_executable(${_target_NAME} ${_add_executable_param} ${_SRCS})
endif (KDE4_ENABLE_FINAL)
+ if (_test)
+ set_target_properties(${_target_NAME} PROPERTIES COMPILE_FLAGS -DKDESRCDIR="\\"${CMAKE_CURRENT_SOURCE_DIR}\\"")
+ endif (_test)
+
kde4_handle_rpath_for_executable(${_target_NAME} ${_type})
if (WIN32)