Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
+53 -46
View File
@@ -43,58 +43,65 @@
# https://github.com/jedbrown/cmake-modules/blob/master/ResolveCompilerPaths.cmake
# See COPYING-CMAKE-SCRIPTS for licensing information (BSD)
macro (RESOLVE_LIBRARIES LIBS LINK_LINE)
string (REGEX MATCHALL "((-L|-l|-Wl)([^\" ]+|\"[^\"]+\")|/[^\" ]+(a|so|dll))" _all_tokens "${LINK_LINE}")
set (_libs_found)
set (_directory_list)
foreach (token ${_all_tokens})
if (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
#-----------------------------------------------------------------------
# macro resolve_libraries()
#
macro(resolve_libraries LIBS LINK_LINE)
string(REGEX MATCHALL "((-L|-l|-Wl)([^\" ]+|\"[^\"]+\")|/[^\" ]+(a|so|dll))" _all_tokens "${LINK_LINE}")
set(_libs_found)
set(_directory_list)
foreach(token ${_all_tokens})
if(token MATCHES "-L([^\" ]+|\"[^\"]+\")")
# If it's a library path, add it to the list
string (REGEX REPLACE "^-L" "" token ${token})
string (REGEX REPLACE "//" "/" token ${token})
list (APPEND _directory_list ${token})
elseif (token MATCHES "^(-l([^\" ]+|\"[^\"]+\")|/[^\" ]+(a|so|dll))")
elseif(token MATCHES "^(-l([^\" ]+|\"[^\"]+\")|/[^\" ]+(a|so|dll))")
# It's a library, resolve the path by looking in the list and then (by default) in system directories
string (REGEX REPLACE "^-l" "" token ${token})
set (_root)
if (token MATCHES "^/") # We have an absolute path, add root to the search path
set (_root "/")
endif (token MATCHES "^/")
set (_lib "NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library (_lib ${token} HINTS ${_directory_list} ${_root})
if (_lib)
string (REPLACE "//" "/" _lib ${_lib})
list (APPEND _libs_found ${_lib})
else (_lib)
message (STATUS "Unable to find library ${token}")
endif (_lib)
endif (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
endforeach (token)
set (_lib "NOTFOUND" CACHE INTERNAL "Scratch variable" FORCE)
string(REGEX REPLACE "^-l" "" token ${token})
set(_root)
if(token MATCHES "^/")
# We have an absolute path, add root to the search path
set(_root "/")
endif()
set(_lib "NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(_lib ${token} HINTS ${_directory_list} ${_root})
if(_lib)
string(REPLACE "//" "/" _lib ${_lib})
list(APPEND _libs_found ${_lib})
else()
message(STATUS "Unable to find library ${token}")
endif()
endif()
endforeach()
set(_lib "NOTFOUND" CACHE INTERNAL "Scratch variable" FORCE)
# only the LAST occurence of each library is required since there should be no circular dependencies
if (_libs_found)
list (REVERSE _libs_found)
list (REMOVE_DUPLICATES _libs_found)
list (REVERSE _libs_found)
endif (_libs_found)
set (${LIBS} "${_libs_found}")
endmacro (RESOLVE_LIBRARIES)
if(_libs_found)
list(REVERSE _libs_found)
list(REMOVE_DUPLICATES _libs_found)
list(REVERSE _libs_found)
endif()
set(${LIBS} "${_libs_found}")
endmacro()
macro (RESOLVE_INCLUDES INCS COMPILE_LINE)
string (REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" _all_tokens "${COMPILE_LINE}")
set (_incs_found)
foreach (token ${_all_tokens})
string (REGEX REPLACE "^-I" "" token ${token})
string (REGEX REPLACE "//" "/" token ${token})
#-----------------------------------------------------------------------
# macro resolve_includes()
#
macro(resolve_includes INCS COMPILE_LINE)
string(REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" _all_tokens "${COMPILE_LINE}")
set(_incs_found)
foreach(token ${_all_tokens})
string(REGEX REPLACE "^-I" "" token ${token})
string(REGEX REPLACE "//" "/" token ${token})
# - Remove any residual quotes (from Fabian Kislat: Bug #1357)
string (REGEX REPLACE "(^\"|\"$)" "" token ${token})
if (EXISTS ${token})
list (APPEND _incs_found ${token})
else (EXISTS ${token})
message (STATUS "Include directory ${token} does not exist")
endif (EXISTS ${token})
endforeach (token)
list (REMOVE_DUPLICATES _incs_found)
set (${INCS} "${_incs_found}")
endmacro (RESOLVE_INCLUDES)
string(REGEX REPLACE "(^\"|\"$)" "" token ${token})
if(EXISTS ${token})
list(APPEND _incs_found ${token})
else()
message(STATUS "Include directory ${token} does not exist")
endif()
endforeach()
list(REMOVE_DUPLICATES _incs_found)
set(${INCS} "${_incs_found}")
endmacro()