diff options
author | Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com> | 2022-09-21 17:19:45 (GMT) |
---|---|---|
committer | Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com> | 2022-09-21 17:19:45 (GMT) |
commit | df377a22dd2d805ddf9e59f405482934a5a932d2 (patch) | |
tree | 4d1de368ef8bc233b1fe0970820f8607b4ebb94e | |
parent | fc17277bdad832e45991de60090c8688b60855fa (diff) | |
download | CMake-df377a22dd2d805ddf9e59f405482934a5a932d2.zip CMake-df377a22dd2d805ddf9e59f405482934a5a932d2.tar.gz CMake-df377a22dd2d805ddf9e59f405482934a5a932d2.tar.bz2 |
CMakeDependentOption: allow in depends the use of .
4 files changed, 7 insertions, 1 deletions
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake index ac0e262..9a3c940 100644 --- a/Modules/CMakeDependentOption.cmake +++ b/Modules/CMakeDependentOption.cmake @@ -84,7 +84,7 @@ macro(CMAKE_DEPENDENT_OPTION option doc default depends force) else() set(${option} "${${option}_ISSET}") endif() - if("x${_CDO_CMP0127}x" STREQUAL "xx" AND "x${depends}x" MATCHES "[^A-Za-z0-9_; ]") + if("x${_CDO_CMP0127}x" STREQUAL "xx" AND "x${depends}x" MATCHES "[^A-Za-z0-9_.; ]") cmake_policy(GET_WARNING CMP0127 _CDO_CMP0127_WARNING) message(AUTHOR_WARNING "${_CDO_CMP0127_WARNING}") endif() diff --git a/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake b/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake index 61e046f..074db65 100644 --- a/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake @@ -4,3 +4,4 @@ run_cmake_script(Regex-CMP0127-NEW) run_cmake_script(Regex-CMP0127-OLD) run_cmake_script(Parentheses-CMP0127-NEW) run_cmake_script(Parentheses-CMP0127-WARN) +run_cmake_script(UseDotSymbol) diff --git a/Tests/RunCMake/CMakeDependentOption/UseDotSymbol-stdout.txt b/Tests/RunCMake/CMakeDependentOption/UseDotSymbol-stdout.txt new file mode 100644 index 0000000..15b56a1 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/UseDotSymbol-stdout.txt @@ -0,0 +1 @@ +-- USE_FOO='ON' diff --git a/Tests/RunCMake/CMakeDependentOption/UseDotSymbol.cmake b/Tests/RunCMake/CMakeDependentOption/UseDotSymbol.cmake new file mode 100644 index 0000000..8f07c48 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/UseDotSymbol.cmake @@ -0,0 +1,4 @@ +include(CMakeDependentOption) + +cmake_dependent_option(USE_FOO "Use Foo" ON "CMAKE_VERSION VERSION_GREATER_EQUAL 3.08" OFF) +message(STATUS "USE_FOO='${USE_FOO}'") |