From fe3ad0bbc4ee4a2362c98c47669729077b5d56ed Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 8 Nov 2024 13:26:45 -0700 Subject: [PATCH] do not strip rpath in executable --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index be7e1e6..5edec51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,7 @@ set (CPRNC_Fortran_MODS ${CMAKE_CURRENT_BINARY_DIR}/compare_vars_mod.mod set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_MACOSX_RPATH 1) +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # Compiler-specific compile options if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU") @@ -81,6 +82,7 @@ find_library(netcdf_fortran_lib netcdff HINTS ${NetCDF_Fortran_ROOT}) #message (STATUS "netcdf_fortran_lib == ${netcdf_fortran_lib}") get_filename_component(netcdf_fortran_lib_location ${netcdf_fortran_lib} DIRECTORY) #message (STATUS "netcdf_fortran_lib_location == ${netcdf_fortran_lib_location}") +SET(CMAKE_INSTALL_RPATH "${netcdf_fortran_lib_location};${netcdf_c_lib_location}") find_library(netcdf_c_lib netcdf HINTS ${NetCDF_C_LIBRARY}) #message (STATUS "netcdf_c_lib == ${netcdf_c_lib}")