Skip to content

Commit

Permalink
Linux: update phd2.sh to use CMAKE_INSTALL_PREFIX (#1281)
Browse files Browse the repository at this point in the history
Allows `make install` run with a CMAKE_INSTALL_PREFIX other than
the default (`/usr`) to generate a phd2.sh with the matching install prefix.
  • Loading branch information
agalasso authored Jan 4, 2025
1 parent 6b2676b commit d7c5484
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cmake_modules/PHD2Packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ endif()
if(UNIX AND NOT APPLE)
install(TARGETS phd2
RUNTIME DESTINATION bin)
install(PROGRAMS phd2.sh
configure_file(phd2.sh.in phd2.sh @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/phd2.sh
DESTINATION bin
RENAME phd2)
install(FILES ${PHD_INSTALL_LIBS}
Expand Down
3 changes: 0 additions & 3 deletions phd2.sh

This file was deleted.

3 changes: 3 additions & 0 deletions phd2.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
export LD_LIBRARY_PATH="@CMAKE_INSTALL_PREFIX@/lib/phd2${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
exec "$0.bin" "$@"

0 comments on commit d7c5484

Please sign in to comment.