Skip to content

Commit c4280ef

Browse files
winsoft666mutouyun
winsoft666
authored andcommitted
Add cpp-ipc-targets
1 parent ac54be7 commit c4280ef

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,28 @@ endif()
5050

5151
install(
5252
TARGETS ${PROJECT_NAME}
53+
EXPORT cpp-ipc-targets
5354
RUNTIME DESTINATION bin
5455
LIBRARY DESTINATION lib
5556
ARCHIVE DESTINATION lib)
57+
58+
install(EXPORT cpp-ipc-targets
59+
FILE cpp-ipc-targets.cmake
60+
NAMESPACE cpp-ipc::
61+
DESTINATION share/cpp-ipc
62+
)
63+
64+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cpp-ipc-config.cmake.in"
65+
[[include(CMakeFindDependencyMacro)
66+
include("${CMAKE_CURRENT_LIST_DIR}/cpp-ipc-targets.cmake")
67+
]])
68+
configure_file("${CMAKE_CURRENT_BINARY_DIR}/cpp-ipc-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cpp-ipc-config.cmake" @ONLY)
69+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cpp-ipc-config.cmake DESTINATION share/cpp-ipc)
70+
71+
include(CMakePackageConfigHelpers)
72+
write_basic_package_version_file(
73+
cppIpcConfigVersion.cmake
74+
VERSION ${PACKAGE_VERSION}
75+
COMPATIBILITY AnyNewerVersion
76+
)
77+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppIpcConfigVersion.cmake DESTINATION share/cpp-ipc)

0 commit comments

Comments
 (0)