File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 11# Function to change external libraries rpath on mac and linux
22function (change_rpath lib_name_noext depend_target_name lib_path package_relative_rpath gmp_library_path)
3+ # gmp_library_dir is the directory containing the libgmp.(so|dylib) file
34 get_filename_component (gmp_library_dir "${gmp_library_path} " DIRECTORY )
45 if (APPLE )
56 if (NOT CMAKE_INSTALL_NAME_TOOL)
@@ -25,9 +26,20 @@ function(change_rpath lib_name_noext depend_target_name lib_path package_relativ
2526 set (add_rpath_command "${CMAKE_INSTALL_NAME_TOOL} -add_rpath @loader_path/${package_relative_rpath} ${lib_path} " )
2627 add_custom_command (TARGET ${depend_target_name}
2728 POST_BUILD
28- COMMAND eval ARGS "${add_rpath_command} || true"
29+ COMMAND eval ARGS "${add_rpath_command} 2> /dev/null || true"
2930 VERBATIM )
3031
32+ if (NOT FETCH_GMP)
33+ # Add GMP location to NTL rpath if GMP is not fetched
34+ # NOTE: This can be turned into an external script invoking it with cmake -P to properly handle error
35+ set (add_gmp_rpath_command "${CMAKE_INSTALL_NAME_TOOL} -add_rpath ${gmp_library_dir} ${lib_path} " )
36+ add_custom_command (TARGET ${depend_target_name}
37+ POST_BUILD
38+ COMMAND eval ARGS "${add_gmp_rpath_command} 2> /dev/null || true"
39+ VERBATIM )
40+ unset (add_gmp_rpath_command)
41+ endif (NOT FETCH_GMP)
42+
3143 # Change ID of GMP in the NTL library only if GMP is not the default one
3244 if (lib_name_noext MATCHES "ntl" AND FETCH_GMP)
3345 # NOTE: Here we assume the ID of the gmp library is equal to its absolute path, including version name (i.e. not the symlink).
Original file line number Diff line number Diff line change @@ -12,8 +12,10 @@ endif(HELIB_REQUIRES_PTHREADS)
1212# Look for the Armadillo package if requested
1313if (ENABLE_ARMADILLO)
1414 find_package (Armadillo "${ARMADILLO_MINIMAL_VERSION} " REQUIRED)
15- endif (ENABLE_ARMADILLO)
16-
15+ else (ENABLE_ARMADILLO)
16+ # suppress unused variable warning when not needed
17+ unset (ARMADILLO_MINIMAL_VERSION)
18+ endif (ENABLE_ARMADILLO)
1719
1820include (GNUInstallDirs)
1921
You can’t perform that action at this time.
0 commit comments