2
2
# Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved.
3
3
# SPDX-License-Identifier: MIT
4
4
5
- # Generate a list of CMake library targets so that other CMake projects can
6
- # link against them. LLVM calls its version of this file LLVMExports.cmake, but
7
- # the usual CMake convention seems to be ${Project}Targets.cmake.
5
+ # Generate a list of CMake library targets so that other CMake projects can link
6
+ # against them. LLVM calls its version of this file LLVMExports.cmake, but the
7
+ # usual CMake convention seems to be ${Project}Targets.cmake.
8
8
set (AIR_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX} /cmake/air)
9
9
set (air_cmake_builddir "${CMAKE_BINARY_DIR} /${AIR_INSTALL_PACKAGE_DIR} " )
10
10
@@ -15,27 +15,25 @@ export(EXPORT AIRTargets FILE ${air_cmake_builddir}/AIRTargets.cmake)
15
15
set (AIR_CONFIG_CMAKE_DIR "${air_cmake_builddir} " )
16
16
set (AIR_CONFIG_BINARY_DIR "${PROJECT_BINARY_DIR} " )
17
17
set (AIR_CONFIG_TOOLS_BINARY_DIR "${PROJECT_BINARY_DIR} /bin" )
18
- set (AIR_CONFIG_INCLUDE_DIRS
19
- "${PROJECT_SOURCE_DIR} /include"
20
- "${PROJECT_BINARY_DIR} /include"
21
- )
18
+ set (AIR_CONFIG_INCLUDE_DIRS "${PROJECT_SOURCE_DIR} /include"
19
+ "${PROJECT_BINARY_DIR} /include" )
22
20
set (AIR_CONFIG_EXPORTS_FILE "\$ {AIR_CMAKE_DIR}/AIRTargets.cmake" )
23
- configure_file (
24
- ${CMAKE_CURRENT_SOURCE_DIR} /AIRConfig.cmake.in
25
- ${air_cmake_builddir} /AIRConfig.cmake
26
- @ONLY)
21
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /AIRConfig.cmake.in
22
+ ${air_cmake_builddir} /AIRConfig.cmake @ONLY)
27
23
set (AIR_CONFIG_CMAKE_DIR)
28
24
set (AIR_CONFIG_BINARY_DIR )
29
25
set (AIR_CONFIG_TOOLS_BINARY_DIR )
30
26
set (AIR_CONFIG_INCLUDE_DIRS)
31
27
set (AIR_CONFIG_EXPORTS_FILE)
32
28
33
29
# Generate AIRConfig.cmake for the install tree.
34
- set (AIR_CONFIG_CODE "
30
+ set (AIR_CONFIG_CODE
31
+ "
35
32
# Compute the installation prefix from this file location.
36
- get_filename_component(AIR_INSTALL_PREFIX \"\$ {CMAKE_CURRENT_LIST_FILE}\" PATH)" )
37
- # Construct the proper number of get_filename_component(... PATH)
38
- # calls to compute the installation prefix.
33
+ get_filename_component(AIR_INSTALL_PREFIX \"\$ {CMAKE_CURRENT_LIST_FILE}\" PATH)"
34
+ )
35
+ # Construct the proper number of get_filename_component(... PATH) calls to
36
+ # compute the installation prefix.
39
37
string (REGEX REPLACE "/" ";" _count "${AIR_INSTALL_PACKAGE_DIR} " )
40
38
foreach (p ${_count} )
41
39
set (AIR_CONFIG_CODE "${AIR_CONFIG_CODE}
@@ -45,14 +43,11 @@ endforeach(p)
45
43
set (AIR_CONFIG_CMAKE_DIR "\$ {AIR_INSTALL_PREFIX}/${AIR_INSTALL_PACKAGE_DIR} " )
46
44
set (AIR_CONFIG_BINARY_DIR "\$ {AIR_INSTALL_PREFIX}" )
47
45
set (AIR_CONFIG_TOOLS_BINARY_DIR "\$ {AIR_INSTALL_PREFIX}/bin" )
48
- set (AIR_CONFIG_INCLUDE_DIRS
49
- "\$ {AIR_INSTALL_PREFIX}/include"
50
- )
46
+ set (AIR_CONFIG_INCLUDE_DIRS "\$ {AIR_INSTALL_PREFIX}/include" )
51
47
set (AIR_CONFIG_EXPORTS_FILE "\$ {AIR_CMAKE_DIR}/AIRTargets.cmake" )
52
- configure_file (
53
- ${CMAKE_CURRENT_SOURCE_DIR} /AIRConfig.cmake.in
54
- ${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/AIRConfig.cmake
55
- @ONLY)
48
+ set (MLIR_CONFIG_INCLUDE_EXPORTS_FILE "\$ {AIR_CMAKE_DIR}/MLIRTargets.cmake" )
49
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /AIRConfig.cmake.in
50
+ ${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/AIRConfig.cmake @ONLY)
56
51
set (AIR_CONFIG_CODE)
57
52
set (AIR_CONFIG_CMAKE_DIR)
58
53
set (AIR_CONFIG_BINARY_DIR )
@@ -61,9 +56,15 @@ set(AIR_CONFIG_INCLUDE_DIRS)
61
56
set (AIR_CONFIG_EXPORTS_FILE)
62
57
63
58
# export targets for the install directory
64
- install (EXPORT AIRTargets DESTINATION ${AIR_INSTALL_PACKAGE_DIR}
65
- COMPONENT air-cmake-exports)
66
- install (FILES
67
- ${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/AIRConfig.cmake
59
+ install (
60
+ EXPORT AIRTargets
68
61
DESTINATION ${AIR_INSTALL_PACKAGE_DIR}
69
- COMPONENT air-cmake-exports)
62
+ COMPONENT air-cmake-exports)
63
+ install (
64
+ EXPORT MLIRTargets
65
+ DESTINATION ${AIR_INSTALL_PACKAGE_DIR}
66
+ COMPONENT air-cmake-exports)
67
+ install (
68
+ FILES ${CMAKE_CURRENT_BINARY_DIR} /CMakeFiles/AIRConfig.cmake
69
+ DESTINATION ${AIR_INSTALL_PACKAGE_DIR}
70
+ COMPONENT air-cmake-exports)
0 commit comments