Skip to content

Commit ce8bb9a

Browse files
committed
Add xpti and ur_common to install exports
1 parent 238c15b commit ce8bb9a

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ if(UR_ENABLE_TRACING)
135135
set_target_properties(xptifw PROPERTIES
136136
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
137137
)
138+
139+
if (UR_STATIC_LOADER)
140+
install(TARGETS xpti xptifw
141+
EXPORT ${PROJECT_NAME}-targets
142+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
143+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
144+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
145+
)
146+
endif()
138147
endif()
139148

140149
if (MSVC)

source/common/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ add_ur_library(ur_common STATIC
1212
$<$<PLATFORM_ID:Windows>:windows/ur_lib_loader.cpp>
1313
$<$<PLATFORM_ID:Linux,Darwin>:linux/ur_lib_loader.cpp>
1414
)
15+
1516
add_library(${PROJECT_NAME}::common ALIAS ur_common)
1617

1718
target_include_directories(ur_common PUBLIC
18-
${CMAKE_CURRENT_SOURCE_DIR}
19-
${CMAKE_SOURCE_DIR}/include
19+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
20+
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
2021
)
2122

2223
message(STATUS "Download Unified Memory Framework from github.com")
@@ -62,3 +63,10 @@ if (UNIX)
6263
find_package(Threads REQUIRED)
6364
target_link_libraries(ur_common PUBLIC Threads::Threads)
6465
endif()
66+
67+
install(TARGETS ur_common
68+
EXPORT ${PROJECT_NAME}-targets
69+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
70+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
71+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
72+
)

0 commit comments

Comments
 (0)