Skip to content

Commit e1be541

Browse files
authored
Merge pull request #413 from susilehtola/destdir
Make install play nice with DESTDIR for packaging.
2 parents 4ca6f1c + 1662e37 commit e1be541

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

export/CMakeLists.txt.export

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,13 +782,16 @@ install(
782782
DESTINATION "${LIBINT2_INSTALL_INCLUDEDIR}/libint2"
783783
)
784784

785-
# install basis.h at install time so LIBINT_DATADIR_ABSOLUTE reflects any --prefix override
785+
# install basis.h at install time so LIBINT_DATADIR_ABSOLUTE reflects
786+
# any --prefix override. $ENV{DESTDIR} must be prepended manually
787+
# here: install(CODE) runs custom code and does not get the automatic
788+
# DESTDIR handling that install(FILES) etc. have.
786789
install(CODE "
787790
set(LIBINT_VERSION \"${LIBINT_VERSION}\")
788791
set(LIBINT_DATADIR_ABSOLUTE \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/libint/${LIBINT_VERSION}\")
789792
configure_file(
790793
\"${PROJECT_SOURCE_DIR}/include/libint2/basis.h.in\"
791-
\"\${CMAKE_INSTALL_PREFIX}/${LIBINT2_INSTALL_INCLUDEDIR}/libint2/basis.h\"
794+
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LIBINT2_INSTALL_INCLUDEDIR}/libint2/basis.h\"
792795
@ONLY)
793796
")
794797

0 commit comments

Comments
 (0)