update
This commit is contained in:
parent
8dce040cd9
commit
0d3e54f39e
20
utils.cmake
20
utils.cmake
|
@ -1936,13 +1936,17 @@ function(add_project_config)
|
|||
message(AUTHOR_WARNING "add_project_config: You need to call setup_project() first!")
|
||||
return()
|
||||
endif()
|
||||
cmake_parse_arguments(arg "" "KEY;VALUE" "" ${ARGN})
|
||||
cmake_parse_arguments(arg "" "KEY;VALUE;CONDITION" "" ${ARGN})
|
||||
if(NOT arg_KEY)
|
||||
message(AUTHOR_WARNING "add_project_config: You need to specify the KEY name!")
|
||||
return()
|
||||
endif()
|
||||
if(NOT arg_VALUE)
|
||||
message(AUTHOR_WARNING "add_project_config: You need to specify the VALUE value!")
|
||||
if(NOT arg_VALUE AND NOT arg_CONDITION)
|
||||
message(AUTHOR_WARNING "add_project_config: You need to specify either the VALUE value or the CONDITION value!")
|
||||
return()
|
||||
endif()
|
||||
if(arg_VALUE AND arg_CONDITION)
|
||||
message(AUTHOR_WARNING "add_project_config: VALUE and CONDITION can't be both specified at the same time!")
|
||||
return()
|
||||
endif()
|
||||
if(arg_UNPARSED_ARGUMENTS)
|
||||
|
@ -1954,7 +1958,15 @@ function(add_project_config)
|
|||
set(__prefix "${PROJECT_NAME}_FEATURE")
|
||||
message(AUTHOR_WARNING "add_project_config: config prefix is not set, using ${__prefix} as default.")
|
||||
endif()
|
||||
set_property(TARGET ${__target} APPEND PROPERTY __PROJECT_CONFIG_OPTIONS "${__prefix}_${arg_KEY}=${arg_VALUE}")
|
||||
set(__value "${arg_VALUE}")
|
||||
if(arg_CONDITION)
|
||||
if(${arg_CONDITION})
|
||||
set(__value "TRUE")
|
||||
else()
|
||||
set(__value "FALSE")
|
||||
endif()
|
||||
endif()
|
||||
set_property(TARGET ${__target} APPEND PROPERTY __PROJECT_CONFIG_OPTIONS "${__prefix}_${arg_KEY}=${__value}")
|
||||
endfunction()
|
||||
|
||||
function(enable_project_config)
|
||||
|
|
Loading…
Reference in New Issue