From 5ace460036b82c31dd2201741823a5ac96505b83 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Thu, 20 Jun 2019 01:31:01 +0300 Subject: [PATCH] Specify rules for installing targets in CMake script Issue #281 (bdwgc). * CMakeLists.txt [build_cord] (cord): Specify install(TARGETS). * CMakeLists.txt (gc): Likewise. * CMakeLists.txt [enable_cplusplus] (gccpp): Likewise. --- CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59b4915d..fe969f7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,6 +266,25 @@ if (build_cord) set(CORD_SRC cord/cordbscs.c cord/cordprnt.c cord/cordxtra.c) add_library(cord ${CORD_SRC}) target_link_libraries(cord PRIVATE gc) + install(TARGETS cord EXPORT cordExports + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include) +endif() + +install(TARGETS gc EXPORT gcExports + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include) + +if (enable_cplusplus) + install(TARGETS gccpp EXPORT gccppExports + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include) endif() if (install_headers) -- 2.40.0