1diff --git a/library/src/CMakeLists.txt b/library/src/CMakeLists.txt
2index 3a16304..606b711 100644
3--- a/library/src/CMakeLists.txt
4+++ b/library/src/CMakeLists.txt
5@@ -250,12 +250,12 @@ foreach( target
6
7 endforeach()
8
9-add_executable( rocfft_aot_helper
10+add_executable( rocfft_aot_helper EXCLUDE_FROM_ALL
11 rocfft_aot_helper.cpp
12 rocfft_stub.cpp
13 )
14
15-add_executable( rocfft_config_search
16+add_executable( rocfft_config_search EXCLUDE_FROM_ALL
17 rocfft_config_search.cpp
18 rocfft_stub.cpp
19 )
20@@ -279,10 +279,10 @@ endif()
21
22 target_link_libraries( rocfft PRIVATE ${ROCFFT_DEVICE_LINK_LIBS} )
23
24-target_link_libraries( rocfft PRIVATE rocfft-device-0 )
25-target_link_libraries( rocfft PRIVATE rocfft-device-1 )
26-target_link_libraries( rocfft PRIVATE rocfft-device-2 )
27-target_link_libraries( rocfft PRIVATE rocfft-device-3 )
28+foreach( sub ${AMDGPU_TARGETS} )
29+ target_link_libraries( rocfft PRIVATE -lrocfft-device-${sub} )
30+endforeach()
31+
32 foreach( target rocfft rocfft_aot_helper rocfft_config_search )
33 # RTC uses dladdr to find the RTC helper program
34 if( NOT WIN32 )
35@@ -347,7 +347,7 @@ add_custom_command(
36 DEPENDS rocfft_aot_helper rocfft_rtc_helper
37 COMMENT "Compile kernels into shipped cache file"
38 )
39-add_custom_target( rocfft_kernel_cache_target ALL
40+add_custom_target( rocfft_kernel_cache_target
41 DEPENDS rocfft_kernel_cache.db
42 VERBATIM
43 )
44@@ -392,7 +392,8 @@ else()
45 endif()
46 rocm_install(FILES ${ROCFFT_KERNEL_CACHE_PATH}
47 DESTINATION "${ROCFFT_KERNEL_CACHE_INSTALL_DIR}"
48- COMPONENT runtime
49+ COMPONENT kernel_cache
50+ EXCLUDE_FROM_ALL
51 )
52
53 # PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
54diff --git a/library/src/device/CMakeLists.txt b/library/src/device/CMakeLists.txt
55index 9f7b85f..73a8ec9 100644
56--- a/library/src/device/CMakeLists.txt
57+++ b/library/src/device/CMakeLists.txt
58@@ -170,11 +170,11 @@ list( SORT rocfft_device_source )
59 # functions callable by rocFFT and depends on amdhip64, and another
60 # one usable by AOT RTC that contains no device code
61 list( FILTER rocfft_device_source EXCLUDE REGEX function_pool.cpp )
62-add_library( rocfft-function-pool OBJECT
63+add_library( rocfft-function-pool OBJECT EXCLUDE_FROM_ALL
64 function_pool.cpp
65 )
66 target_compile_definitions( rocfft-function-pool PRIVATE FUNCTION_POOL_STANDALONE_BODY= )
67-add_library( rocfft-function-pool-standalone OBJECT
68+add_library( rocfft-function-pool-standalone OBJECT EXCLUDE_FROM_ALL
69 function_pool.cpp
70 )
71 target_compile_definitions( rocfft-function-pool-standalone PRIVATE FUNCTION_POOL_STANDALONE_BODY={} )
72@@ -193,26 +193,15 @@ foreach( pool rocfft-function-pool rocfft-function-pool-standalone )
73 add_dependencies(${pool} gen_headers_target)
74 endforeach()
75
76-list( LENGTH rocfft_device_source rocfft_device_source_len )
77-math(EXPR split_len "${rocfft_device_source_len} / 4")
78-math(EXPR split_idx_2 "${rocfft_device_source_len} / 4 * 2")
79-math(EXPR split_idx_3 "${rocfft_device_source_len} / 4 * 3")
80-
81-list( SUBLIST rocfft_device_source 0 ${split_len} rocfft_device_source_0 )
82-list( SUBLIST rocfft_device_source ${split_len} ${split_len} rocfft_device_source_1 )
83-list( SUBLIST rocfft_device_source ${split_idx_2} ${split_len} rocfft_device_source_2 )
84-list( SUBLIST rocfft_device_source ${split_idx_3} -1 rocfft_device_source_3 )
85-
86-foreach( sub RANGE 3 )
87- set( rocfft_device_source_var rocfft_device_source_${sub} )
88+foreach( sub ${AMDGPU_TARGETS} )
89 if(NOT SINGLELIB)
90- add_library( rocfft-device-${sub}
91- ${${rocfft_device_source_var}} )
92+ add_library( rocfft-device-${sub} EXCLUDE_FROM_ALL
93+ ${rocfft_device_source} )
94 else()
95 # Compile the device lib as a static library, which is then linked
96 # into librocfft.so Useful for testing purposes.
97- add_library( rocfft-device-${sub} STATIC
98- ${${rocfft_device_source_var}} )
99+ add_library( rocfft-device-${sub} STATIC EXCLUDE_FROM_ALL
100+ ${rocfft_device_source} )
101
102 # if we're building singlelib, we don't want to export any of the
103 # device library symbols to the main library
104@@ -241,9 +230,7 @@ foreach( sub RANGE 3 )
105 # Set AMD GPU architecture options
106
107 # Enable compilation of desired architectures
108- foreach( target ${AMDGPU_TARGETS} )
109- target_compile_options( rocfft-device-${sub} PRIVATE --offload-arch=${target} )
110- endforeach( )
111+ target_compile_options( rocfft-device-${sub} PRIVATE --offload-arch=${sub} )
112
113 target_include_directories( rocfft-device-${sub}
114 PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
115@@ -268,9 +255,4 @@ foreach( sub RANGE 3 )
116 if( NOT BUILD_SHARED_LIBS )
117 set_target_properties( rocfft-device-${sub} PROPERTIES PREFIX "lib" )
118 endif( )
119-
120- rocm_install_targets(
121- TARGETS
122- rocfft-device-${sub}
123- )
124 endforeach()