Commit f7121086 authored by Ghislain MARY's avatar Ghislain MARY

Prevent converting string option to boolean when searching for conflicting options.

parent f0eba176
......@@ -663,12 +663,17 @@ macro(detect_conflicting_cmake_options)
string(REGEX MATCH "^-D(.+)=(.*)$" _match "${_option}")
if(_match)
set(_new_option "-D${CMAKE_MATCH_1}=")
if(CMAKE_MATCH_2)
set(_new_option "${_new_option}ON")
set(_conflicting_option "${_new_option}OFF")
set(_value ${CMAKE_MATCH_2})
if(CMAKE_MATCH_1 MATCHES "^ENABLE_.*$")
if(_value)
set(_new_option "${_new_option}ON")
set(_conflicting_option "${_new_option}OFF")
else()
set(_new_option "${_new_option}OFF")
set(_conflicting_option "${_new_option}ON")
endif()
else()
set(_new_option "${_new_option}OFF")
set(_conflicting_option "${_new_option}ON")
set(_new_option "${_new_option}${_value}")
endif()
list(FIND _new_options "${_new_option}" _found)
list(FIND _new_options "${_conflicting_option}" _conflict_found)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment