Commit be652956 authored by Andreas Schuh's avatar Andreas Schuh

fix: GFLAGS_* variables take precedence in gflags_define

parent 524b83d0
......@@ -65,16 +65,18 @@ macro (gflags_define type varname docstring default)
message (FATAL_ERROR "gflags_variable: Too many macro arguments")
endif ()
if (NOT DEFINED GFLAGS_${varname})
if (DEFINED ${varname})
set(GFLAGS_${varname} "${${varname}}")
else ()
if (GFLAGS_IS_SUBPROJECT AND "${ARGC}" EQUAL 5)
set (GFLAGS_${varname} "${ARGV4}")
else ()
set (GFLAGS_${varname} "${default}")
endif ()
endif ()
endif ()
if (GFLAGS_IS_SUBPROJECT)
if (NOT DEFINED ${varname})
set (${varname} "${GFLAGS_${varname}}")
endif ()
else ()
set (${varname} "${GFLAGS_${varname}}" CACHE ${type} "${docstring}")
endif ()
......
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