Skip to content

Commit fa130db

Browse files
committed
Add install-bin target
When cross building, using `make install-bin` allows to avoid unneeded building of `libmultiprocess` for a build system.
1 parent c4d26d2 commit fa130db

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,18 @@ set_target_properties(mpgen PROPERTIES
9999
INSTALL_RPATH_USE_LINK_PATH TRUE)
100100
set_target_properties(mpgen PROPERTIES
101101
PUBLIC_HEADER include/mp/proxy.capnp)
102-
install(TARGETS mpgen EXPORT Multiprocess RUNTIME DESTINATION bin PUBLIC_HEADER DESTINATION include/mp)
102+
install(TARGETS mpgen EXPORT Multiprocess
103+
RUNTIME DESTINATION bin COMPONENT bin
104+
PUBLIC_HEADER DESTINATION include/mp COMPONENT bin)
105+
install(FILES "include/mpgen.mk"
106+
DESTINATION "include" COMPONENT bin)
107+
add_custom_target(install-bin
108+
COMMAND ${CMAKE_COMMAND} -DCOMPONENT=bin -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake
109+
VERBATIM)
110+
add_dependencies(install-bin mpgen)
103111

104112
configure_file(include/mp/config.h.in "${CMAKE_CURRENT_BINARY_DIR}/include/mp/config.h")
105113
configure_file(pkgconfig/libmultiprocess.pc.in "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/libmultiprocess.pc" @ONLY)
106-
install(FILES "include/mpgen.mk" DESTINATION "include")
107114

108115
install(EXPORT Multiprocess DESTINATION lib/cmake/Multiprocess)
109116

0 commit comments

Comments
 (0)