Skip to main content

CMake commands

cmake_parse_arguments​

Parse function or macro arguments

cmake_parse_arguments(<prefix> <options> <one_value_keywords>
<multi_value_keywords> <args>...)

cmake_parse_arguments(PARSE_ARGV <N> <prefix> <options>
<one_value_keywords> <multi_value_keywords>)

For example:

  • function call:
nx_run_conan(
BUILD_TYPE ${build_type}
PROFILE ${CMAKE_SOURCE_DIR}/conan_profiles/${conan_profile}.profile
FLAGS ${_additional_conan_parameters}
)
cmake_parse_arguments(CONAN "" "BUILD_TYPE;PROFILE;HOME_DIR" "FLAGS" ${ARGN})

You will have these variables:

  • CONAN_BUILD_TYPE
  • CONAN_PROFILE
  • CONAN_HOME_DIR
  • CONAN_FLAGS