From 3b2ae2af2a9961654acbd4f9f4e78350631c289e Mon Sep 17 00:00:00 2001
From: Markus Blatt <mblatt@dune-project.org>
Date: Thu, 20 Sep 2012 18:36:43 +0000
Subject: [PATCH] Use GNUInstallDir to specify installation directory.

[[Imported from SVN: r6988]]
---
 am/CMakeLists.txt                   | 2 +-
 bin/CMakeLists.txt                  | 2 +-
 cmake/modules/CMakeLists.txt        | 2 +-
 cmake/scripts/CMakeLists.txt        | 3 ++-
 doc/CMakeLists.txt                  | 2 +-
 doc/buildsystem/CMakeLists.txt      | 6 +-----
 doc/doxygen/CMakeLists.txt          | 2 +-
 dune/common/CMakeLists.txt          | 4 ++--
 dune/common/parallel/CMakeLists.txt | 2 +-
 lib/CMakeLists.txt                  | 2 +-
 10 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/am/CMakeLists.txt b/am/CMakeLists.txt
index cd4277629..47e3e52d8 100644
--- a/am/CMakeLists.txt
+++ b/am/CMakeLists.txt
@@ -10,5 +10,5 @@ install(PROGRAMS
   sourcescheck
   top-rules
   webstuff
-  DESTINATION share/dune-common/am
+  DESTINATION ${CMAKE_INSTALL_DATADIR}/am
 )
diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt
index 049604161..3213d8412 100644
--- a/bin/CMakeLists.txt
+++ b/bin/CMakeLists.txt
@@ -5,4 +5,4 @@ install(PROGRAMS
 	dunecontrol
 	mpi-config
 	dune-autogen
-	DESTINATION bin)
+	DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
index 13e7e4e1e..9cd7a33fb 100644
--- a/cmake/modules/CMakeLists.txt
+++ b/cmake/modules/CMakeLists.txt
@@ -1,2 +1,2 @@
 file(GLOB modules *.cmake)
-install(FILES ${modules} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/modules)
+install(FILES ${modules} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/modules)
diff --git a/cmake/scripts/CMakeLists.txt b/cmake/scripts/CMakeLists.txt
index 0c1a40d9a..8ffb2e36d 100644
--- a/cmake/scripts/CMakeLists.txt
+++ b/cmake/scripts/CMakeLists.txt
@@ -1,2 +1,3 @@
 file(GLOB modules *.cmake)
-install(FILES ${modules} ${CMAKE_CURRENT_SOURCE_DIR}/BuildTests.cmake.in DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/scripts)
+install(FILES ${modules} ${CMAKE_CURRENT_SOURCE_DIR}/BuildTests.cmake.in
+  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/scripts)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index b88dfa174..d82d3db4a 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_subdirectory("doxygen")
 add_subdirectory("buildsystem")
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/example.opts
-  DESTINATION share/doc/dune-common
+  DESTINATION ${CMAKE_INSTALL_DOCDIR}
   )
diff --git a/doc/buildsystem/CMakeLists.txt b/doc/buildsystem/CMakeLists.txt
index 9baff50d4..2fc371c63 100644
--- a/doc/buildsystem/CMakeLists.txt
+++ b/doc/buildsystem/CMakeLists.txt
@@ -1,8 +1,4 @@
 if(LATEX_USABLE)
   ADD_LATEX_DOCUMENT(buildsystem.tex FATHER_TARGET doc DEFAULT_PDF INPUTS ../Makefile.am ../../configure.ac ../example.opts)
-  create_doc_install(${CMAKE_CURRENT_BINARY_DIR}/buildsystem.pdf share/doc/dune-common/buildsystem)
+  create_doc_install(${CMAKE_CURRENT_BINARY_DIR}/buildsystem.pdf ${CMAKE_INSTALL_DOCDIR}/buildsystem)
 endif(LATEX_USABLE)
-#add_custom_target(install_buildsystem)
-#install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${CMAKE_BINARY_DIR}\" --target buildsystem_install )")
-#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/buildsystem.pdf
-#  DESTINATION share/doc/dune-common/buildsystem)
diff --git a/doc/doxygen/CMakeLists.txt b/doc/doxygen/CMakeLists.txt
index ebcd3a12f..c4e01f1c3 100644
--- a/doc/doxygen/CMakeLists.txt
+++ b/doc/doxygen/CMakeLists.txt
@@ -1,3 +1,3 @@
 # quickhack for creating the Doxyfile.in and Doxyfile
 add_doxygen_target()
-install(FILES Doxystyle DESTINATION share/dune-common/doc/doxygen)
+install(FILES Doxystyle DESTINATION ${CMAKE_INSTALL_DOCDIR}/doxygen)
diff --git a/dune/common/CMakeLists.txt b/dune/common/CMakeLists.txt
index e3c150467..bc2e183ad 100644
--- a/dune/common/CMakeLists.txt
+++ b/dune/common/CMakeLists.txt
@@ -84,8 +84,8 @@ install(FILES
         typetraits.hh
         unused.hh
         version.hh
-DESTINATION include/dune/common)
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/common)
 
 # Install some test headers, because they get used by tests in other modules
 # We do this here as test will not be considered for make install
-install(FILES test/iteratortest.hh DESTINATION include/dune/common/test)
+install(FILES test/iteratortest.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/common/test)
diff --git a/dune/common/parallel/CMakeLists.txt b/dune/common/parallel/CMakeLists.txt
index 7fe50ce56..26b548c31 100644
--- a/dune/common/parallel/CMakeLists.txt
+++ b/dune/common/parallel/CMakeLists.txt
@@ -10,5 +10,5 @@ install(FILES
         plocalindex.hh
         remoteindices.hh
         selection.hh
-	DESTINATION include/dune/common/parallel)
+	DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/common/parallel)
 
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index dfb23cc26..23251b520 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1 +1 @@
-install(FILES dunemodules.lib DESTINATION lib)
+install(FILES dunemodules.lib DESTINATION ${CMAKE_INSTALL_LIBDIR})
-- 
GitLab