[ismrmrd] 70/177: add support for GnuInstallDirs install tree
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:02:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag v1.1.0.beta.1
in repository ismrmrd.
commit 013b9f38690f5823974f21e8c1fdd5637d2147fb
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date: Sun Sep 21 11:06:07 2014 +0100
add support for GnuInstallDirs install tree
---
CMakeLists.txt | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a7b331..89ffa7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 2.8)
project(ISMRMRD)
+# command line options
+option(USE_GNUINSTALLDIRS "Use GnuInstallDirs" OFF)
+
# add project specific cmake find modules
list(APPEND CMAKE_MODULE_PATH cmake)
@@ -11,6 +14,29 @@ IF(NOT CMAKE_BUILD_TYPE)
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
+# set install paths
+string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
+if(USE_GNUINSTALLDIRS)
+ include(GNUInstallDirs)
+ set(ISMRMRD_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}")
+ set(ISMRMRD_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
+ set(ISMRMRD_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
+ set(ISMRMRD_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}")
+ set(ISMRMRD_INSTALL_DOCDIR "${CMAKE_INSTALL_DOCDIR}")
+ set(ISMRMRD_INSTALL_CMAKEDIR
+ "${ISMRMRD_INSTALL_DATADIR}/${PROJECT_NAME_LOWER}/cmake")
+ set(ISMRMRD_INSTALL_SCHEMADIR
+ "${ISMRMRD_INSTALL_DATADIR}/${PROJECT_NAME_LOWER}/schema")
+else(USE_GNUINSTALLDIRS)
+ set(ISMRMRD_INSTALL_BINDIR bin)
+ set(ISMRMRD_INSTALL_LIBDIR lib)
+ set(ISMRMRD_INSTALL_INCLUDEDIR include)
+ set(ISMRMRD_INSTALL_DATADIR share)
+ set(ISMRMRD_INSTALL_DOCDIR doc)
+ set(ISMRMRD_INSTALL_CMAKEDIR cmake)
+ set(ISMRMRD_INSTALL_SCHEMADIR schema)
+endif(USE_GNUINSTALLDIRS)
+
# compiler flags
if (WIN32)
add_definitions(-DWIN32 -D_WIN32 -D_WINDOWS)
@@ -107,14 +133,14 @@ set_target_properties(ismrmrd PROPERTIES
target_link_libraries(ismrmrd ${HDF5_LIBRARIES})
# install the main library
-install(TARGETS ismrmrd DESTINATION lib)
+install(TARGETS ismrmrd DESTINATION "${ISMRMRD_INSTALL_LIBDIR}")
# install the headers
-install(DIRECTORY include/ismrmrd DESTINATION include)
+install(DIRECTORY include/ismrmrd DESTINATION "${ISMRMRD_INSTALL_INCLUDEDIR}")
# install the schema file
install(FILES schema/ismrmrd.xsd
- DESTINATION share/ismrmrd/schema)
+ DESTINATION "${ISMRMRD_INSTALL_SCHEMADIR}")
# install the cmake modules
install(FILES
@@ -122,7 +148,7 @@ install(FILES
cmake/FindFFTW3.cmake
cmake/FindNumPy.cmake
DESTINATION
- share/ismrmrd/cmake
+ "${ISMRMRD_INSTALL_CMAKEDIR}"
)
# --- Main Library (end) ----
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git
More information about the debian-science-commits
mailing list