From a743a4acc95940cd4421e5b7b68453cbd3c8dff8 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 17 May 2019 18:29:35 -0400 Subject: [PATCH] change example_project .so file from STATIC to SHARED, and install library to /lib in install path --- cmake/example_project/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/example_project/CMakeLists.txt b/cmake/example_project/CMakeLists.txt index 2afc6edc2..620ad4811 100644 --- a/cmake/example_project/CMakeLists.txt +++ b/cmake/example_project/CMakeLists.txt @@ -30,9 +30,12 @@ find_package(GTSAM REQUIRED) # Uses installed package ################################################################################### # Build static library from common sources set(CONVENIENCE_LIB_NAME ${PROJECT_NAME}) -add_library(${CONVENIENCE_LIB_NAME} STATIC example/PrintExamples.h example/PrintExamples.cpp) +add_library(${CONVENIENCE_LIB_NAME} SHARED example/PrintExamples.h example/PrintExamples.cpp) target_link_libraries(${CONVENIENCE_LIB_NAME} gtsam) +# Install library +install(TARGETS ${CONVENIENCE_LIB_NAME} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + ################################################################################### # Build tests (CMake tracks the dependecy to link with GTSAM through our project's static library) gtsamAddTestsGlob("example" "tests/test*.cpp" "" "${CONVENIENCE_LIB_NAME}")