mirror of
https://github.com/OpenCMT/uLib.git
synced 2025-12-06 07:21:31 +01:00
[uLib Geometry]
non working version! + adds ProgrammableAccessor + renaming of some Image structures ...
This commit is contained in:
81
tmp/CodeLoop/CMake/FindEigen3.cmake
Normal file
81
tmp/CodeLoop/CMake/FindEigen3.cmake
Normal file
@@ -0,0 +1,81 @@
|
||||
# - Try to find Eigen3 lib
|
||||
#
|
||||
# This module supports requiring a minimum version, e.g. you can do
|
||||
# find_package(Eigen3 3.1.2)
|
||||
# to require version 3.1.2 or newer of Eigen3.
|
||||
#
|
||||
# Once done this will define
|
||||
#
|
||||
# EIGEN3_FOUND - system has eigen lib with correct version
|
||||
# EIGEN3_INCLUDE_DIR - the eigen include directory
|
||||
# EIGEN3_VERSION - eigen version
|
||||
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
|
||||
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
|
||||
|
||||
if(NOT Eigen3_FIND_VERSION)
|
||||
if(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
set(Eigen3_FIND_VERSION_MAJOR 2)
|
||||
endif(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
if(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
set(Eigen3_FIND_VERSION_MINOR 91)
|
||||
endif(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
if(NOT Eigen3_FIND_VERSION_PATCH)
|
||||
set(Eigen3_FIND_VERSION_PATCH 0)
|
||||
endif(NOT Eigen3_FIND_VERSION_PATCH)
|
||||
|
||||
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
|
||||
endif(NOT Eigen3_FIND_VERSION)
|
||||
|
||||
macro(_eigen3_check_version)
|
||||
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
|
||||
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
|
||||
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
|
||||
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
set(EIGEN3_VERSION_OK FALSE)
|
||||
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
set(EIGEN3_VERSION_OK TRUE)
|
||||
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
|
||||
if(NOT EIGEN3_VERSION_OK)
|
||||
|
||||
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
|
||||
"but at least version ${Eigen3_FIND_VERSION} is required")
|
||||
endif(NOT EIGEN3_VERSION_OK)
|
||||
endmacro(_eigen3_check_version)
|
||||
|
||||
if (EIGEN3_INCLUDE_DIR)
|
||||
|
||||
# in cache already
|
||||
_eigen3_check_version()
|
||||
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
|
||||
|
||||
else (EIGEN3_INCLUDE_DIR)
|
||||
|
||||
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
|
||||
PATHS
|
||||
${CMAKE_INSTALL_PREFIX}/include
|
||||
${KDE4_INCLUDE_DIR}
|
||||
PATH_SUFFIXES eigen3 eigen
|
||||
)
|
||||
|
||||
if(EIGEN3_INCLUDE_DIR)
|
||||
_eigen3_check_version()
|
||||
endif(EIGEN3_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
|
||||
|
||||
mark_as_advanced(EIGEN3_INCLUDE_DIR)
|
||||
|
||||
endif(EIGEN3_INCLUDE_DIR)
|
||||
|
||||
63
tmp/CodeLoop/CMake/FindGEANT4.cmake
Normal file
63
tmp/CodeLoop/CMake/FindGEANT4.cmake
Normal file
@@ -0,0 +1,63 @@
|
||||
# - Try to find GEANT4
|
||||
# Once done this will define
|
||||
#
|
||||
# GEANT4_FOUND - system has GEANT4
|
||||
# GEANT4_INCLUDE_DIR - the GEANT4 include directory
|
||||
# GEANT4_LIBRARIES - The libraries needed to use GEANT4
|
||||
# GEANT4_DEFINITIONS - Compiler switches required for using GEANT4
|
||||
#
|
||||
|
||||
if (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR)
|
||||
SET (GEANT4_INCLUDE_DIR GEANT4_INCLUDE_DIR-NOTFOUND)
|
||||
SET (GEANT4_LIB_DIR GEANT4_LIB_DIR-NOTFOUND)
|
||||
SET (GEANT4_PLISTS_LIB_DIR GEANT4_PLISTS_LIB_DIR-NOTFOUND)
|
||||
SET (GEANT4_DIR GEANT4_DIR-NOTFOUND)
|
||||
endif (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR)
|
||||
|
||||
MESSAGE(STATUS "Looking for GEANT4...")
|
||||
|
||||
FIND_PATH(GEANT4_DIR NAMES env.sh PATHS
|
||||
${SIMPATH}/transport/geant4
|
||||
${SIMPATH}/transport/geant4/source
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
FIND_PATH(GEANT4_INCLUDE_DIR NAMES G4Event.hh PATHS
|
||||
${SIMPATH}/transport/geant4/include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
SET(GEANT4_INCLUDE_DIR
|
||||
${SIMPATH}/transport/geant4/include
|
||||
${SIMPATH}/transport/geant4/source/interfaces/common/include
|
||||
${SIMPATH}/transport/geant4/physics_lists/hadronic/Packaging/include
|
||||
${SIMPATH}/transport/geant4/physics_lists/hadronic/QGSP/include
|
||||
)
|
||||
|
||||
FIND_PATH(GEANT4_LIB_DIR NAMES libG4baryons.so libG4baryons.dylib PATHS
|
||||
${SIMPATH}/transport/geant4/lib/Linux-g++
|
||||
${SIMPATH}/transport/geant4/lib/Linux-icc
|
||||
${SIMPATH}/transport/geant4/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
IF (GEANT4_LIB_DIR)
|
||||
SET(GEANT4_LIBRARY_DIR ${GEANT4_LIB_DIR})
|
||||
ENDIF (GEANT4_LIB_DIR)
|
||||
|
||||
if (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR)
|
||||
set(GEANT4_FOUND TRUE)
|
||||
endif (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR)
|
||||
|
||||
if (GEANT4_FOUND)
|
||||
if (NOT GEANT4_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Looking for GEANT4... - found ${GEANT4_LIBRARY_DIR}")
|
||||
# message(STATUS "Found ${GEANT4_LIBRARY_DIR}")
|
||||
endif (NOT GEANT4_FIND_QUIETLY)
|
||||
SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${GEANT4_LIBRARY_DIR})
|
||||
else (GEANT4_FOUND)
|
||||
if (GEANT4_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Looking for GEANT4... - Not found")
|
||||
endif (GEANT4_FIND_REQUIRED)
|
||||
endif (GEANT4_FOUND)
|
||||
|
||||
97
tmp/CodeLoop/CMake/FindGEANT4VMC.cmake
Normal file
97
tmp/CodeLoop/CMake/FindGEANT4VMC.cmake
Normal file
@@ -0,0 +1,97 @@
|
||||
# - Try to find GEANT4VMC
|
||||
# Once done this will define
|
||||
#
|
||||
# GEANT4VMC_FOUND - system has GEANT3
|
||||
# GEANT4VMC_INCLUDE_DIR - the GEANT3 include directory
|
||||
# GEANT4VMC_LIBRARIES - The libraries needed to use GEANT3
|
||||
# GEANT4VMC_DEFINITIONS - Compiler switches required for using GEANT3
|
||||
#
|
||||
|
||||
if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR)
|
||||
SET (GEANT4VMC_INCLUDE_DIR GEANT4VMC_INCLUDE_DIR-NOTFOUND)
|
||||
SET (GEANT4VMC_LIB_DIR GEANT4VMC_LIB_DIR-NOTFOUND)
|
||||
SET (GEANT4VMC_PLISTS_LIB_DIR GEANT4VMC_PLISTS_LIB_DIR-NOTFOUND)
|
||||
endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR)
|
||||
|
||||
MESSAGE(STATUS "Looking for GEANT4VMC...")
|
||||
|
||||
FIND_PATH(GEANT4VMC_INCLUDE_DIR NAMES TG4G3Units.h PATHS
|
||||
${SIMPATH}/transport/geant4_vmc/include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
set(GEANT4VMC_INCLUDE_DIR
|
||||
${SIMPATH}/transport/geant4_vmc/source/global/include
|
||||
${SIMPATH}/transport/geant4_vmc/source/geometry/include
|
||||
${SIMPATH}/transport/geant4_vmc/source/digits+hits/include
|
||||
${SIMPATH}/transport/geant4_vmc/source/physics/include
|
||||
${SIMPATH}/transport/geant4_vmc/source/event/include
|
||||
${SIMPATH}/transport/geant4_vmc/source/run/include
|
||||
${SIMPATH}/transport/geant4_vmc/source/interfaces/include
|
||||
${SIMPATH}/transport/geant4_vmc/source/visualization/include
|
||||
${SIMPATH}/transport/geant4_vmc/include
|
||||
${SIMPATH}/transport/vgm/packages/BaseVGM/include
|
||||
${SIMPATH}/transport/vgm/packages/ClhepVGM/include
|
||||
${SIMPATH}/transport/vgm/packages/Geant4GM/include
|
||||
${SIMPATH}/transport/vgm/packages/RootGM/include
|
||||
${SIMPATH}/transport/vgm/packages/VGM/include
|
||||
${SIMPATH}/transport/vgm/packages/XmlVGM/include
|
||||
)
|
||||
|
||||
|
||||
FIND_PATH(GEANT4VMC_LIBRARY_DIR NAMES libgeant4vmc.so libgeant4vmc.dylib PATHS
|
||||
${SIMPATH}/transport/geant4_vmc/lib/tgt_linux
|
||||
${SIMPATH}/transport/geant4_vmc/lib/tgt_linuxicc
|
||||
${SIMPATH}/transport/geant4_vmc/lib/tgt_linuxx8664gcc
|
||||
${SIMPATH}/transport/geant4_vmc/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# check for existence of header file, which is needed in CbmRunConfiguration
|
||||
# The file is only present in old versions of VMC
|
||||
FIND_FILE(GEANT4_MODULAR_PHYSICS_LIST TG4ModularPhysicsList.h PATHS
|
||||
${GEANT4VMC_INCLUDE_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR)
|
||||
if (NOT GEANT4VMC_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Looking for GEANT4VMC... - found ${GEANT4VMC_LIBRARY_DIR}")
|
||||
endif (NOT GEANT4VMC_FIND_QUIETLY)
|
||||
else (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR)
|
||||
if (GEANT4VMC_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Looking for GEANT4VMC... - Not found ")
|
||||
endif (GEANT4VMC_FIND_REQUIRED)
|
||||
endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR)
|
||||
|
||||
|
||||
MESSAGE(STATUS "Looking for VGM...")
|
||||
|
||||
FIND_PATH(VGM_LIBRARY_DIR NAMES libBaseVGM.so libBaseVGM.dylib PATHS
|
||||
${SIMPATH}/transport/vgm/lib/Linux-g++
|
||||
${SIMPATH}/transport/vgm.2.08.04/lib/Linux-g++
|
||||
${SIMPATH}/transport/vgm/lib/Linux-icc
|
||||
${SIMPATH}/transport/vgm/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if (VGM_LIBRARY_DIR)
|
||||
if (NOT GEANT4VMC_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Looking for VGM... - found ${VGM_LIBRARY_DIR}")
|
||||
endif (NOT GEANT4VMC_FIND_QUIETLY)
|
||||
else (VGM_LIBRARY_DIR)
|
||||
if (GEANT4VMC_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Looking for VGM... - Not found ")
|
||||
endif (GEANT4VMC_FIND_REQUIRED)
|
||||
endif (VGM_LIBRARY_DIR)
|
||||
|
||||
|
||||
if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR AND VGM_LIBRARY_DIR)
|
||||
set(GEANT4VMC_FOUND TRUE)
|
||||
endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR AND VGM_LIBRARY_DIR)
|
||||
|
||||
if (GEANT4VMC_FOUND)
|
||||
SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${GEANT4VMC_LIBRARY_DIR}
|
||||
${VGM_LIBRARY_DIR})
|
||||
endif (GEANT4VMC_FOUND)
|
||||
|
||||
270
tmp/CodeLoop/CMake/FindROOT.cmake
Normal file
270
tmp/CodeLoop/CMake/FindROOT.cmake
Normal file
@@ -0,0 +1,270 @@
|
||||
# - Find ROOT instalation
|
||||
# This module tries to find the ROOT installation on your system.
|
||||
# It tries to find the root-config script which gives you all the needed information.
|
||||
# If the system variable ROOTSYS is set this is straight forward.
|
||||
# If not the module uses the pathes given in ROOT_CONFIG_SEARCHPATH.
|
||||
# If you need an other path you should add this path to this varaible.
|
||||
# The root-config script is then used to detect basically everything else.
|
||||
# This module defines a number of key variables and macros.
|
||||
|
||||
# F.Uhlig@gsi.de (fairroot.gsi.de)
|
||||
|
||||
|
||||
MESSAGE(STATUS "Looking for Root...")
|
||||
|
||||
SET(ROOT_CONFIG_SEARCHPATH
|
||||
/usr/local/bin
|
||||
${SIMPATH}/tools/root/bin
|
||||
$ENV{ROOTSYS}/bin
|
||||
)
|
||||
|
||||
SET(ROOT_DEFINITIONS "")
|
||||
|
||||
SET(ROOT_INSTALLED_VERSION_TOO_OLD FALSE)
|
||||
|
||||
SET(ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND)
|
||||
|
||||
FIND_PROGRAM(ROOT_CONFIG_EXECUTABLE NAMES root-config PATHS
|
||||
${ROOT_CONFIG_SEARCHPATH}
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
IF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")
|
||||
MESSAGE( FATAL_ERROR "ROOT not installed in the searchpath and ROOTSYS is not set. Please
|
||||
set ROOTSYS or add the path to your ROOT installation in the Macro FindROOT.cmake in the
|
||||
subdirectory cmake/modules.")
|
||||
ELSE (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")
|
||||
STRING(REGEX REPLACE "(^.*)/bin/root-config" "\\1" test ${ROOT_CONFIG_EXECUTABLE})
|
||||
SET( ENV{ROOTSYS} ${test})
|
||||
set( ROOTSYS ${test})
|
||||
ENDIF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND")
|
||||
|
||||
|
||||
IF (ROOT_CONFIG_EXECUTABLE)
|
||||
|
||||
SET(ROOT_FOUND FALSE)
|
||||
|
||||
EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} ARGS "--version" OUTPUT_VARIABLE ROOTVERSION)
|
||||
|
||||
MESSAGE(STATUS "Looking for Root... - found $ENV{ROOTSYS}/bin/root")
|
||||
MESSAGE(STATUS "Looking for Root... - version ${ROOTVERSION} ")
|
||||
|
||||
# we need at least version 5.00/00
|
||||
IF (NOT ROOT_MIN_VERSION)
|
||||
SET(ROOT_MIN_VERSION "5.00/00")
|
||||
ENDIF (NOT ROOT_MIN_VERSION)
|
||||
|
||||
# now parse the parts of the user given version string into variables
|
||||
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" req_root_major_vers "${ROOT_MIN_VERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" req_root_minor_vers "${ROOT_MIN_VERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" req_root_patch_vers "${ROOT_MIN_VERSION}")
|
||||
|
||||
# and now the version string given by qmake
|
||||
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" found_root_minor_vers "${ROOTVERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1" found_root_patch_vers "${ROOTVERSION}")
|
||||
|
||||
IF (found_root_major_vers LESS 5)
|
||||
MESSAGE( FATAL_ERROR "Invalid ROOT version \"${ROOTERSION}\", at least major version 4 is required, e.g. \"5.00/00\"")
|
||||
ENDIF (found_root_major_vers LESS 5)
|
||||
|
||||
# compute an overall version number which can be compared at once
|
||||
MATH(EXPR req_vers "${req_root_major_vers}*10000 + ${req_root_minor_vers}*100 + ${req_root_patch_vers}")
|
||||
MATH(EXPR found_vers "${found_root_major_vers}*10000 + ${found_root_minor_vers}*100 + ${found_root_patch_vers}")
|
||||
|
||||
IF (found_vers LESS req_vers)
|
||||
SET(ROOT_FOUND FALSE)
|
||||
SET(ROOT_INSTALLED_VERSION_TOO_OLD TRUE)
|
||||
ELSE (found_vers LESS req_vers)
|
||||
SET(ROOT_FOUND TRUE)
|
||||
ENDIF (found_vers LESS req_vers)
|
||||
|
||||
ENDIF (ROOT_CONFIG_EXECUTABLE)
|
||||
|
||||
|
||||
IF (ROOT_FOUND)
|
||||
|
||||
# ask root-config for the library dir
|
||||
# Set ROOT_LIBRARY_DIR
|
||||
|
||||
EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE}
|
||||
ARGS "--libdir"
|
||||
OUTPUT_VARIABLE ROOT_LIBRARY_DIR_TMP )
|
||||
|
||||
IF(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
|
||||
SET(ROOT_LIBRARY_DIR ${ROOT_LIBRARY_DIR_TMP} )
|
||||
ELSE(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
|
||||
MESSAGE("Warning: ROOT_CONFIG_EXECUTABLE reported ${ROOT_LIBRARY_DIR_TMP} as library path,")
|
||||
MESSAGE("Warning: but ${ROOT_LIBRARY_DIR_TMP} does NOT exist, ROOT must NOT be installed correctly.")
|
||||
ENDIF(EXISTS "${ROOT_LIBRARY_DIR_TMP}")
|
||||
|
||||
# ask root-config for the binary dir
|
||||
EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE}
|
||||
ARGS "--bindir"
|
||||
OUTPUT_VARIABLE root_bins )
|
||||
SET(ROOT_BINARY_DIR ${root_bins})
|
||||
|
||||
# ask root-config for the include dir
|
||||
EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE}
|
||||
ARGS "--incdir"
|
||||
OUTPUT_VARIABLE root_headers )
|
||||
SET(ROOT_INCLUDE_DIR ${root_headers})
|
||||
# CACHE INTERNAL "")
|
||||
|
||||
# ask root-config for the library varaibles
|
||||
EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE}
|
||||
# ARGS "--noldflags --noauxlibs --libs"
|
||||
ARGS "--glibs"
|
||||
OUTPUT_VARIABLE root_flags )
|
||||
|
||||
# STRING(REGEX MATCHALL "([^ ])+" root_libs_all ${root_flags})
|
||||
# STRING(REGEX MATCHALL "-L([^ ])+" root_library ${root_flags})
|
||||
# REMOVE_FROM_LIST(root_flags "${root_libs_all}" "${root_library}")
|
||||
|
||||
SET(ROOT_LIBRARIES ${root_flags})
|
||||
|
||||
# Make variables changeble to the advanced user
|
||||
MARK_AS_ADVANCED( ROOT_LIBRARY_DIR ROOT_INCLUDE_DIR ROOT_DEFINITIONS)
|
||||
|
||||
# Set ROOT_INCLUDES
|
||||
SET( ROOT_INCLUDES ${ROOT_INCLUDE_DIR})
|
||||
|
||||
SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${ROOT_LIBRARY_DIR})
|
||||
|
||||
#######################################
|
||||
#
|
||||
# Check the executables of ROOT
|
||||
# ( rootcint )
|
||||
#
|
||||
#######################################
|
||||
|
||||
FIND_PROGRAM(ROOT_CINT_EXECUTABLE
|
||||
NAMES rootcint
|
||||
PATHS ${ROOT_BINARY_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
ENDIF (ROOT_FOUND)
|
||||
|
||||
|
||||
|
||||
###########################################
|
||||
#
|
||||
# Macros for building ROOT dictionary
|
||||
#
|
||||
###########################################
|
||||
|
||||
MACRO (ROOT_GENERATE_DICTIONARY_OLD )
|
||||
|
||||
set(INFILES "")
|
||||
|
||||
foreach (_current_FILE ${ARGN})
|
||||
|
||||
IF (${_current_FILE} MATCHES "^.*\\.h$")
|
||||
IF (${_current_FILE} MATCHES "^.*Link.*$")
|
||||
set(LINKDEF_FILE ${_current_FILE})
|
||||
ELSE (${_current_FILE} MATCHES "^.*Link.*$")
|
||||
set(INFILES ${INFILES} ${_current_FILE})
|
||||
ENDIF (${_current_FILE} MATCHES "^.*Link.*$")
|
||||
ELSE (${_current_FILE} MATCHES "^.*\\.h$")
|
||||
IF (${_current_FILE} MATCHES "^.*\\.cxx$")
|
||||
set(OUTFILE ${_current_FILE})
|
||||
ELSE (${_current_FILE} MATCHES "^.*\\.cxx$")
|
||||
set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE})
|
||||
ENDIF (${_current_FILE} MATCHES "^.*\\.cxx$")
|
||||
ENDIF (${_current_FILE} MATCHES "^.*\\.h$")
|
||||
|
||||
endforeach (_current_FILE ${ARGN})
|
||||
|
||||
# MESSAGE("INFILES: ${INFILES}")
|
||||
# MESSAGE("OutFILE: ${OUTFILE}")
|
||||
# MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}")
|
||||
# MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}")
|
||||
|
||||
STRING(REGEX REPLACE "(^.*).cxx" "\\1.h" bla "${OUTFILE}")
|
||||
# MESSAGE("BLA: ${bla}")
|
||||
SET (OUTFILES ${OUTFILE} ${bla})
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES}
|
||||
COMMAND ${ROOT_CINT_EXECUTABLE}
|
||||
ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES})
|
||||
|
||||
# MESSAGE("ROOT_CINT_EXECUTABLE has created the dictionary ${OUTFILE}")
|
||||
|
||||
ENDMACRO (ROOT_GENERATE_DICTIONARY_OLD)
|
||||
|
||||
###########################################
|
||||
#
|
||||
# Macros for building ROOT dictionary
|
||||
#
|
||||
###########################################
|
||||
|
||||
MACRO (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN)
|
||||
|
||||
set(INCLUDE_DIRS)
|
||||
|
||||
foreach (_current_FILE ${INCLUDE_DIRS_IN})
|
||||
set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE})
|
||||
endforeach (_current_FILE ${INCLUDE_DIRS_IN})
|
||||
|
||||
|
||||
# MESSAGE("INFILES: ${INFILES}")
|
||||
# MESSAGE("OutFILE: ${OUTFILE}")
|
||||
# MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}")
|
||||
# MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}")
|
||||
|
||||
STRING(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${OUTFILE}")
|
||||
# MESSAGE("BLA: ${bla}")
|
||||
SET (OUTFILES ${OUTFILE} ${bla})
|
||||
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES Linux)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES}
|
||||
COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE}
|
||||
ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES} ${LINKDEF_FILE})
|
||||
else (CMAKE_SYSTEM_NAME MATCHES Linux)
|
||||
if (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES}
|
||||
COMMAND DYLD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE}
|
||||
ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES} ${LINKDEF_FILE})
|
||||
endif (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
||||
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
|
||||
|
||||
ENDMACRO (ROOT_GENERATE_DICTIONARY)
|
||||
|
||||
MACRO (GENERATE_ROOT_TEST_SCRIPT SCRIPT_FULL_NAME)
|
||||
|
||||
get_filename_component(path_name ${SCRIPT_FULL_NAME} PATH)
|
||||
get_filename_component(file_extension ${SCRIPT_FULL_NAME} EXT)
|
||||
get_filename_component(file_name ${SCRIPT_FULL_NAME} NAME_WE)
|
||||
set(shell_script_name "${file_name}.sh")
|
||||
|
||||
#MESSAGE("PATH: ${path_name}")
|
||||
#MESSAGE("Ext: ${file_extension}")
|
||||
#MESSAGE("Name: ${file_name}")
|
||||
#MESSAGE("Shell Name: ${shell_script_name}")
|
||||
|
||||
string(REPLACE ${PROJECT_SOURCE_DIR}
|
||||
${PROJECT_BINARY_DIR} new_path ${path_name}
|
||||
)
|
||||
|
||||
#MESSAGE("New PATH: ${new_path}")
|
||||
|
||||
file(MAKE_DIRECTORY ${new_path}/data)
|
||||
|
||||
CONVERT_LIST_TO_STRING(${LD_LIBRARY_PATH})
|
||||
set(MY_LD_LIBRARY_PATH ${output})
|
||||
set(my_script_name ${SCRIPT_FULL_NAME})
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES Darwin)
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/root_macro_macos.sh.in
|
||||
${new_path}/${shell_script_name}
|
||||
)
|
||||
else(CMAKE_SYSTEM MATCHES Darwin)
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/root_macro.sh.in
|
||||
${new_path}/${shell_script_name}
|
||||
)
|
||||
endif(CMAKE_SYSTEM MATCHES Darwin)
|
||||
|
||||
EXEC_PROGRAM(/bin/chmod ARGS "u+x ${new_path}/${shell_script_name}")
|
||||
|
||||
ENDMACRO (GENERATE_ROOT_TEST_SCRIPT)
|
||||
141
tmp/CodeLoop/CMake/FindVTK.cmake
Normal file
141
tmp/CodeLoop/CMake/FindVTK.cmake
Normal file
@@ -0,0 +1,141 @@
|
||||
# - Find a VTK installation or build tree.
|
||||
# The following variables are set if VTK is found. If VTK is not
|
||||
# found, VTK_FOUND is set to false.
|
||||
# VTK_FOUND - Set to true when VTK is found.
|
||||
# VTK_USE_FILE - CMake file to use VTK.
|
||||
# VTK_MAJOR_VERSION - The VTK major version number.
|
||||
# VTK_MINOR_VERSION - The VTK minor version number
|
||||
# (odd non-release).
|
||||
# VTK_BUILD_VERSION - The VTK patch level
|
||||
# (meaningless for odd minor).
|
||||
# VTK_INCLUDE_DIRS - Include directories for VTK
|
||||
# VTK_LIBRARY_DIRS - Link directories for VTK libraries
|
||||
# VTK_KITS - List of VTK kits, in CAPS
|
||||
# (COMMON,IO,) etc.
|
||||
# VTK_LANGUAGES - List of wrapped languages, in CAPS
|
||||
# (TCL, PYHTON,) etc.
|
||||
# The following cache entries must be set by the user to locate VTK:
|
||||
# VTK_DIR - The directory containing VTKConfig.cmake.
|
||||
# This is either the root of the build tree,
|
||||
# or the lib/vtk directory. This is the
|
||||
# only cache entry.
|
||||
# The following variables are set for backward compatibility and
|
||||
# should not be used in new code:
|
||||
# USE_VTK_FILE - The full path to the UseVTK.cmake file.
|
||||
# This is provided for backward
|
||||
# compatibility. Use VTK_USE_FILE
|
||||
# instead.
|
||||
#
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2001-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Assume not found.
|
||||
SET(VTK_FOUND 0)
|
||||
|
||||
# VTK 4.0 did not provide VTKConfig.cmake.
|
||||
IF("${VTK_FIND_VERSION}" VERSION_LESS 4.1)
|
||||
SET(_VTK_40_ALLOW 1)
|
||||
IF(VTK_FIND_VERSION)
|
||||
SET(_VTK_40_ONLY 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Construct consitent error messages for use below.
|
||||
SET(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.")
|
||||
IF(_VTK_40_ALLOW)
|
||||
SET(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.")
|
||||
ENDIF()
|
||||
SET(VTK_DIR_MESSAGE "VTK not found. Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}")
|
||||
|
||||
# Check whether VTK 4.0 has already been found.
|
||||
IF(_VTK_40_ALLOW AND VTK_DIR)
|
||||
IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
|
||||
SET(VTK_FOUND 1)
|
||||
INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Use the Config mode of the find_package() command to find VTKConfig.
|
||||
# If this succeeds (possibly because VTK_DIR is already set), the
|
||||
# command will have already loaded VTKConfig.cmake and set VTK_FOUND.
|
||||
IF(NOT _VTK_40_ONLY AND NOT VTK_FOUND)
|
||||
FIND_PACKAGE(VTK QUIET NO_MODULE)
|
||||
ENDIF()
|
||||
|
||||
# Special search for VTK 4.0.
|
||||
IF(_VTK_40_ALLOW AND NOT VTK_DIR)
|
||||
# Old scripts may set these directories in the CMakeCache.txt file.
|
||||
# They can tell us where to find VTKConfig.cmake.
|
||||
SET(VTK_DIR_SEARCH_LEGACY "")
|
||||
IF(VTK_BINARY_PATH AND USE_BUILT_VTK)
|
||||
SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH})
|
||||
ENDIF(VTK_BINARY_PATH AND USE_BUILT_VTK)
|
||||
IF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
|
||||
SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY}
|
||||
${VTK_INSTALL_PATH}/lib/vtk)
|
||||
ENDIF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
|
||||
|
||||
# Look for UseVTK.cmake in build trees or under <prefix>/include/vtk.
|
||||
FIND_PATH(VTK_DIR
|
||||
NAMES UseVTK.cmake
|
||||
PATH_SUFFIXES vtk-4.0 vtk
|
||||
HINTS $ENV{VTK_DIR}
|
||||
|
||||
PATHS
|
||||
|
||||
# Support legacy cache files.
|
||||
${VTK_DIR_SEARCH_LEGACY}
|
||||
|
||||
# Read from the CMakeSetup registry entries. It is likely that
|
||||
# VTK will have been recently built.
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9]
|
||||
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10]
|
||||
|
||||
# Help the user find it if we cannot.
|
||||
DOC "The ${VTK_DIR_DESCRIPTION}"
|
||||
)
|
||||
|
||||
IF(VTK_DIR)
|
||||
IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
|
||||
SET(VTK_FOUND 1)
|
||||
INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
|
||||
ELSE()
|
||||
# We found the wrong version. Pretend we did not find it.
|
||||
SET(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
IF(VTK_FOUND)
|
||||
# Set USE_VTK_FILE for backward-compatability.
|
||||
SET(USE_VTK_FILE ${VTK_USE_FILE})
|
||||
ELSE(VTK_FOUND)
|
||||
# VTK not found, explain to the user how to specify its location.
|
||||
IF(VTK_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE})
|
||||
ELSE(VTK_FIND_REQUIRED)
|
||||
IF(NOT VTK_FIND_QUIETLY)
|
||||
MESSAGE(STATUS ${VTK_DIR_MESSAGE})
|
||||
ENDIF(NOT VTK_FIND_QUIETLY)
|
||||
ENDIF(VTK_FIND_REQUIRED)
|
||||
ENDIF(VTK_FOUND)
|
||||
Reference in New Issue
Block a user