Skip to content

Commit

Permalink
CMakeLists.txt: Allow configuring BABEL_DATADIR
Browse files Browse the repository at this point in the history
This allows installing the architecture independent data outside
the prefix, for example on a multiarch layout where the prefix
is /usr/{host-triplet}.
  • Loading branch information
heirecka committed Apr 2, 2015
1 parent ddc1800 commit 417361b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ if(EMBED_OPENBABEL)
else()
set(BABEL_VERSION "${BABEL_MAJ_VER}.${BABEL_MIN_VER}.${BABEL_PATCH_VER}")
endif()
set(BABEL_DATADIR "${CMAKE_INSTALL_PREFIX}/share/openbabel")
set(BABEL_DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share"
CACHE PATH "Install dir for arch independent data")
set(BABEL_DATADIR "${BABEL_DATAROOTDIR}/openbabel")

option(ENABLE_VERSIONED_FORMATS
"Enable versioning of the format plugin directory" ON)
Expand Down
2 changes: 1 addition & 1 deletion data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ set(to_install
)

if(NOT MSVC)
install(FILES ${to_install} DESTINATION share/openbabel/${BABEL_VERSION})
install(FILES ${to_install} DESTINATION "${BABEL_DATADIR}/${BABEL_VERSION}")
else(NOT MSVC)
install(FILES ${to_install} DESTINATION bin/data)
endif(NOT MSVC)
4 changes: 2 additions & 2 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
file(GLOB man_1 *.1)
install(FILES ${man_1} DESTINATION share/man/man1)
install(FILES splash.png DESTINATION share/openbabel/${BABEL_VERSION})
install(FILES ${man_1} DESTINATION "${BABEL_DATAROOTDIR}/man/man1")
install(FILES splash.png DESTINATION "${BABEL_DATADIR}/${BABEL_VERSION}")

OPTION(BUILD_DOCS "Build Open Babel documentation" OFF)
IF(BUILD_DOCS)
Expand Down

0 comments on commit 417361b

Please sign in to comment.