diff options
-rw-r--r-- | Help/release/dev/ifw-user-interfaces.rst | 7 | ||||
-rw-r--r-- | Modules/CPackIFW.cmake | 32 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.cxx | 30 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.h | 3 |
4 files changed, 68 insertions, 4 deletions
diff --git a/Help/release/dev/ifw-user-interfaces.rst b/Help/release/dev/ifw-user-interfaces.rst new file mode 100644 index 0000000..26e241a --- /dev/null +++ b/Help/release/dev/ifw-user-interfaces.rst @@ -0,0 +1,7 @@ +ifw-user-interfaces +------------------- + +* The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and + :command:`cpack_ifw_configure_component_group` commands gained a new + ``USER_INTERFACES`` option to add a list of additonal pages to the IFW + installer. diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index ebc5c90..c502099 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -195,7 +195,8 @@ # [SCRIPT <script>] # [PRIORITY <priority>] # [DEPENDS <com_id> ...] -# [LICENSES <display_name> <file_path> ...]) +# [LICENSES <display_name> <file_path> ...] +# [USER_INTERFACES <file_path> <file_path> ...]) # # This command should be called after :command:`cpack_add_component` command. # @@ -221,6 +222,8 @@ # ``LICENSES`` pair of <display_name> and <file_path> of license text for this # component. You can specify more then one license. # +# ``USER_INTERFACES`` a list of <file_path> representing pages to load +# # -------------------------------------------------------------------------- # # .. command:: cpack_ifw_configure_component_group @@ -234,7 +237,8 @@ # [VERSION <version>] # [SCRIPT <script>] # [PRIORITY <priority>] -# [LICENSES <display_name> <file_path> ...]) +# [LICENSES <display_name> <file_path> ...] +# [USER_INTERFACES <file_path> <file_path> ...]) # # This command should be called after :command:`cpack_add_component_group` # command. @@ -254,6 +258,8 @@ # ``LICENSES`` pair of <display_name> and <file_path> of license text for this # component group. You can specify more then one license. # +# ``USER_INTERFACES`` a list of <file_path> representing pages to load +# # -------------------------------------------------------------------------- # # .. command:: cpack_ifw_add_repository @@ -543,6 +549,22 @@ macro(_cpack_ifw_resolve_lisenses _variable) endif() endmacro() +# Resolve full path to a list of provided files +macro(_cpack_ifw_resolve_file_list _variable) + if(${_variable}) + set(_ifw_list_fix) + foreach(_ifw_file_arg ${${_variable}}) + get_filename_component(_ifw_file_arg "${_ifw_file_arg}" ABSOLUTE) + if(EXISTS ${_ifw_file_arg}) + list(APPEND _ifw_list_fix "${_ifw_file_arg}") + else() + message(WARNING "CPack IFW: page file \"${_ifw_file_arg}\" does not exist. Skipping") + endif() + endforeach(_ifw_file_arg) + set(${_variable} "${_ifw_list_fix}") + endif() +endmacro() + # Macro for configure component macro(cpack_ifw_configure_component compname) @@ -550,11 +572,12 @@ macro(cpack_ifw_configure_component compname) set(_IFW_OPT COMMON ESSENTIAL) set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY) - set(_IFW_MULTI_ARGS DEPENDS LICENSES) + set(_IFW_MULTI_ARGS DEPENDS LICENSES USER_INTERFACES) cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN}) _cpack_ifw_resolve_script(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_SCRIPT) _cpack_ifw_resolve_lisenses(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_LICENSES) + _cpack_ifw_resolve_file_list(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_USER_INTERFACES) set(_CPACK_IFWCOMP_STR "\n# Configuration for IFW component \"${compname}\"\n") @@ -589,11 +612,12 @@ macro(cpack_ifw_configure_component_group grpname) set(_IFW_OPT) set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY) - set(_IFW_MULTI_ARGS LICENSES) + set(_IFW_MULTI_ARGS LICENSES USER_INTERFACES) cmake_parse_arguments(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN}) _cpack_ifw_resolve_script(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_SCRIPT) _cpack_ifw_resolve_lisenses(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_LICENSES) + _cpack_ifw_resolve_file_list(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_USER_INTERFACES) set(_CPACK_IFWGRP_STR "\n# Configuration for IFW component group \"${grpname}\"\n") diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index bc503fc..2d3cf12 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -153,6 +153,7 @@ void cmCPackIFWPackage::DefaultConfiguration() ReleaseDate = ""; Script = ""; Licenses.clear(); + UserInterfaces.clear(); SortingPriority = ""; Default = ""; Essential = ""; @@ -229,6 +230,12 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component) Script = option; } + // User interfaces + if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) { + UserInterfaces.clear(); + cmSystemTools::ExpandListArgument(option, UserInterfaces); + } + // CMake dependencies if (!component->Dependencies.empty()) { std::vector<cmCPackComponent*>::iterator dit; @@ -322,6 +329,12 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group) Script = option; } + // User interfaces + if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) { + UserInterfaces.clear(); + cmSystemTools::ExpandListArgument(option, UserInterfaces); + } + // Licenses if (const char* option = this->GetOption(prefix + "LICENSES")) { Licenses.clear(); @@ -417,6 +430,23 @@ void cmCPackIFWPackage::GeneratePackageFile() xout.Element("Script", name); } + // User Interfaces (copy to meta dir) + std::vector<std::string> userInterfaces = UserInterfaces; + for (size_t i = 0; i < userInterfaces.size(); i++) { + std::string name = cmSystemTools::GetFilenameName(userInterfaces[i]); + std::string path = Directory + "/meta/" + name; + cmsys::SystemTools::CopyFileIfDifferent(userInterfaces[i].data(), + path.data()); + userInterfaces[i] = name; + } + if (!userInterfaces.empty()) { + xout.StartElement("UserInterfaces"); + for (size_t i = 0; i < userInterfaces.size(); i++) { + xout.Element("UserInterface", userInterfaces[i]); + } + xout.EndElement(); + } + // Dependencies std::set<DependenceStruct> compDepSet; for (std::set<DependenceStruct*>::iterator ait = AlienDependencies.begin(); diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h index 579eeb8..739ae3e 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.h +++ b/Source/CPack/IFW/cmCPackIFWPackage.h @@ -99,6 +99,9 @@ public: /// List of license agreements to be accepted by the installing user std::vector<std::string> Licenses; + /// List of pages to load + std::vector<std::string> UserInterfaces; + /// Priority of the component in the tree std::string SortingPriority; |