Use INSTALL_NAME_DIR to embed names in the dylibs and avoid linker errors.y

release/4.3a0
Simon Julier 2017-01-17 16:53:28 +00:00
parent 21aa7a2e85
commit f50c3c0d51
2 changed files with 6 additions and 1 deletions

View File

@ -70,7 +70,8 @@ function(wrap_library_internal interfaceHeader linkLibraries extraIncludeDirs ex
set(mexModuleExt mexglx)
endif()
elseif(APPLE)
set(mexModuleExt mexmaci64)
set(mexModuleExt mexmaci64)
set(CMAKE_INSTALL_DIR_NAME ${GTSAM_TOOLBOX_INSTALL_PATH})
elseif(MSVC)
if(CMAKE_CL_64)
set(mexModuleExt mexw64)

View File

@ -113,6 +113,10 @@ if (GTSAM_BUILD_STATIC_LIBRARY)
PREFIX "lib"
COMPILE_DEFINITIONS GTSAM_IMPORT_STATIC)
endif()
if(APPLE) # Set the
set_target_properties(gtsam PROPERTIES
INSTALL_DIR_NAME ${CMAKE_INSTALL_PREFIX}/lib)
endif()
install(TARGETS gtsam EXPORT GTSAM-exports ARCHIVE DESTINATION lib)
list(APPEND GTSAM_EXPORTED_TARGETS gtsam)
set(GTSAM_EXPORTED_TARGETS "${GTSAM_EXPORTED_TARGETS}" PARENT_SCOPE)