mirror of
https://github.com/gflags/gflags.git
synced 2025-04-04 13:05:03 +00:00
fix: GFLAGS_* variables take precedence in gflags_define
This commit is contained in:
parent
524b83d026
commit
be65295633
1 changed files with 8 additions and 6 deletions
|
@ -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 (GFLAGS_IS_SUBPROJECT AND "${ARGC}" EQUAL 5)
|
||||
set (GFLAGS_${varname} "${ARGV4}")
|
||||
if (DEFINED ${varname})
|
||||
set(GFLAGS_${varname} "${${varname}}")
|
||||
else ()
|
||||
set (GFLAGS_${varname} "${default}")
|
||||
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 ()
|
||||
set (${varname} "${GFLAGS_${varname}}")
|
||||
else ()
|
||||
set (${varname} "${GFLAGS_${varname}}" CACHE ${type} "${docstring}")
|
||||
endif ()
|
||||
|
|
Loading…
Add table
Reference in a new issue