Commit 9948eb51 authored by Ryan Krattiger's avatar Ryan Krattiger
Browse files

Re-enabled overriding CPACK_PACAKGE_FILE_NAME for packaging

parent 53d62806
......@@ -227,6 +227,9 @@ function (superbuild_add_packaging)
return ()
endif ()
# FUTURE: move this to superbuild_add_extra_package_test
list(APPEND superbuild_export_variables SUPERBUILD_PACKAGE_MODE)
if (WIN32)
set(generators
ZIP)
......@@ -259,20 +262,24 @@ function (superbuild_add_packaging)
list(APPEND superbuild_export_variables
BOOST_ADDITIONAL_LIBRARIES)
include(package.test)
get_property(PACKAGE_LABELS GLOBAL PROPERTY "${SUPERBUILD_PACKAGE_MODE}_PACKAGE_LABELS")
get_property(PACKAGE_SUFFIX GLOBAL PROPERTY "${SUPERBUILD_PACKAGE_MODE}_PACKAGE_SUFFIX")
superbuild_package_suffix(PACKAGE_SUFFIX)
string(TOUPPER "${SUPERBUILD_PACKAGE_MODE}" PACKAGE_LABELS)
# Setup the package suffix for user override
superbuild_package_suffix("${SUPERBUILD_PACKAGE_MODE}_PACKAGE_SUFFIX")
list(APPEND superbuild_export_variables
PACKAGE_SUFFIX)
${SUPERBUILD_PACKAGE_MODE}_PACKAGE_SUFFIX
)
# Setup the package file name for override
set("${SUPERBUILD_PACKAGE_MODE}_PACKAGE_FILE_NAME" ""
CACHE STRING "If set, overrides the generated filename for the package")
set(PACKAGE_FILE_NAME ${SUPERBUILD_PACKAGE_MODE}_PACKAGE_FILE_NAME)
mark_as_advanced("${SUPERBUILD_PACKAGE_MODE}_PACKAGE_FILE_NAME")
list(APPEND superbuild_export_variables
PACKAGE_FILE_NAME)
${SUPERBUILD_PACKAGE_MODE}_PACKAGE_FILE_NAME)
# This must be included after the PACKAGE_SUFFIX and PACKAGE_FILE_NAME variables are determined
include(package.test)
foreach (generator IN LISTS generators)
superbuild_add_extra_package_test(${SUPERBUILD_PACKAGE_MODE} "${generator}"
......
......@@ -2,12 +2,12 @@ include (SuperbuildTestingMacros)
set(modelbuilder_extract_root "${CMAKE_BINARY_DIR}/Testing/Temporary")
if (CMB_PACKAGE_FILE_NAME)
set(glob_prefix "${CMB_PACKAGE_FILE_NAME}")
if (${SUPERBUILD_PACKAGE_MODE}_PACKAGE_FILE_NAME)
set(glob_prefix "${${SUPERBUILD_PACKAGE_MODE}_PACKAGE_FILE_NAME}")
else ()
set(glob_prefix "modelbuilder-*")
if (CMB_PACKAGE_SUFFIX)
set(glob_prefix "${glob_prefix}-${CMB_PACKAGE_SUFFIX}")
if (${SUPERBUILD_PACKAGE_MODE}_PACKAGE_SUFFIX AND NOT ${SUPERBUILD_PACKAGE_MODE}_PACKAGE_SUFFIX STREQUAL "<default>")
set(glob_prefix "${glob_prefix}-${${SUPERBUILD_PACKAGE_MODE}_PACKAGE_SUFFIX}")
endif ()
endif ()
......@@ -22,7 +22,7 @@ package file.
#]==]
function (add_package_extract_test generator)
set(extract_dir "${modelbuilder_extract_root}/modelbuilder-${generator}/test-extracted")
set(extract_dir "${modelbuilder_extract_root}/${SUPERBUILD_PACKAGE_MODE}-${generator}/test-extracted")
superbuild_add_extract_test("modelbuilder" "${glob_prefix}" "${generator}" "${extract_dir}")
endfunction ()
......
......@@ -29,7 +29,7 @@ if (package_suffix)
endif ()
if (NOT DEFINED package_filename)
set(package_filename "${CMB_PACKAGE_FILE_NAME}")
set(package_filename "${${SUPERBUILD_PACKAGE_MODE}_PACKAGE_FILE_NAME}")
endif ()
if (package_filename)
......
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