Create variable ROCM_EXPORT_PARSE_TARGETS_LIBRARY to remove workaround
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -37,6 +37,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-function")
+set(ROCM_EXPORT_PARSE_TARGETS_LIBRARY ON)
# Build options
option(BUILD_TEST "Build tests" ON)

MODIFY
cmake/ROCMExportTargetsHeaderOnly.cmake
cmake/ROCMExportTargetsHeaderOnly.cmake
@@ -95,11 +95,12 @@ function(rocm_export_targets_header_only)
if(PARSE_TARGETS)
rocm_write_package_template_function(${CONFIG_TEMPLATE} include "\${${PACKAGE_NAME}_TARGET_FILE}")
-# Disabled for PyTorch
-# foreach(NAME ${PACKAGE_NAME} ${PACKAGE_NAME_UPPER} ${PACKAGE_NAME_LOWER})
-# rocm_write_package_template_function(${CONFIG_TEMPLATE} set ${NAME}_LIBRARIES ${PARSE_TARGETS})
-# rocm_write_package_template_function(${CONFIG_TEMPLATE} set ${NAME}_LIBRARY ${PARSE_TARGETS})
-# endforeach()
+ if(ROCM_EXPORT_PARSE_TARGETS_LIBRARY)
+ foreach(NAME ${PACKAGE_NAME} ${PACKAGE_NAME_UPPER} ${PACKAGE_NAME_LOWER})
+ rocm_write_package_template_function(${CONFIG_TEMPLATE} set ${NAME}_LIBRARIES ${PARSE_TARGETS})
+ rocm_write_package_template_function(${CONFIG_TEMPLATE} set ${NAME}_LIBRARY ${PARSE_TARGETS})
+ endforeach()
+ endif()
endif()
rocm_configure_package_config_file(
@@ -136,5 +137,3 @@ function(rocm_export_targets_header_only)
${CONFIG_PACKAGE_INSTALL_DIR})
endfunction()
-
-

Create variable ROCM_EXPORT_PARSE_TARGETS_LIBRARY to remove workaround