aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2020-01-16 17:11:41 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2020-01-16 17:02:46 +0000
commit048f0f63c9400755749edfabdb6e666af931651a (patch)
tree3b847c8c6f846dad12da9bfe0f9915f7b3fb1729 /cmake
parent938068d1e8cb83e8bdf06e6ac002f75008646ad7 (diff)
CMake build system: Skip building tests with unmet dependencies
Change-Id: I0eadf5a8d2c98486d2d8aabfe835f5ab0dbc9190 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtCreatorAPI.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake
index 3d166c8e36..7e6ba81f30 100644
--- a/cmake/QtCreatorAPI.cmake
+++ b/cmake/QtCreatorAPI.cmake
@@ -894,6 +894,12 @@ endfunction()
function(add_qtc_test name)
cmake_parse_arguments(_arg "GTEST" "" "DEFINES;DEPENDS;INCLUDES;SOURCES" ${ARGN})
+ foreach(dependency ${_arg_DEPENDS})
+ if (NOT TARGET &{dependency})
+ return()
+ endif()
+ endforeach()
+
if ($_arg_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "add_qtc_test had unparsed arguments!")
endif()