diff --git a/CMakeLists.txt b/CMakeLists.txt index abea4d695..635ecb571 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,10 @@ endif() set(SANE_DEV_BUILD true) +################################################################################ +# Preserve RPATH in installed binaries so they can find shared libraries. +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + ################################################################################ # Include CMake scripts from cmake directory. list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) diff --git a/applications/analysis/CMakeLists.txt b/applications/analysis/CMakeLists.txt index aef6ba13d..a53a4bfbd 100644 --- a/applications/analysis/CMakeLists.txt +++ b/applications/analysis/CMakeLists.txt @@ -10,6 +10,8 @@ if (DCA_BUILD_ANALYSIS) target_link_libraries(main_analysis PUBLIC signals ${DCA_LIBS} simplex_gm_rule) + install(TARGETS main_analysis RUNTIME DESTINATION bin) + message("DCA_MODEL_IS_MATERIAL_LATTICE ${DCA_MODEL_IS_MATERIAL_LATTICE}") if (DCA_LATTICE STREQUAL "square") #new development of exanded q chi_q_omega @@ -23,6 +25,7 @@ if (DCA_BUILD_ANALYSIS) target_link_libraries(chi_q_omega PUBLIC signals ${DCA_LIBS} simplex_gm_rule) + install(TARGETS chi_q_omega RUNTIME DESTINATION bin) endif() endif() diff --git a/applications/cluster_solver_check/CMakeLists.txt b/applications/cluster_solver_check/CMakeLists.txt index 5e1be7e4f..f4e3f2a45 100644 --- a/applications/cluster_solver_check/CMakeLists.txt +++ b/applications/cluster_solver_check/CMakeLists.txt @@ -9,4 +9,6 @@ if (DCA_BUILD_CLUSTER_SOLVER_CHECK) dca_gpu_runtime_link(cluster_solver_check) dca_gpu_blas_link(cluster_solver_check) endif() + + install(TARGETS cluster_solver_check RUNTIME DESTINATION bin) endif() diff --git a/applications/dca/CMakeLists.txt b/applications/dca/CMakeLists.txt index aac9a9cf6..f7a9c3762 100644 --- a/applications/dca/CMakeLists.txt +++ b/applications/dca/CMakeLists.txt @@ -9,4 +9,6 @@ if (DCA_BUILD_DCA) endif() target_link_libraries(main_dca PUBLIC FFTW::Double signals ${DCA_LIBS} dca_io) + + install(TARGETS main_dca RUNTIME DESTINATION bin) endif()