Fix Cmake macro that disables unit tests when invoked as a subproject
This commit is contained in:
parent
1bae9c555c
commit
d2e421ba76
@ -49,13 +49,14 @@ function(set_artifact_dir path)
|
||||
endfunction()
|
||||
|
||||
function(disable_tests_if_subproject)
|
||||
if (NOT DEFINED PROJECT_NAME)
|
||||
option(BUILD_TESTING "Build and run unit tests" ON)
|
||||
else()
|
||||
option(BUILD_TESTING "Build and run unit tests" OFF)
|
||||
option(BUILD_TESTING "Build unit tests" ON)
|
||||
|
||||
if (DEFINED PROJECT_NAME)
|
||||
set(BUILD_TESTING OFF PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(use_ccache)
|
||||
option(USE_CCACHE
|
||||
[=[Use ccache compiler cache to speed up builds.
|
||||
|
@ -13,7 +13,7 @@ disable_tests_if_subproject()
|
||||
#git_setup_submodules()
|
||||
|
||||
project(QJsonModel
|
||||
VERSION 0.0.6
|
||||
VERSION 0.0.7
|
||||
LANGUAGES C CXX
|
||||
# Save this for later:
|
||||
# HOMEPAGE_URL <URL>
|
||||
|
Loading…
Reference in New Issue
Block a user