From 74e0647bed878d60598ab2c816546892b429fa8f Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Sat, 21 Dec 2019 10:41:29 -0500 Subject: [PATCH] add top level path for installation on macOS devices --- CMakeLists.txt | 6 ++++++ gtsam/CMakeLists.txt | 6 ------ gtsam_unstable/CMakeLists.txt | 6 ------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2af6341ea..9eae4567e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -345,6 +345,12 @@ if (MSVC) list_append_cache(GTSAM_COMPILE_OPTIONS_PRIVATE "/wd4244") # Disable loss of precision which is thrown all over our Eigen endif() +if (APPLE AND BUILD_SHARED_LIBS) + set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" + CACHE PATH + "Default install directory on macOS") +endif() + ############################################################################### # Global compile options diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index 11ec5510d..48bb14f1b 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -172,12 +172,6 @@ if(WIN32) # Add 'lib' prefix to static library to avoid filename collision with endif() endif() -if (APPLE AND BUILD_SHARED_LIBS) - set_target_properties(gtsam PROPERTIES - INSTALL_NAME_DIR - "${CMAKE_INSTALL_PREFIX}/lib") -endif() - install( TARGETS gtsam EXPORT GTSAM-exports diff --git a/gtsam_unstable/CMakeLists.txt b/gtsam_unstable/CMakeLists.txt index 95e6c2293..53ba83fad 100644 --- a/gtsam_unstable/CMakeLists.txt +++ b/gtsam_unstable/CMakeLists.txt @@ -98,12 +98,6 @@ if(WIN32) # Add 'lib' prefix to static library to avoid filename collision with endif() endif() -if (APPLE AND BUILD_SHARED_LIBS) - set_target_properties(gtsam_unstable PROPERTIES - INSTALL_NAME_DIR - "${CMAKE_INSTALL_PREFIX}/lib") -endif() - install( TARGETS gtsam_unstable EXPORT GTSAM-exports