diff options
author | Robert <krzmbrzl@gmail.com> | 2020-09-23 12:00:31 +0300 |
---|---|---|
committer | Robert <krzmbrzl@gmail.com> | 2020-09-23 12:00:31 +0300 |
commit | cf92cf9c0766b03a8096b499e465a6a8cc28b6f1 (patch) | |
tree | 51b38889bc5755565473b9379019c55593706db4 /CMakeLists.txt | |
parent | 69dfdd2135f7fd6fadd662d77bc4e712a91fd275 (diff) |
BUILD(cmake): Suppress warning on following runs
The way the deprecation check for BUILD_TESTING worked, it would issue a
warning in any case from the second run onwards (as CTest will set this
variable to the cache)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e3fe096c7..cb4780571 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,7 @@ message(STATUS "Build type: ${BUILD_STR}") message(STATUS "##################################################") # We have to check for BUILD_TESTING before including CTest as CTest defines this variable -if(DEFINED BUILD_TESTING) +if(DEFINED BUILD_TESTING AND NOT BUILD_TESTING_CHECKED) message(WARNING "Use of option \"BUILD_TESTING\" is deprecated. Use \"tests\" instead.") if(NOT tests) @@ -124,6 +124,8 @@ if(DEFINED BUILD_TESTING) endif() endif() +set(BUILD_TESTING_CHECKED ON INTERNAL CACHE BOOL "Persistent helper variable" FORCE) + if(tests) include(CTest) endif() |