aboutsummaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-05-28 16:08:27 +0200
committerEike Ziller <eike.ziller@qt.io>2019-05-29 13:26:35 +0000
commit0bbc5ef57465b94c63fed1cf8255a9b2a07e981c (patch)
tree30a67c1413fcdb047215979d07b4313753888e0f /src/CMakeLists.txt
parent0a88ad3c27853069acf400fa6353170095c18c93 (diff)
CMake build: Add option for disabling build of executable
So the package build can later easily separate sdktool and windows debugging helpers etc. Add a extend_qtc_executable similar to extend_qtc_plugin Change-Id: Ie790e86e12b0fed41c912e8205a273ac857f3854 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0a8825990a..0943ef2487 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -416,6 +416,17 @@ function(add_qtc_executable name)
update_cached_list(__QTC_EXECUTABLES "${name}")
+ string(TOUPPER "BUILD_EXECUTABLE_${name}" _build_executable_var)
+ set(_build_executable_default "ON")
+ if (DEFINED ENV{QTC_${_build_executable_var}})
+ set(_build_executable_default "$ENV{QTC_${_build_executable_var}}")
+ endif()
+ set(${_build_executable_var} "${_build_executable_default}" CACHE BOOL "Build executable ${name}.")
+
+ if (NOT ${_build_executable_var})
+ return()
+ endif()
+
set(_DESTINATION "${IDE_LIBEXEC_PATH}")
if (_arg_DESTINATION)
set(_DESTINATION "${_arg_DESTINATION}")
@@ -450,6 +461,15 @@ function(add_qtc_executable name)
install(TARGETS ${name} DESTINATION "${_DESTINATION}")
endfunction()
+function(extend_qtc_executable name)
+ if (NOT (name IN_LIST __QTC_EXECUTABLES))
+ message(FATAL_ERROR "extend_qtc_executable: Unknown executable target \"${name}\"")
+ endif()
+ if (TARGET ${name})
+ extend_qtc_target(${name} ${ARGN})
+ endif()
+endfunction()
+
function(add_qtc_test name)
cmake_parse_arguments(_arg "" "" "DEFINES;DEPENDS;INCLUDES;SOURCES" ${ARGN})