forked from qt-creator/qt-creator
CMake build system: Skip building tests with unmet dependencies
Change-Id: I0eadf5a8d2c98486d2d8aabfe835f5ab0dbc9190 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -894,6 +894,12 @@ endfunction()
|
|||||||
function(add_qtc_test name)
|
function(add_qtc_test name)
|
||||||
cmake_parse_arguments(_arg "GTEST" "" "DEFINES;DEPENDS;INCLUDES;SOURCES" ${ARGN})
|
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)
|
if ($_arg_UNPARSED_ARGUMENTS)
|
||||||
message(FATAL_ERROR "add_qtc_test had unparsed arguments!")
|
message(FATAL_ERROR "add_qtc_test had unparsed arguments!")
|
||||||
endif()
|
endif()
|
||||||
|
Reference in New Issue
Block a user