CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
143 lines
5.3 KiB
CMake
143 lines
5.3 KiB
CMake
# ######################################################################################################################
|
|
# Copyright (C) 2017 Advanced Micro Devices, Inc.
|
|
# ######################################################################################################################
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
function(rocm_configure_package_config_file INPUT_FILE OUTPUT_FILE)
|
|
set(options)
|
|
set(oneValueArgs INSTALL_DESTINATION PREFIX)
|
|
set(multiValueArgs PATH_VARS)
|
|
|
|
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
if(PARSE_UNPARSED_ARGUMENTS)
|
|
message(
|
|
FATAL_ERROR
|
|
"Unknown keywords given to rocm_configure_package_config_file(): \"${PARSE_UNPARSED_ARGUMENTS}\"")
|
|
endif()
|
|
|
|
if(NOT PARSE_INSTALL_DESTINATION)
|
|
message(FATAL_ERROR "INSTALL_DESTINATION is required for rocm_configure_package_config_file()")
|
|
endif()
|
|
|
|
if(IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
|
set(INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
|
else()
|
|
get_filename_component(INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
|
|
endif()
|
|
|
|
if(IS_ABSOLUTE "${PARSE_INSTALL_DESTINATION}")
|
|
set(ABSOLUTE_INSTALL_DIR "${PARSE_INSTALL_DESTINATION}")
|
|
else()
|
|
set(ABSOLUTE_INSTALL_DIR "${INSTALL_PREFIX}/${PARSE_INSTALL_DESTINATION}")
|
|
endif()
|
|
|
|
file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${ABSOLUTE_INSTALL_DIR}" "${INSTALL_PREFIX}")
|
|
file(RELATIVE_PATH PACKAGE_INSTALL_RELATIVE_DIR "${INSTALL_PREFIX}" "${ABSOLUTE_INSTALL_DIR}")
|
|
|
|
set(CHECK_PREFIX)
|
|
if(PARSE_PREFIX)
|
|
# On windows there is no symlinks
|
|
if(WIN32)
|
|
set(CHECK_PREFIX
|
|
"
|
|
if(NOT \"\${PACKAGE_PREFIX_DIR}/${PACKAGE_INSTALL_RELATIVE_DIR}\" EQUAL \"\${CMAKE_CURRENT_LIST_DIR}\")
|
|
set(PACKAGE_PREFIX_DIR ${INSTALL_PREFIX})
|
|
endif()
|
|
")
|
|
endif()
|
|
endif()
|
|
|
|
foreach(_var ${PARSE_PATH_VARS})
|
|
if(NOT DEFINED ${_var})
|
|
message(FATAL_ERROR "Undefined path variable: ${_var}")
|
|
endif()
|
|
if(IS_ABSOLUTE "${${_var}}")
|
|
string(REPLACE "${INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}" PACKAGE_${_var} "${${_var}}")
|
|
else()
|
|
set(PACKAGE_${_var} "\${PACKAGE_PREFIX_DIR}/${${_var}}")
|
|
endif()
|
|
endforeach()
|
|
|
|
get_filename_component(INPUT_NAME "${INPUT_FILE}" NAME)
|
|
|
|
set(PACKAGE_INIT
|
|
"
|
|
####################################################################################
|
|
# Auto generated @PACKAGE_INIT@ by rocm_configure_package_config_file()
|
|
# from ${INPUT_NAME}
|
|
# Any changes to this file will be overwritten by the next CMake run
|
|
####################################################################################
|
|
|
|
get_filename_component(_ROCM_CMAKE_CURRENT_LIST_FILE_REAL \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)
|
|
get_filename_component(_ROCM_CMAKE_CURRENT_LIST_DIR_REAL \"\${_ROCM_CMAKE_CURRENT_LIST_FILE_REAL}\" DIRECTORY)
|
|
get_filename_component(PACKAGE_PREFIX_DIR \"\${_ROCM_CMAKE_CURRENT_LIST_DIR_REAL}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE)
|
|
|
|
${CHECK_PREFIX}
|
|
|
|
macro(set_and_check _var _file)
|
|
set(\${_var} \"\${_file}\")
|
|
if(NOT EXISTS \"\${_file}\")
|
|
message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\")
|
|
endif()
|
|
endmacro()
|
|
|
|
include(CMakeFindDependencyMacro OPTIONAL RESULT_VARIABLE _ROCMCMakeFindDependencyMacro_FOUND)
|
|
if (NOT _ROCMCMakeFindDependencyMacro_FOUND)
|
|
macro(find_dependency dep)
|
|
if (NOT \${dep}_FOUND)
|
|
set(rocm_fd_version)
|
|
if (\${ARGC} GREATER 1)
|
|
set(rocm_fd_version \${ARGV1})
|
|
endif()
|
|
set(rocm_fd_exact_arg)
|
|
if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT)
|
|
set(rocm_fd_exact_arg EXACT)
|
|
endif()
|
|
set(rocm_fd_quiet_arg)
|
|
if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
|
|
set(rocm_fd_quiet_arg QUIET)
|
|
endif()
|
|
set(rocm_fd_required_arg)
|
|
if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
|
|
set(rocm_fd_required_arg REQUIRED)
|
|
endif()
|
|
find_package(\${dep} \${rocm_fd_version}
|
|
\${rocm_fd_exact_arg}
|
|
\${rocm_fd_quiet_arg}
|
|
\${rocm_fd_required_arg}
|
|
)
|
|
string(TOUPPER \${dep} cmake_dep_upper)
|
|
if (NOT \${dep}_FOUND AND NOT \${cmake_dep_upper}_FOUND)
|
|
set(\${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE
|
|
\"\${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency \${dep} could not be found.\")
|
|
set(\${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
|
|
return()
|
|
endif()
|
|
set(rocm_fd_version)
|
|
set(rocm_fd_required_arg)
|
|
set(rocm_fd_quiet_arg)
|
|
set(rocm_fd_exact_arg)
|
|
endif()
|
|
endmacro()
|
|
endif()
|
|
|
|
macro(check_required_components _NAME)
|
|
foreach(comp \${\${_NAME}_FIND_COMPONENTS})
|
|
if(NOT \${_NAME}_\${comp}_FOUND)
|
|
if(\${_NAME}_FIND_REQUIRED_\${comp})
|
|
set(\${_NAME}_FOUND FALSE)
|
|
endif()
|
|
endif()
|
|
endforeach()
|
|
endmacro()
|
|
|
|
####################################################################################
|
|
|
|
")
|
|
|
|
configure_file("${INPUT_FILE}" "${OUTPUT_FILE}" @ONLY)
|
|
|
|
endfunction()
|