diff --git a/catch/CMakeLists.txt b/catch/CMakeLists.txt index b249a8a431..d4037ff272 100644 --- a/catch/CMakeLists.txt +++ b/catch/CMakeLists.txt @@ -17,6 +17,10 @@ endif() # flag to generate standalone exe per src file. message(STATUS "STANDALONE_TESTS : ${STANDALONE_TESTS}") +if(NOT WIN32) + set(CPACK_SET_DESTDIR ON CACHE BOOL "Installer package will install hip catch to CMAKE_INSTALL_PREFIX instead of CPACK_PACKAGING_INSTALL_PREFIX") +endif() + # Check if platform is set if(NOT HIP_PLATFORM STREQUAL "amd" AND NOT HIP_PLATFORM STREQUAL "nvidia") message(FATAL_ERROR "Unexpected HIP_PLATFORM: " ${HIP_PLATFORM}) diff --git a/catch/packaging/CMakeLists.txt b/catch/packaging/CMakeLists.txt index 019e2cd02c..f8306248d6 100644 --- a/catch/packaging/CMakeLists.txt +++ b/catch/packaging/CMakeLists.txt @@ -30,7 +30,6 @@ include(GNUInstallDirs) ############################# # Packaging steps ############################# -set(CPACK_SET_DESTDIR TRUE) if(NOT DEFINED CPACK_INSTALL_PREFIX) set(CPACK_INSTALL_PREFIX "/opt/rocm/") endif() diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 19604b9d12..955817883e 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -24,6 +24,9 @@ project(hip-samples) option(ENABLE_ADDRESS_SANITIZER "Option to enable ASAN build" OFF) option(BUILD_SHARED_LIBS "Use this option to link with shared hip runtime libraries" ON) +if(NOT WIN32) + set(CPACK_SET_DESTDIR ON CACHE BOOL "Installer package will install hip-samples to CMAKE_INSTALL_PREFIX instead of CPACK_PACKAGING_INSTALL_PREFIX") +endif() # Read -DROCM_Path and env{ROCM_PATH} if(NOT DEFINED ROCM_PATH) if(DEFINED ENV{ROCM_PATH}) diff --git a/samples/packaging/CMakeLists.txt b/samples/packaging/CMakeLists.txt index 8d931faa17..78779eb98d 100644 --- a/samples/packaging/CMakeLists.txt +++ b/samples/packaging/CMakeLists.txt @@ -32,7 +32,6 @@ include(GNUInstallDirs) ############################# # Packaging steps ############################# -set(CPACK_SET_DESTDIR TRUE) if(NOT DEFINED CPACK_INSTALL_PREFIX) set(CPACK_INSTALL_PREFIX "/opt/rocm/") endif()