# - Set up backward compatible Geant4 GNU make toolchain # # The GNU make based buildsystem for Geant4 provides a toolchain for # users building simple Geant4 applications. The old style build and # install of Geant4 provides a customized set of non-standard install # paths with use of the toolchain dependent on environment variables # pointing to the install paths. # # This script processes information on the CMake install paths, system # and compiler to determine the following variables for backward # compatibility: # # GEANT4_SYSTEM Old style system name, e.g. 'Linux', 'Darwin' # or 'WIN32' # # GEANT4_COMPILER Old system compiler id, e.g. 'g++', 'VC'. # # G4INSTALL Location of 'config' subdirectory which contains # all the GNU make toolchain fragments # # G4INCLUDE Old style path to location of Geant4 headers # # G4LIB Old style library directory path. Rather than # containing the actual libraries, it is expected to # contain subdirectories named # GEANT4_SYSTEM-GEANT4_COMPILER # # These variables are used in a CMake configuration file which is used # to generate shell scripts (C and Bourne flavour) the user can source # to set up their environment for use of the old toolchain. # These replace the old 'env.(c)sh' scripts to allow users to work with # the new CMake built libraries transparently if their application # relies on the old style toolchain. # # The scripts are generated for both the build and install trees so that # developers wishing to write test applications do not have to install # their fresh build of Geant4. # # Compatibility with the library path style: # # /lib/G4SYSTEM-G4COMPILER # # is provided by installing a directory 'geant4-' in the # /lib directory and creating a symbolic link inside here # pointing up one directory level. # This will not work on Windows however, and here users are recommended # to use Visual Studio directly, or to use CMake for application # configuration. # #----------------------------------------------------------------------- # - Functions and Macros to help configuration of shell scripts. #----------------------------------------------------------------------- # macro _g4tc_shell_setup() # Set shell parameters such as program, family and common builtins # for supplied shell (e.g. 'bourne' or 'cshell' # macro(_g4tc_shell_setup SHELL_FAMILY) if(${SHELL_FAMILY} STREQUAL "bourne") set(GEANT4_TC_SHELL_PROGRAM "/bin/sh") set(GEANT4_TC_SHELL_FAMILY "Bourne shell") set(GEANT4_TC_UNSET_COMMAND "unset") set(GEANT4_TC_SHELL_EXTENSION ".sh") elseif(${SHELL_FAMILY} STREQUAL "cshell") set(GEANT4_TC_SHELL_PROGRAM "/bin/csh") set(GEANT4_TC_SHELL_FAMILY "C shell") set(GEANT4_TC_UNSET_COMMAND "unsetenv") set(GEANT4_TC_SHELL_EXTENSION ".csh") else() message(FATAL_ERROR "Unsupported shell '${SHELL_FAMILY}'") endif() endmacro() #----------------------------------------------------------------------- # function _g4tc_selflocate(