# variable. When gflags is a subproject of another project (GFLAGS_IS_SUBPROJECT),
# the variable is not added to the CMake cache. Otherwise it is cached.
macro (gflags_define type varname docstring default)
- if (ARGC GREATER 5)
+ # note that ARGC must be expanded here, as it is not a "real" variable
+ # (see the CMake documentation for the macro command)
+ if ("${ARGC}" GREATER 5)
message (FATAL_ERROR "gflags_variable: Too many macro arguments")
endif ()
if (NOT DEFINED GFLAGS_${varname})
- if (GFLAGS_IS_SUBPROJECT AND ARGC EQUAL 5)
+ if (GFLAGS_IS_SUBPROJECT AND "${ARGC}" EQUAL 5)
set (GFLAGS_${varname} "${ARGV4}")
else ()
set (GFLAGS_${varname} "${default}")
macro (gflags_property varname property value)
gflags_is_cached (_cached ${varname})
if (_cached)
- if (property STREQUAL ADVANCED)
+ # note that property must be expanded here, as it is not a "real" variable
+ # (see the CMake documentation for the macro command)
+ if ("${property}" STREQUAL "ADVANCED")
if (${value})
mark_as_advanced (FORCE ${varname})
else ()