summaryrefslogtreecommitdiffstats
path: root/Modules/CPackComponent.cmake
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-03-15 17:10:33 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-03-15 17:10:33 (GMT)
commit2e900f1ec56b82b08fcd1a847a3c7317ebad2e2f (patch)
treec8d4ae1dc250a39cf139b7917bb288f90ae6da3b /Modules/CPackComponent.cmake
parentb557f3e106274cfb4a08a48d2dd3b6d4f3f67bb7 (diff)
downloadCMake-2e900f1ec56b82b08fcd1a847a3c7317ebad2e2f.zip
CMake-2e900f1ec56b82b08fcd1a847a3c7317ebad2e2f.tar.gz
CMake-2e900f1ec56b82b08fcd1a847a3c7317ebad2e2f.tar.bz2
CPackComponent: use cmake_parse_arguments
Diffstat (limited to 'Modules/CPackComponent.cmake')
-rw-r--r--Modules/CPackComponent.cmake50
1 files changed, 11 insertions, 39 deletions
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 395a268..2adc9b9 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -303,38 +303,6 @@
if(NOT CPackComponent_CMake_INCLUDED)
set(CPackComponent_CMake_INCLUDED 1)
-# Argument-parsing macro from https://cmake.org/Wiki/CMakeMacroParseArguments
-macro(cpack_parse_arguments prefix arg_names option_names)
- set(${prefix}_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()
-
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been defined. The string will eventually be appended to a CPack
@@ -392,9 +360,10 @@ endmacro()
# Macro that adds a component to the CPack installer
macro(cpack_add_component compname)
string(TOUPPER ${compname} _CPACK_ADDCOMP_UNAME)
- cpack_parse_arguments(CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}
- "DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE;PLIST"
+ cmake_parse_arguments(CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}
"HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
+ "DISPLAY_NAME;DESCRIPTION;GROUP;ARCHIVE_FILE;PLIST"
+ "DEPENDS;INSTALL_TYPES"
${ARGN}
)
@@ -464,9 +433,10 @@ endmacro()
# Macro that adds a component group to the CPack installer
macro(cpack_add_component_group grpname)
string(TOUPPER ${grpname} _CPACK_ADDGRP_UNAME)
- cpack_parse_arguments(CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME}
- "DISPLAY_NAME;DESCRIPTION;PARENT_GROUP"
+ cmake_parse_arguments(CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME}
"EXPANDED;BOLD_TITLE"
+ "DISPLAY_NAME;DESCRIPTION;PARENT_GROUP"
+ ""
${ARGN}
)
@@ -498,7 +468,8 @@ endmacro()
# Macro that adds an installation type to the CPack installer
macro(cpack_add_install_type insttype)
string(TOUPPER ${insttype} _CPACK_INSTTYPE_UNAME)
- cpack_parse_arguments(CPACK_INSTALL_TYPE_${_CPACK_INSTTYPE_UNAME}
+ cmake_parse_arguments(CPACK_INSTALL_TYPE_${_CPACK_INSTTYPE_UNAME}
+ ""
"DISPLAY_NAME"
""
${ARGN}
@@ -521,9 +492,10 @@ macro(cpack_add_install_type insttype)
endmacro()
macro(cpack_configure_downloads site)
- cpack_parse_arguments(CPACK_DOWNLOAD
- "UPLOAD_DIRECTORY"
+ cmake_parse_arguments(CPACK_DOWNLOAD
"ALL;ADD_REMOVE;NO_ADD_REMOVE"
+ "UPLOAD_DIRECTORY"
+ ""
${ARGN}
)