mirror of
https://github.com/fmtlib/fmt.git
synced 2025-04-16 23:42:38 +00:00
Fix compatibility with CMake 3.4 (#1779)
This commit is contained in:
parent
f19b1a521e
commit
89d0c7124b
@ -24,15 +24,23 @@ function(join result_var)
|
|||||||
set(${result_var} "${result}" PARENT_SCOPE)
|
set(${result_var} "${result}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
|
||||||
# Sets a cache variable with a docstring joined from multiple arguments:
|
# Sets a cache variable with a docstring joined from multiple arguments:
|
||||||
# set(<variable> <value>... CACHE <type> <docstring>...)
|
# set(<variable> <value>... CACHE <type> <docstring>...)
|
||||||
# This allows splitting a long docstring for readability.
|
# This allows splitting a long docstring for readability.
|
||||||
function(set_verbose)
|
function(set_verbose)
|
||||||
cmake_parse_arguments(SET_VERBOSE "" "" "CACHE" ${ARGN})
|
# cmake_parse_arguments is broken in CMake 3.4 (cannot parse CACHE) so use
|
||||||
list(GET SET_VERBOSE_CACHE 0 type)
|
# list instead.
|
||||||
list(REMOVE_AT SET_VERBOSE_CACHE 0)
|
list(GET ARGN 0 var)
|
||||||
join(doc ${SET_VERBOSE_CACHE})
|
list(REMOVE_AT ARGN 0)
|
||||||
set(${SET_VERBOSE_UNPARSED_ARGUMENTS} CACHE ${type} ${doc})
|
list(GET ARGN 0 val)
|
||||||
|
list(REMOVE_AT ARGN 0)
|
||||||
|
list(REMOVE_AT ARGN 0)
|
||||||
|
list(GET ARGN 0 type)
|
||||||
|
list(REMOVE_AT ARGN 0)
|
||||||
|
join(doc ${ARGN})
|
||||||
|
set(${var} ${val} CACHE ${type} ${doc})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Set the default CMAKE_BUILD_TYPE to Release.
|
# Set the default CMAKE_BUILD_TYPE to Release.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user