Add profile.d files to set LAMMPS_POTENTIALS environment variable

This commit is contained in:
Richard Berger 2018-07-27 20:31:53 -04:00
parent 06335e77cb
commit 99985a1d5b
3 changed files with 14 additions and 1 deletions

View File

@ -961,7 +961,16 @@ endif()
###############################################################################
# Install potential files in data directory
###############################################################################
install(DIRECTORY ${LAMMPS_SOURCE_DIR}/../potentials DESTINATION ${CMAKE_INSTALL_DATADIR}/lammps)
set(LAMMPS_POTENTIALS_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps/potentials)
install(DIRECTORY ${LAMMPS_SOURCE_DIR}/../potentials DESTINATION ${CMAKE_INSTALL_DATADIR}/lammps/potentials)
configure_file(etc/profile.d/lammps.sh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.sh @ONLY)
configure_file(etc/profile.d/lammps.csh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.csh @ONLY)
install(
FILES ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.sh
${CMAKE_BINARY_DIR}/etc/profile.d/lammps.csh
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/profile.d
)
###############################################################################
# Testing

View File

@ -0,0 +1,2 @@
# set environment for LAMMPS executables to find potential files
if ( "$?LAMMPS_POTENTIALS" == 0 ) setenv LAMMPS_POTENTIALS @LAMMPS_POTENTIALS_DIR@

View File

@ -0,0 +1,2 @@
# set environment for LAMMPS executables to find potential files
export LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_POTENTIALS_DIR@}