diff options
author | Alex Merry <alex.merry@kde.org> | 2015-05-11 13:56:28 +0100 |
---|---|---|
committer | Alex Merry <alex.merry@kde.org> | 2015-05-13 19:22:15 +0100 |
commit | 1b636b43d2bf4dca0332a2e2b36affa67fbe1e0b (patch) | |
tree | 6a82d1acbdd48c76ab94b1aa4921696aef3bf4e1 /modules/ECMAddTests.cmake | |
parent | 09822e2631644875d3b22fef54b9bfa30a295169 (diff) | |
download | extra-cmake-modules-1b636b43d2bf4dca0332a2e2b36affa67fbe1e0b.tar.gz extra-cmake-modules-1b636b43d2bf4dca0332a2e2b36affa67fbe1e0b.tar.bz2 |
Add unit tests for ECMAddTests module.
REVIEW: 123722
Diffstat (limited to 'modules/ECMAddTests.cmake')
-rw-r--r-- | modules/ECMAddTests.cmake | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/ECMAddTests.cmake b/modules/ECMAddTests.cmake index de06315d..bdb60691 100644 --- a/modules/ECMAddTests.cmake +++ b/modules/ECMAddTests.cmake @@ -23,9 +23,13 @@ # give an indication of where to look for a failing test. # # If the flag GUI is passed the test binary will be a GUI executable, otherwise -# the resulting binary will be a console application. The test will be linked +# the resulting binary will be a console application (regardless of the value +# of CMAKE_WIN32_EXECUTABLE or CMAKE_MACOSX_BUNDLE). The test will be linked # against the libraries and/or targets passed to LINK_LIBRARIES. # +# The generated target executable will have the effects of ecm_mark_as_test() +# (from the :module:`ECMMarkAsTest` module) applied to it. +# # # :: # @@ -52,6 +56,7 @@ # (To distribute this file outside of extra-cmake-modules, substitute the full # License text for the above reference.) +include(CMakeParseArguments) include(ECMMarkAsTest) include(ECMMarkNonGuiExecutable) @@ -73,7 +78,11 @@ function(ecm_add_test) endif() set(_testname "${ECM_ADD_TEST_NAME_PREFIX}${_targetname}") - add_executable(${_targetname} ${_sources}) + set(gui_args) + if(ECM_ADD_TEST_GUI) + set(gui_args WIN32 MACOSX_BUNDLE) + endif() + add_executable(${_targetname} ${gui_args} ${_sources}) if(NOT ECM_ADD_TEST_GUI) ecm_mark_nongui_executable(${_targetname}) endif() |