summaryrefslogtreecommitdiff
blob: c26bf8914b462fdae6e32597e0c18fe507d37ebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
From 44966c44635debaddd859c788b008cd4e6c7fab6 Mon Sep 17 00:00:00 2001
From: Guilherme Amadio <amadio@cern.ch>
Date: Fri, 13 Mar 2020 15:36:27 +0100
Subject: [PATCH] Allow customization of CMAKE_INSTALL_DATADIR

---
 cmake/Modules/G4CMakeMain.cmake               |  2 +-
 cmake/Modules/G4ConfigureGNUMakeHelpers.cmake | 20 +++++++++----------
 cmake/Modules/Geant4InstallData.cmake         |  4 ++--
 source/analysis/CMakeLists.txt                |  2 +-
 source/analysis/g4tools/CMakeLists.txt        |  2 +-
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/cmake/Modules/G4CMakeMain.cmake b/cmake/Modules/G4CMakeMain.cmake
index a6b984fcad..5ab63202ca 100644
--- a/cmake/Modules/G4CMakeMain.cmake
+++ b/cmake/Modules/G4CMakeMain.cmake
@@ -121,7 +121,7 @@ mark_as_advanced(GEANT4_INSTALL_EXAMPLES)
 
 if(GEANT4_INSTALL_EXAMPLES)
   install(DIRECTORY examples
-    DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}
+    DESTINATION ${CMAKE_INSTALL_DATADIR}
     COMPONENT Examples
     PATTERN "CVS" EXCLUDE
     PATTERN ".svn" EXCLUDE
diff --git a/cmake/Modules/G4ConfigureGNUMakeHelpers.cmake b/cmake/Modules/G4ConfigureGNUMakeHelpers.cmake
index c2aeefee59..1052f43a45 100644
--- a/cmake/Modules/G4ConfigureGNUMakeHelpers.cmake
+++ b/cmake/Modules/G4ConfigureGNUMakeHelpers.cmake
@@ -729,7 +729,7 @@ _g4tc_configure_build_tree_scripts(geant4make)
 # +- CMAKE_INSTALL_PREFIX
 #    +- LIBDIR/Geant4-VERSION (G4LIB)
 #    +- INCLUDEDIR/Geant4     (G4INCLUDE)
-#    +- DATAROOTDIR/Geant4-VERSION/
+#    +- DATADIR/
 #       +- geant4make              (THIS IS G4INSTALL!)
 #          +- geant4make.(c)sh
 #          +- config/
@@ -742,7 +742,7 @@ set(G4INSTALL "\"\$geant4make_root\"")
 # - Include dir
 file(RELATIVE_PATH
   G4MAKE_TO_INCLUDEDIR
-  ${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
+  ${CMAKE_INSTALL_FULL_DATADIR}/geant4make
   ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${PROJECT_NAME}
   )
 set(G4INCLUDE "\"`cd \$geant4make_root/${G4MAKE_TO_INCLUDEDIR} > /dev/null \; pwd`\"")
@@ -750,7 +750,7 @@ set(G4INCLUDE "\"`cd \$geant4make_root/${G4MAKE_TO_INCLUDEDIR} > /dev/null \; pw
 # - Bin dir
 file(RELATIVE_PATH
   G4MAKE_TO_BINDIR
-  ${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
+  ${CMAKE_INSTALL_FULL_DATADIR}/geant4make
   ${CMAKE_INSTALL_FULL_BINDIR}
   )
 set(G4BIN_DIR "\"`cd \$geant4make_root/${G4MAKE_TO_BINDIR} > /dev/null \; pwd`\"")
@@ -758,7 +758,7 @@ set(G4BIN_DIR "\"`cd \$geant4make_root/${G4MAKE_TO_BINDIR} > /dev/null \; pwd`\"
 # - Lib dir
 file(RELATIVE_PATH
   G4MAKE_TO_LIBDIR
-  ${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
+  ${CMAKE_INSTALL_FULL_DATADIR}/geant4make
   ${CMAKE_INSTALL_FULL_LIBDIR}
   )
 set(G4LIB "\"`cd \$geant4make_root/${G4MAKE_TO_LIBDIR}/Geant4-${Geant4_VERSION} > /dev/null \; pwd`\"")
@@ -775,7 +775,7 @@ foreach(_ds ${GEANT4_EXPORTED_DATASETS})
 
   file(RELATIVE_PATH
     G4MAKE_TO_DATADIR
-    ${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
+    ${CMAKE_INSTALL_FULL_DATADIR}/geant4make
     ${${_ds}_PATH}
     )
   set(${_ds}_PATH "\"`cd \$geant4make_root/${G4MAKE_TO_DATADIR} > /dev/null \; pwd`\"")
@@ -788,7 +788,7 @@ set(TOOLS_FONT_PATH "\"`cd \$geant4make_root/../fonts > /dev/null ; pwd`\"")
 _g4tc_configure_install_tree_scripts(
     ${CMAKE_BINARY_DIR}/InstallTreeFiles
     geant4make
-    ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
+    ${CMAKE_INSTALL_DATADIR}/geant4make
     )
 
 
@@ -797,7 +797,7 @@ _g4tc_configure_install_tree_scripts(
 #   softlink to the G4SYSTEM directory.
 #
 install(DIRECTORY config
-    DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
+    DESTINATION ${CMAKE_INSTALL_DATADIR}/geant4make
     COMPONENT Development
     FILES_MATCHING PATTERN "*.gmk"
     PATTERN "CVS" EXCLUDE
@@ -845,11 +845,11 @@ endforeach()
 
 # - Fonts
 file(RELATIVE_PATH
-  G4ENV_BINDIR_TO_DATAROOTDIR
+  G4ENV_BINDIR_TO_DATADIR
   "${CMAKE_INSTALL_FULL_BINDIR}"
-  "${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}"
+  "${CMAKE_INSTALL_FULL_DATADIR}"
   )
-set(TOOLS_FONT_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATAROOTDIR}/fonts > /dev/null ; pwd`\"")
+set(TOOLS_FONT_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATADIR}/fonts > /dev/null ; pwd`\"")
 
 
 # - Configure for each shell
diff --git a/cmake/Modules/Geant4InstallData.cmake b/cmake/Modules/Geant4InstallData.cmake
index 496b0fc4df..55536e51d4 100644
--- a/cmake/Modules/Geant4InstallData.cmake
+++ b/cmake/Modules/Geant4InstallData.cmake
@@ -105,7 +105,7 @@ set(GEANT4_DATASETS_URL "https://cern.ch/geant4-data/datasets")
 set(GEANT4_BUILD_FULL_DATADIR ${PROJECT_BINARY_DIR}/data)
 
 # Where to install data in the install tree (a Default)
-set(GEANT4_INSTALL_DATADIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}/data")
+set(GEANT4_INSTALL_DATADIR_DEFAULT "${CMAKE_INSTALL_DATADIR}/data")
 
 # File containing dataset list
 set(GEANT4_DATASETS_DEFINITIONS "Geant4DatasetDefinitions")
@@ -596,7 +596,7 @@ endfunction()
 # Choose Physics Data Install Dir
 # This follows the pattern for interface and setting as in GNUInstallDirs
 if(NOT GEANT4_INSTALL_DATADIR)
-  set(GEANT4_INSTALL_DATADIR "" CACHE PATH "read-only architecture independent Geant4 physics data (DATAROOTDIR/${GEANT4_INSTALL_DATADIR_DEFAULT}")
+  set(GEANT4_INSTALL_DATADIR "" CACHE PATH "read-only architecture independent Geant4 physics data (DATADIR/data")
   set(GEANT4_INSTALL_DATADIR "${GEANT4_INSTALL_DATADIR_DEFAULT}")
 endif()
 
diff --git a/source/analysis/CMakeLists.txt b/source/analysis/CMakeLists.txt
index 44fa4a97be..4c40c704be 100644
--- a/source/analysis/CMakeLists.txt
+++ b/source/analysis/CMakeLists.txt
@@ -67,7 +67,7 @@ endif()
 #
 if (GEANT4_USE_FREETYPE)
   install(DIRECTORY fonts/
-    DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/fonts
+    DESTINATION ${CMAKE_INSTALL_DATADIR}/fonts
     PATTERN ".svn" EXCLUDE
   )
 endif()
diff --git a/source/analysis/g4tools/CMakeLists.txt b/source/analysis/g4tools/CMakeLists.txt
index 54c72f1297..df87582bc1 100644
--- a/source/analysis/g4tools/CMakeLists.txt
+++ b/source/analysis/g4tools/CMakeLists.txt
@@ -43,7 +43,7 @@ install(DIRECTORY include/
 # We also need to install the tools license
 #
 install(FILES tools.license
-  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}
+  DESTINATION ${CMAKE_INSTALL_DATADIR}
   )
 
 #------------------------------------------------------------------------------
-- 
2.25.1