From e9fa90e775e0cb0c967bed8908f5d8a7a89d7384 Mon Sep 17 00:00:00 2001 From: Oleg Alexandrov Date: Mon, 31 Mar 2025 11:00:40 -0700 Subject: [PATCH 1/2] Ensure usgscsm_cam_test can find libusgscsm --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b60614560..277c9e089 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,7 @@ else() set(CMAKE_C_FLAGS "${_tmp_CMAKE_C_FLAGS}") endif() - # check needed include file + # check needed include file check_function_exists(localeconv HAVE_LOCALECONV) check_function_exists(strerror HAVE_STRERROR) if(NOT WIN32) @@ -714,6 +714,15 @@ install(TARGETS usgscsm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/csmplugins/) install(DIRECTORY ${USGSCSM_INSTALL_INCLUDE_DIRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(TARGETS usgscsm_cam_test RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +# Ensure usgscsm_cam_test can find the library in csmplugins +if(APPLE) + set_target_properties(usgscsm_cam_test PROPERTIES + INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}/csmplugins") +else() + set_target_properties(usgscsm_cam_test PROPERTIES + INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/csmplugins") +endif() + # Optional build tests option (USGSCSM_BUILD_TESTS "Build tests" ON) if(USGSCSM_BUILD_TESTS) From 6efd678982fb0432cdcdb3549fc3fb59cc9dfcb8 Mon Sep 17 00:00:00 2001 From: Oleg Alexandrov Date: Mon, 31 Mar 2025 11:50:56 -0700 Subject: [PATCH 2/2] Try to fix the min version issue --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 277c9e089..5b3b7f48e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,9 @@ include(GNUInstallDirs) set(CMAKE_CXX_STANDARD 14) +# For dependencies minimum version +set(CMAKE_POLICY_VERSION_MINIMUM 3.5) + # Set a default build type if none was specified set(default_build_type "Release") if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)