Commit fc602a9c authored by Ben Boeckel's avatar Ben Boeckel Committed by T.J. Corona

cmb: support changing the suffix of the package

parent 63a3ab64
Pipeline #63116 running with stage
......@@ -140,6 +140,17 @@ function (superbuild_add_packaging)
QT_LIBRARY_DIR)
endif ()
include(cmb.suffix)
list(APPEND superbuild_export_variables
CMB_PACKAGE_SUFFIX)
if (cmb_enabled)
set(CMB_PACKAGE_FILE_NAME ""
CACHE STRING "If set, overrides the generated filename for the package")
list(APPEND superbuild_export_variables
CMB_PACKAGE_FILE_NAME)
endif ()
option(cmb_ENABLE_HYDROLOGY_PACKAGE "Build full hydrology package" ON)
foreach (generator IN LISTS generators)
......
......@@ -4,35 +4,27 @@ include(cmb-version)
include(paraview-version)
set(CPACK_PACKAGE_VENDOR "Kitware, Inc.")
set(CPACK_RESOURCE_FILE_LICENSE
"${superbuild_source_directory}/License.txt")
set(CPACK_PACKAGE_VERSION_MAJOR ${cmb_version_major})
set(CPACK_PACKAGE_VERSION_MINOR ${cmb_version_minor})
if (cmb_version_suffix)
set(CPACK_PACKAGE_VERSION_PATCH ${cmb_version_patch}-${cmb_version_suffix})
else()
set(CPACK_PACKAGE_VERSION_PATCH ${cmb_version_patch})
endif()
SET(CPACK_PACKAGE_INSTALL_DIRECTORY
"${cmb_package_name} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${cmb_package_name}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
if(NOT DEFINED CPACK_SYSTEM_NAME)
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif()
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win64)
else(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win32)
endif()
endif()
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
set(CPACK_PACKAGE_VERSION_PATCH ${cmb_version_patch}${cmb_version_suffix})
if (CMB_PACKAGE_SUFFIX)
set(CPACK_PACKAGE_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}-${CMB_PACKAGE_SUFFIX})
endif ()
if (NOT DEFINED package_filename)
set(package_filename "${CMB_PACKAGE_FILE_NAME}")
endif ()
if (package_filename)
set(CPACK_PACKAGE_FILE_NAME "${package_filename}")
else ()
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
endif()
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
endif ()
# Set the license file.
set(CPACK_RESOURCE_FILE_LICENSE
"${superbuild_source_directory}/License.txt")
list(SORT cmb_programs_to_install)
list(REMOVE_DUPLICATES cmb_programs_to_install)
......
# Set suffix to be used for generating archives. This ensures that the package
# files have decent names that we can directly upload to the website.
set(package_suffix_items)
if (qt4_enabled)
list(APPEND package_suffix_items
Qt4)
endif ()
if (qt5_enabled)
list(APPEND package_suffix_items
Qt5)
endif ()
if (APPLE)
list(APPEND package_suffix_items
"OSX${CMAKE_OSX_DEPLOYMENT_TARGET}")
else ()
list(APPEND package_suffix_items
"${CMAKE_SYSTEM_NAME}")
endif ()
if (superbuild_is_64bit)
list(APPEND package_suffix_items
"64bit")
else ()
list(APPEND package_suffix_items
"32bit")
endif()
string(REPLACE ";" "-" package_suffix_default "${package_suffix_items}")
# CMB_PACKAGE_SUFFIX: A string that can be set to the suffix you want to use
# for all the generated packages. By default, it is determined by the features
# enabled.
set(CMB_PACKAGE_SUFFIX "<default>"
CACHE STRING "String to use as a suffix for generated packages")
mark_as_advanced(CMB_PACKAGE_SUFFIX)
if (NOT CMB_PACKAGE_SUFFIX OR CMB_PACKAGE_SUFFIX STREQUAL "<default>")
set(CMB_PACKAGE_SUFFIX "${package_suffix_default}")
elseif (NOT CMB_PACKAGE_SUFFIX STREQUAL package_suffix_default)
message(WARNING "The suffix for the package (${CMB_PACKAGE_SUFFIX}) does not "
"match the suggested suffix based on build options "
"(${package_suffix_default}). Set it to '<default>' or "
"an empty string to use the default suffix. Using the "
"provided suffix.")
endif ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment