| Summary: | G4INCLUDE not set properly when include/Geant4 is populated | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Michael Kelsey <kelsey> |
| Component: | cmake | Assignee: | Ben Morgan <Ben.Morgan> |
| Status: | CLOSED MOVED | ||
| Severity: | minor | ||
| Priority: | P5 | ||
| Version: | 9.5 | ||
| Hardware: | All | ||
| OS: | All | ||
| Problem Depends on: | |||
| Problem Blocks: | 1352 | ||
|
Description
Michael Kelsey
2012-09-19 06:13:02 CEST
There are two different geant4make.(c)sh scripts, one that's generated where you build Geant4 (so you can use your build of Geant4 without installing it if you wish), and one that's installed when you do "make install" (it is located in the "InstallTreeFiles" directory where you build Geant4, and is not usable until it has been installed).
The first of these sets G4INCLUDE to ".../no_include" because
binmake.gmk actually checks that G4INCLUDE contains "globals.hh" (line 16 of binmake.gmk). If the file is not there, then it falls back to using all include directories it knows about under G4BASE (#ifndef block at line 43 of binmake.gmk), which is the "source/" directory under the Geant4 source tree.
At present, we don't copy (or forward) headers into the build tree, so we use this fallback mechanism to obtain the correct paths.
Even if we didn't set G4INCLUDE, architecture.gmk would automatically set it. It's therefore always set in the scripts as this provides a better guarantee of the correct behaviour and gives a cleaner implementation.
We can set G4INCLUDE to ${PROJECT_BINARY_DIR}/include/Geant4, and this will not result in any difference to how binmake.gmk will set up include paths.
Nevertheless, it may be worthwhile to do this to allow for copying/generating/forwarding headers in future. Does that sound reasonable?
Postponing to first patch of 9.6, we'll resolve this more generally so that all build products are output to a hierarchy under the build directory matching the install structure. For example, on UNIX systems, the build directory could contain
something like
+- my-geant4-build/
+- Makefile
+- ... etc ..
+- build_products/
+- bin/
| +- geant4-config
+- include/
| +- Geant4/
| +- G4Config.hh
| +- ...
+- lib/
| +- libG4global.so
| +- ...
+- share/
I'm not completely sure what to do with the headers yet. A straight copy or forwarding might be expensive, but would make the -I paths simpler!
Closing here, moving to DEV project on JIRA. |