diff options
-rw-r--r-- | Modules/CMakeDependentOption.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeDependentOption/Parentheses.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeDependentOption/Regex-stdout.txt (renamed from Tests/RunCMake/CMakeDependentOption/Parentheses-stdout.txt) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeDependentOption/Regex.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake | 2 |
5 files changed, 7 insertions, 12 deletions
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake index 0a291f2..96855d2 100644 --- a/Modules/CMakeDependentOption.cmake +++ b/Modules/CMakeDependentOption.cmake @@ -42,10 +42,7 @@ macro(CMAKE_DEPENDENT_OPTION option doc default depends force) if(${option}_ISSET MATCHES "^${option}_ISSET$") set(${option}_AVAILABLE 1) foreach(d ${depends}) - string(REPLACE "(" " ( " _CMAKE_CDO_DEP "${d}") - string(REPLACE ")" " ) " _CMAKE_CDO_DEP "${_CMAKE_CDO_DEP}") - string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${_CMAKE_CDO_DEP}") - unset(_CMAKE_CDO_DEP) + string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}") if(${CMAKE_DEPENDENT_OPTION_DEP}) else() set(${option}_AVAILABLE 0) diff --git a/Tests/RunCMake/CMakeDependentOption/Parentheses.cmake b/Tests/RunCMake/CMakeDependentOption/Parentheses.cmake deleted file mode 100644 index c2951f1..0000000 --- a/Tests/RunCMake/CMakeDependentOption/Parentheses.cmake +++ /dev/null @@ -1,7 +0,0 @@ -include(CMakeDependentOption) - -set(A 1) -set(B 1) -set(C 0) -cmake_dependent_option(USE_FOO "Use Foo" ON "A AND (B OR C)" OFF) -message(STATUS "USE_FOO='${USE_FOO}'") diff --git a/Tests/RunCMake/CMakeDependentOption/Parentheses-stdout.txt b/Tests/RunCMake/CMakeDependentOption/Regex-stdout.txt index 15b56a1..15b56a1 100644 --- a/Tests/RunCMake/CMakeDependentOption/Parentheses-stdout.txt +++ b/Tests/RunCMake/CMakeDependentOption/Regex-stdout.txt diff --git a/Tests/RunCMake/CMakeDependentOption/Regex.cmake b/Tests/RunCMake/CMakeDependentOption/Regex.cmake new file mode 100644 index 0000000..8342a01 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Regex.cmake @@ -0,0 +1,5 @@ +include(CMakeDependentOption) + +set(FOO "lower") +cmake_dependent_option(USE_FOO "Use Foo" ON "FOO MATCHES (UPPER|lower)" OFF) +message(STATUS "USE_FOO='${USE_FOO}'") diff --git a/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake b/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake index bbdd3e5..e1045f2 100644 --- a/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake @@ -1,3 +1,3 @@ include(RunCMake) -run_cmake_script(Parentheses) +run_cmake_script(Regex) |