Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CamiTK
CamiTK Community Edition
Commits
658fcf49
Commit
658fcf49
authored
Dec 01, 2017
by
Emmanuel Promayon
Browse files
FIXED keep compatibility with CMake 3.1 for cmake_parse_arguments
parent
f16e399e
Changes
1
Hide whitespace changes
Inline
Side-by-side
sdk/cmake/modules/macros/ParseArguments.cmake
View file @
658fcf49
#!
#! @ingroup group_sdk_cmake
#!
#! macro parse_arguments is a fork from CMakeMacroParseArguments
#! see http://www.cmake.org/Wiki/CMakeMacroParseArguments
#! for more information
#!
#! Usage:
#! \code
#! parse_arguments(PREFIX POSSIBLE_ARGUMENTS POSSIBLE_OPTIONS)
#! \endcode
#!
macro
(
parse_arguments prefix arg_names option_names
)
set
(
DEFAULT_ARGS
)
foreach
(
arg_name
${
arg_names
}
)
set
(
${
prefix
}
_
${
arg_name
}
)
endforeach
()
foreach
(
option
${
option_names
}
)
set
(
${
prefix
}
_
${
option
}
FALSE
)
endforeach
()
set
(
current_arg_name DEFAULT_ARGS
)
set
(
current_arg_list
)
foreach
(
arg
${
ARGN
}
)
set
(
larg_names
${
arg_names
}
)
list
(
FIND larg_names
"
${
arg
}
"
is_arg_name
)
if
(
is_arg_name GREATER -1
)
set
(
${
prefix
}
_
${
current_arg_name
}
${
current_arg_list
}
)
set
(
current_arg_name
${
arg
}
)
set
(
current_arg_list
)
else
()
set
(
loption_names
${
option_names
}
)
list
(
FIND loption_names
"
${
arg
}
"
is_option
)
if
(
is_option GREATER -1
)
set
(
${
prefix
}
_
${
arg
}
TRUE
)
else
()
set
(
current_arg_list
${
current_arg_list
}
${
arg
}
)
endif
()
endif
()
endforeach
()
set
(
${
prefix
}
_
${
current_arg_name
}
${
current_arg_list
}
)
endmacro
()
#! This module once implemented a fork from CMakeMacroParseArguments for legacy support reason.
#! From CMake 3.0, this module was available as CMakeParseArguments module.
#! From CMake 3.5 the cmake_parse_arguments() command is implemented natively by CMake.
#! Keep the include(CMakeParseArguments) as a placeholder, required for compatibility with projects
#! that include it to get the command from CMake 3.4 and lower.
include
(
CMakeParseArguments
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment