File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
share/rocmcmakebuildtools/cmake Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -289,13 +289,6 @@ macro(rocm_create_package)
289289 if (${CPACK_SET_DESTDIR} )
290290 set (CPACK_PACKAGING_INSTALL_PREFIX "" )
291291 endif ()
292- else ()
293- # On Windows, CPACK_SET_DESTDIR is not supported, but we need to set
294- # CPACK_PACKAGING_INSTALL_PREFIX to ensure consistent archive structure
295- # between platforms for TGZ/ZIP generators.
296- if (NOT DEFINED CPACK_PACKAGING_INSTALL_PREFIX)
297- set (CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX} " )
298- endif ()
299292 endif ()
300293
301294 rocm_get_patch_version(ROCM_VERSION_NUM)
@@ -439,6 +432,18 @@ macro(rocm_create_package)
439432 # Lintian Warning Fix: Enable post/pre scripts only if non empty
440433 rocm_check_and_configure_script_files("${PROJECT_BINARY_DIR} /debian/prerm" "${PROJECT_BINARY_DIR} /debian/postinst" )
441434
435+ # Create a CPack project config file for generator-specific settings
436+ set (_cpack_project_config "${PROJECT_BINARY_DIR} /CPackProjectConfig.cmake" )
437+ file (WRITE "${_cpack_project_config} " "
438+ # Generator-specific configuration for consistent archive paths
439+ if(CPACK_GENERATOR MATCHES \" TGZ|ZIP\" )
440+ # Use relative paths for archive generators (consistent across platforms)
441+ set(CPACK_SET_DESTDIR OFF)
442+ set(CPACK_PACKAGING_INSTALL_PREFIX \" /\" )
443+ endif()
444+ " )
445+ set (CPACK_PROJECT_CONFIG_FILE "${_cpack_project_config} " )
446+
442447 include (CPack)
443448 set (ROCM_PACKAGE_CREATED TRUE CACHE INTERNAL "Track whether rocm_create_package has been called." )
444449endmacro ()
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ file(GLOB TEST_PACKAGE ${BUILD_DIR}/*-tests.tar.gz)
77list (LENGTH TEST_PACKAGE NTEST_PACKAGE)
88test_expect_eq(${NTEST_PACKAGE} 1)
99test_exec(COMMAND ${CMAKE_COMMAND} -E tar t ${TEST_PACKAGE} )
10- test_exec(COMMAND ${CMAKE_COMMAND} -E tar x ${TEST_PACKAGE} WORKING_DIRECTORY / )
10+ test_exec(COMMAND ${CMAKE_COMMAND} -E tar x ${TEST_PACKAGE} WORKING_DIRECTORY ${PREFIX} )
1111test_expect_file(${PREFIX} /libexec/installed-tests/simple/CTestTestfile.cmake)
You can’t perform that action at this time.
0 commit comments