Skip to content

Commit

Permalink
feat: create symlinks on cmake build
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrothenberger committed Jan 23, 2024
1 parent e073fb6 commit e9a3403
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit e9a3403

Please sign in to comment.