From e9a340327992b9e3f88cd2b9391eff66dfc5dfd5 Mon Sep 17 00:00:00 2001 From: Lukas Rothenberger Date: Fri, 19 Jan 2024 16:00:01 +0100 Subject: [PATCH] feat: create symlinks on cmake build --- scripts/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index dbe7e1060..fdcc6ed6c 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -17,3 +17,20 @@ configure_file(CMAKE_wrapper.sh CMAKE_wrapper.sh COPYONLY) configure_file(MPI_CC_wrapper.sh MPI_CC_wrapper.sh COPYONLY) configure_file(MPI_CXX_wrapper.sh MPI_CXX_wrapper.sh COPYONLY) configure_file(MPI_LINKER_wrapper.sh MPI_LINKER_wrapper.sh COPYONLY) + +# create symlinks to files +set(DP_LOCAL_BIN_DIR "$ENV{HOME}/.local/bin") +if(EXISTS ${DP_LOCAL_BIN_DIR}) + message(STATUS "Creating symlink ${DP_LOCAL_BIN_DIR}/discopop_cc to ${CMAKE_CURRENT_BINARY_DIR}/CC_wrapper.sh") + execute_process(COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/CC_wrapper.sh ${DP_LOCAL_BIN_DIR}/discopop_cc) + + message(STATUS "Creating symlink ${DP_LOCAL_BIN_DIR}/discopop_cxx to ${CMAKE_CURRENT_BINARY_DIR}/CXX_wrapper.sh") + execute_process(COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/CXX_wrapper.sh ${DP_LOCAL_BIN_DIR}/discopop_cxx) + + message(STATUS "Creating symlink ${DP_LOCAL_BIN_DIR}/discopop_cmake to ${CMAKE_CURRENT_BINARY_DIR}/CMAKE_wrapper.sh") + execute_process(COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/CMAKE_wrapper.sh ${DP_LOCAL_BIN_DIR}/discopop_cmake) +else() + message(WARNING "Creation of symlinks discopop_cc to ${CMAKE_CURRENT_BINARY_DIR}/CC_wrapper.sh not possible. Please create it manually.") + message(WARNING "Creation of symlinks discopop_cxx to ${CMAKE_CURRENT_BINARY_DIR}/CXX_wrapper.sh not possible. Please create it manually.") + message(WARNING "Creation of symlinks discopop_cmake to ${CMAKE_CURRENT_BINARY_DIR}/CMAKE_wrapper.sh not possible. Please create it manually.") +endif()