Commits (74)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# This file is used to make it possible to pull in the code of this package into
# a top level CMake file using:
......@@ -51,6 +51,13 @@ if( CTEST_USE_LAUNCHERS )
"AtlasCMake: Package build succeeded" )
endif()
# Set ATLAS specific policies to work around temporary problems:
cmake_policy(SET CMP0058 OLD) # suppress warning about .stamp.txt files with ninja (ATLINFR-2651)
if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0" )
cmake_policy(SET CMP0074 OLD) # suppress warning about _ROOT variables (ATLINFR-2651)
endif()
# Include the AtlasFunctions file:
include( AtlasFunctions )
......
......@@ -68,7 +68,7 @@ if( CMAKE_COMPILER_IS_GNUCXX )
set( ATLAS_CXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g"
CACHE STRING "Default optimisation settings for RelWithDebInfo mode" )
set( ATLAS_CXX_FLAGS_DEBUG "-g"
CACHE STRING "Default optimisation settings for Release mode" )
CACHE STRING "Default optimisation settings for Debug mode" )
else()
......@@ -78,7 +78,7 @@ else()
set( ATLAS_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
CACHE STRING "Default optimisation settings for RelWithDebInfo mode" )
set( ATLAS_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}"
CACHE STRING "Default optimisation settings for Release mode" )
CACHE STRING "Default optimisation settings for Debug mode" )
endif()
......
......@@ -141,16 +141,16 @@ function( atlas_add_dictionary libName libHeader libSelection )
string( REPLACE " " "_" typeSanitised ${typeSanitised} )
# Generate the header file:
configure_file( ${_dataLinkHeader}
${CMAKE_CURRENT_BINARY_DIR}/DataLink${typeSanitised}.h @ONLY )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DataLink${typeSanitised}.h @ONLY )
# Generate the selection file:
configure_file( ${_dataLinkSelection}
${CMAKE_CURRENT_BINARY_DIR}/DataLink${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DataLink${typeSanitised}_selection.xml
@ONLY )
# And now remember their names:
list( APPEND _headerComponents
${CMAKE_CURRENT_BINARY_DIR}/DataLink${typeSanitised}.h )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DataLink${typeSanitised}.h )
list( APPEND _selectionComponents
${CMAKE_CURRENT_BINARY_DIR}/DataLink${typeSanitised}_selection.xml )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DataLink${typeSanitised}_selection.xml )
endforeach()
# If the user asked for additional ElementLink<T> types to generate
......@@ -164,30 +164,30 @@ function( atlas_add_dictionary libName libHeader libSelection )
string( REPLACE " " "_" typeSanitised ${typeSanitised} )
# Generate the header files:
configure_file( ${_dataLinkHeader}
${CMAKE_CURRENT_BINARY_DIR}/DataLink${typeSanitised}.h @ONLY )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DataLink${typeSanitised}.h @ONLY )
configure_file( ${_elementLinkHeader}
${CMAKE_CURRENT_BINARY_DIR}/ElementLink${typeSanitised}.h @ONLY )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ElementLink${typeSanitised}.h @ONLY )
configure_file( ${_elementLinkVectorHeader}
${CMAKE_CURRENT_BINARY_DIR}/ElementLinkVector${typeSanitised}.h @ONLY )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ElementLinkVector${typeSanitised}.h @ONLY )
# Generate the selection file:
configure_file( ${_dataLinkSelection}
${CMAKE_CURRENT_BINARY_DIR}/DataLink${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DataLink${typeSanitised}_selection.xml
@ONLY )
configure_file( ${_elementLinkSelection}
${CMAKE_CURRENT_BINARY_DIR}/ElementLink${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ElementLink${typeSanitised}_selection.xml
@ONLY )
configure_file( ${_elementLinkVectorSelection}
${CMAKE_CURRENT_BINARY_DIR}/ElementLinkVector${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ElementLinkVector${typeSanitised}_selection.xml
@ONLY )
# And now remember their names:
list( APPEND _headerComponents
${CMAKE_CURRENT_BINARY_DIR}/DataLink${typeSanitised}.h
${CMAKE_CURRENT_BINARY_DIR}/ElementLink${typeSanitised}.h
${CMAKE_CURRENT_BINARY_DIR}/ElementLinkVector${typeSanitised}.h )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DataLink${typeSanitised}.h
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ElementLink${typeSanitised}.h
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ElementLinkVector${typeSanitised}.h )
list( APPEND _selectionComponents
${CMAKE_CURRENT_BINARY_DIR}/DataLink${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}/ElementLink${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}/ElementLinkVector${typeSanitised}_selection.xml )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DataLink${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ElementLink${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/ElementLinkVector${typeSanitised}_selection.xml )
endforeach()
# If the user asked for additional Navigable<T> types to generate dictionaries
......@@ -200,26 +200,31 @@ function( atlas_add_dictionary libName libHeader libSelection )
string( REPLACE " " "_" typeSanitised ${typeSanitised} )
# Generate the header file:
configure_file( ${_navigableHeader}
${CMAKE_CURRENT_BINARY_DIR}/Navigable${typeSanitised}.h @ONLY )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Navigable${typeSanitised}.h
@ONLY )
# Generate the selection file:
configure_file( ${_navigableSelection}
${CMAKE_CURRENT_BINARY_DIR}/Navigable${typeSanitised}_selection.xml
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Navigable${typeSanitised}_selection.xml
@ONLY )
# And now remember their names:
list( APPEND _headerComponents
${CMAKE_CURRENT_BINARY_DIR}/Navigable${typeSanitised}.h )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Navigable${typeSanitised}.h )
list( APPEND _selectionComponents
${CMAKE_CURRENT_BINARY_DIR}/Navigable${typeSanitised}_selection.xml )
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Navigable${typeSanitised}_selection.xml )
endforeach()
# Prepare the header file:
set( _dictHeader ${CMAKE_CURRENT_SOURCE_DIR}/${libHeader} )
set( _originalDictHeader )
if( _headerComponents )
# Remove the possible duplicates:
list( REMOVE_DUPLICATES _headerComponents )
# The name of the file to produce:
get_filename_component( _headerName ${libHeader} NAME )
set( _dictHeader ${CMAKE_CURRENT_BINARY_DIR}/${_headerName} )
set( _dictHeader
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_headerName} )
set( _originalDictHeader ORIGINAL_HEADER
${CMAKE_CURRENT_SOURCE_DIR}/${libHeader} )
unset( _headerName )
# Generate a text file with the names of the files to merge:
set( _listFileName
......@@ -245,7 +250,8 @@ function( atlas_add_dictionary libName libHeader libSelection )
list( REMOVE_DUPLICATES _selectionComponents )
# The name of the file to produce:
get_filename_component( _selectionName ${libSelection} NAME )
set( _dictSelection ${CMAKE_CURRENT_BINARY_DIR}/${_selectionName} )
set( _dictSelection
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_selectionName} )
unset( _selectionName )
# Describe how to produce this merged selection file:
add_custom_command( OUTPUT ${_dictSelection}
......@@ -280,7 +286,7 @@ function( atlas_add_dictionary libName libHeader libSelection )
HEADER ${_dictHeader} SELECTION ${_dictSelection}
LINK_LIBRARIES ${pkgName}Pkg ${ARG_LINK_LIBRARIES}
INCLUDE_DIRS ${ARG_INCLUDE_DIRS}
${_rootmapOpt} )
${_rootmapOpt} ${_originalDictHeader} )
# The library needs to be linked to the core ROOT libraries:
find_package( ROOT QUIET REQUIRED COMPONENTS Core )
......@@ -627,12 +633,14 @@ endfunction( atlas_add_root_dictionary )
# SELECTION <pkgName>/selection.xml
# [LINK_LIBRARIES Library1...]
# [INCLUDE_DIRS Include1...]
# [ORIGINAL_HEADER <header.h>]
# [NO_ROOTMAP_MERGE] )
#
function( atlas_generate_reflex_dictionary dictfile dictname )
# Parse all options:
cmake_parse_arguments( ARG "NO_ROOTMAP_MERGE" "HEADER;SELECTION"
cmake_parse_arguments( ARG "NO_ROOTMAP_MERGE"
"HEADER;SELECTION;ORIGINAL_HEADER"
"LINK_LIBRARIES;INCLUDE_DIRS" ${ARGN} )
# A security check:
......@@ -717,10 +725,20 @@ function( atlas_generate_reflex_dictionary dictfile dictname )
# The path to the genreflex executable:
set( genreflex ${ROOT_BINARY_PATH}/genreflex )
# The name of the generated dependency file:
set( depfile "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}" )
set( depfile "${depfile}/${dictname}ReflexDict.d" )
# The full command to generate the reflex dictionary:
set( cmd "set -e\n" )
set( cmd "${cmd}tmpdir=`mktemp -d make${dictname}ReflexDict.XXXXXX`\n" )
set( cmd "${cmd}cd \${tmpdir}\n" )
set( cmd "${cmd}${CMAKE_CXX_COMPILER} -I\"$<JOIN:${incdirs},\" -I\">\"" )
set( cmd "${cmd} -D$<JOIN:${definitions}, -D>" )
if( CMAKE_OSX_SYSROOT )
set( cmd "${cmd} -isysroot ${CMAKE_OSX_SYSROOT}" )
endif()
set( cmd "${cmd} -MM -MT ${rootmap_name} -MF ${dictname}.d ${ARG_HEADER}\n" )
set( cmd "${cmd}${genreflex} ${ARG_HEADER}" )
set( cmd "${cmd} -o ${dictname}ReflexDict.cxx" )
set( cmd "${cmd} --noIncludePaths" )
......@@ -737,6 +755,9 @@ function( atlas_generate_reflex_dictionary dictfile dictname )
set( cmd "${cmd}${CMAKE_COMMAND} -E copy" )
set( cmd "${cmd} ${CMAKE_SHARED_LIBRARY_PREFIX}${dictname}_rdict.pcm" )
set( cmd "${cmd} \"${pcm_name}\"\n" )
set( cmd "${cmd}${CMAKE_COMMAND} -E compare_files ${dictname}.d \"${depfile}\" ||" )
set( cmd "${cmd} ${CMAKE_COMMAND} -E copy ${dictname}.d" )
set( cmd "${cmd} \"${depfile}\"\n" )
# Generate a script that will run genreflex. This is necessary because
# there are some bugs currently (3.3.2) in how add_custom_command handles
......@@ -746,15 +767,29 @@ function( atlas_generate_reflex_dictionary dictfile dictname )
file( GENERATE OUTPUT ${scriptName}
CONTENT "${cmd}" )
# Extra arguments (for Ninja).
set( extraArgs )
if( "${CMAKE_GENERATOR}" STREQUAL "Ninja" )
set( extraArgs DEPFILE "${depfile}" )
endif()
# Extra implicit dependency, when the header was made during the build.
set( _extraImpDep )
if( ARG_ORIGINAL_HEADER )
set( _extraImpDep CXX ${ARG_ORIGINAL_HEADER} )
endif()
# Call the generated script to create the dictionary files:
add_custom_command( OUTPUT ${rootmap_name}
BYPRODUCTS ${dictsource} ${pcm_name}
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
COMMAND sh ${scriptName}
DEPENDS ${ARG_HEADER} ${ARG_SELECTION} ${pkgName}Pkg
IMPLICIT_DEPENDS CXX ${ARG_HEADER}
DEPENDS ${ARG_HEADER} ${ARG_ORIGINAL_HEADER} ${ARG_SELECTION}
${pkgName}Pkg
IMPLICIT_DEPENDS CXX ${ARG_HEADER} ${_extraImpDep}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}
${extraArgs}
COMMENT "Generating ${dictname}ReflexDict.cxx" )
set_property( SOURCE ${dictsource} ${pcm_name} ${rootmap_name}
PROPERTY LABELS ${pkgName} )
......@@ -764,7 +799,7 @@ function( atlas_generate_reflex_dictionary dictfile dictname )
set_property( TARGET ${dictname}DictGen PROPERTY LABELS ${pkgName} )
set_property( TARGET ${dictname}DictGen PROPERTY FOLDER ${pkgDir}/Internals )
# Set the INCLUDE_DIRECTORIS property on it. To allow the "implicit"
# Set the INCLUDE_DIRECTORIES property on it. To allow the "implicit"
# dependency generator code to find the headers referred to by the
# dictionary header.
set_property( TARGET ${dictname}DictGen
......
......@@ -13,6 +13,9 @@
# and even this should only be included if absolutely necessary.
#
# Minimum CMake version required:
cmake_minimum_required( VERSION 3.6 )
# Include the required module(s):
include( CMakeParseArguments )
include( ExternalProject )
......@@ -390,6 +393,7 @@ function( atlas_project name version )
set( ATLAS_PACKAGE_PRINTOUT_INTERVAL ${_interval}
CACHE STRING "Package counter printout interval" )
string( TIMESTAMP _timeStart "%s" )
# Include the packages:
set( _counter 0 )
set( _selectedPackages 0 )
......@@ -418,11 +422,17 @@ function( atlas_project name version )
list( APPEND _selectedPackageDirs ${_pkgDir} )
unset( _binDir )
endforeach()
string( TIMESTAMP _timeStop "%s" )
math( EXPR _timeSeconds "${_timeStop}-${_timeStart}" )
message( STATUS "Number of packages configured: ${_selectedPackages}" )
message( STATUS "Time for package configuration: ${_timeSeconds} seconds" )
unset( _counter )
unset( _doNotPrint )
unset( _isSelected )
unset( _selectedPackages )
unset( _timeStart )
unset( _timeStop )
unset( _timeSeconds )
# Check whether all rules from a possible package filter file were used:
atlas_print_unused_package_selection_rules()
......@@ -587,7 +597,6 @@ function( atlas_project name version )
unset( _version )
unset( _packagesFileName )
unset( _packageDirs )
unset( _selectedPackageDirs )
# Generate a compilers.txt file that list the types and versions of the
# compilers that were used to build this project.
......@@ -707,6 +716,40 @@ function( atlas_project name version )
unset( _packages_found )
unset( ENVFILE_GEN )
# Set up Doxygen.
set( ATLAS_DOXYFILE_INPUT "${CMAKE_SOURCE_DIR}/Doxyfile.in"
CACHE FILEPATH "Path to the Doxyfile that needs to be configured" )
find_package( Doxygen QUIET )
if( EXISTS "${ATLAS_DOXYFILE_INPUT}" AND DOXYGEN_FOUND )
# Tell the user what's happening.
message( STATUS "Setting up the 'doc' target using Doxygen" )
# Collect the paths of all selected packages.
set( SELECTED_PACKAGES )
foreach( _pkgDir ${_selectedPackageDirs} )
file( RELATIVE_PATH _srcDir "${CMAKE_BINARY_DIR}"
"${CMAKE_SOURCE_DIR}/${_pkgDir}" )
set( SELECTED_PACKAGES "${SELECTED_PACKAGES} ${_srcDir}" )
endforeach()
# Specialise the project-specific Doxyfile.
set( _doxyfile "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Doxyfile" )
configure_file( "${ATLAS_DOXYFILE_INPUT}" "${_doxyfile}" @ONLY )
# Set up the custom command for calling Doxygen.
add_custom_target( doc
${DOXYGEN_EXECUTABLE} "${_doxyfile}"
COMMENT "Generating Doxygen documentation"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" )
# Clean up.
unset( SELECTED_PACKAGES )
unset( _doxyfile )
endif()
# Clean up.
unset( _selectedPackageDirs )
# Add the CTest customisation file to the build tree:
find_file( _ctestCustom CTestCustom.cmake.in
PATH_SUFFIXES skeletons PATHS ${CMAKE_MODULE_PATH} )
......
......@@ -173,18 +173,18 @@ function( atlas_compiler_id compiler isValid )
# Translate the compiler ID:
set( _prefix )
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
set( _prefix "gcc" )
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
set( _prefix "clang" )
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Intel" )
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" )
set( _prefix "icc" )
else()
set( ${compiler} "unknown" PARENT_SCOPE )
set( ${isValid} FALSE PARENT_SCOPE )
return()
endif()
# Translate the compiler version:
set( _version )
if( CMAKE_CXX_COMPILER_VERSION MATCHES "^([0-9]+).([0-9]+).*"
......@@ -208,6 +208,13 @@ endfunction( atlas_compiler_id )
#
function( atlas_os_id os isValid )
# Return cached result if possible:
if ( ATLAS_OS_ID )
set( ${os} ${ATLAS_OS_ID} PARENT_SCOPE )
set( ${isValid} TRUE PARENT_SCOPE )
return()
endif()
set( _name )
if( APPLE )
# Set a default version in case the following should not work:
......@@ -277,7 +284,8 @@ function( atlas_os_id os isValid )
return()
endif()
# Set the return values:
# Set and cache the return values:
set( ATLAS_OS_ID "${_name}" CACHE INTERNAL "Compact platform name" )
set( ${os} ${_name} PARENT_SCOPE )
set( ${isValid} TRUE PARENT_SCOPE )
......@@ -1206,6 +1214,7 @@ endfunction( atlas_print_unused_package_selection_rules )
function( atlas_generate_releasedata )
# Set variables necessary for the ReleaseData generation:
unset( ENV{TZ} ) # Work around CMake bug #18431
string( TIMESTAMP CMAKE_BUILD_DATE "%Y-%m-%dT%H%M" )
if( "$ENV{NIGHTLY_NAME}" STREQUAL "" )
# Find the helper script generating the nightly name:
......
......@@ -45,6 +45,8 @@ if( DQM-COMMON_FOUND )
${DQM-COMMON_ROOT}/installed/$ENV{CMTCONFIG}/bin
${DQM-COMMON_ROOT}/installed/share/bin )
endif()
set( DQM-COMMON_ENVIRONMENT
SET TDAQ_RELEASE_BASE $ENV{TDAQ_RELEASE_BASE} )
endif()
# Add the RPM dependencies:
......
......@@ -50,7 +50,8 @@ if( TDAQ-COMMON_FOUND )
${TDAQ-COMMON_ROOT}/installed/share/bin )
endif()
set( TDAQ-COMMON_ENVIRONMENT
SET TDAQ_PYTHON_HOME ${PYTHONHOME} )
SET TDAQ_PYTHON_HOME ${PYTHONHOME}
SET TDAQ_RELEASE_BASE $ENV{TDAQ_RELEASE_BASE} )
endif()
# Add the RPM dependencies:
......
......@@ -56,7 +56,8 @@ if( TDAQ_FOUND )
SET TDAQ_DB_PATH ${TDAQ_ROOT}/installed/share/data
APPEND TDAQ_DB_PATH ${TDAQ_ROOT}/installed/databases
APPEND TDAQ_DB_PATH ${TDAQ_ROOT}/databases
SET TDAQ_VERSION ${TDAQ_VERSION} )
SET TDAQ_VERSION ${TDAQ_VERSION}
SET TDAQ_RELEASE_BASE $ENV{TDAQ_RELEASE_BASE} )
endif()
# When using tdaq, some macro definitions are made in the tdaq headers,
......
......@@ -6,3 +6,4 @@ nightly release:$ENV{PROJECT_RELNAME_COPY}
date:${CMAKE_BUILD_DATE}
compiler:$ENV{gcc_version}
cxxpath:$ENV{gcc_path}
cmake:${CMAKE_VERSION}
......@@ -34,11 +34,11 @@ function( lcg_compiler_id compiler isValid )
# Translate the compiler ID:
set( _prefix )
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
set( _prefix "gcc" )
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
set( _prefix "clang" )
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Intel" )
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" )
set( _prefix "icc" )
else()
set( ${compiler} "unknown" PARENT_SCOPE )
......@@ -69,6 +69,13 @@ endfunction( lcg_compiler_id )
#
function( lcg_os_id os isValid )
# Return cached result if possible:
if ( LCG_OS_ID )
set( ${os} ${LCG_OS_ID} PARENT_SCOPE )
set( ${isValid} TRUE PARENT_SCOPE )
return()
endif()
# Reset the result variable as a start:
set( _name )
......@@ -138,7 +145,8 @@ function( lcg_os_id os isValid )
return()
endif()
# Set the return values:
# Set and cache the return values:
set( LCG_OS_ID "${_name}" CACHE INTERNAL "Compact platform name" )
set( ${os} ${_name} PARENT_SCOPE )
set( ${isValid} TRUE PARENT_SCOPE )
......@@ -278,6 +286,8 @@ function( lcg_setup_packages lcgFile lcgReleaseDir )
list( APPEND _dependencies Pyquen )
elseif( "${CMAKE_MATCH_1}" STREQUAL "starlight" )
list( APPEND _dependencies Starlight )
elseif( "${CMAKE_MATCH_1}" STREQUAL "superchic" )
list( APPEND _dependencies Superchic )
elseif( "${CMAKE_MATCH_1}" STREQUAL "heputils" )
list( APPEND _dependencies HEPUtils )
elseif( "${CMAKE_MATCH_1}" STREQUAL "pythia6" )
......@@ -342,6 +352,11 @@ function( lcg_setup_release lcgReleaseDir )
set( LCG_COMPONENTS "externals;generators"
CACHE STRING "LCG components to set up" )
# Start out with the assumption that LCG is found:
set( LCG_FOUND TRUE CACHE BOOL
"Flag showing whether LCG was found or not" )
mark_as_advanced( LCG_FOUND )
# Set up the packages provided by LCG using the files specified:
foreach( _component ${LCG_COMPONENTS} )
......@@ -366,6 +381,11 @@ function( lcg_setup_release lcgReleaseDir )
endfunction( lcg_setup_release )
# Set ATLAS specific policies to work around temporary problems:
if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0" )
cmake_policy(SET CMP0074 OLD) # suppress warning about _ROOT variables (ATLINFR-2651)
endif()
# Only set up a release, if the requested release number was
# something other than 0.
if( NOT LCG_VERSION EQUAL 0 )
......@@ -397,13 +417,10 @@ if( NOT LCG_VERSION EQUAL 0 )
set( LCG_RELEASE_DIR ${LCG_RELEASE_BASE}/LCG_${LCG_VERSION}
CACHE PATH "Directory holding the LCG release" )
# Start out with the assumption that LCG is now found:
set( LCG_FOUND TRUE CACHE BOOL
"Flag showing whether LCG was found or not" )
mark_as_advanced( LCG_FOUND )
# Set up the release:
lcg_setup_release( ${LCG_RELEASE_DIR} )
if( NOT LCG_FOUND )
lcg_setup_release( ${LCG_RELEASE_DIR} )
endif()
# Extra setting(s) for some package(s):
file( GLOB BOOST_INCLUDEDIR "${BOOST_ROOT}/include/*" )
......@@ -430,6 +447,8 @@ if( NOT LCG_VERSION EQUAL 0 )
set( _path "${_path}:${LIBXML2_ROOT}" )
set( _path "${_path}:${PNG_ROOT}" )
set( _path "${_path}:${HDF5_ROOT}" )
set( _path "${_path}:${BLAS_ROOT}" )
set( _path "${_path}:${LAPACK_ROOT}" )
set( ENV{CMAKE_PREFIX_PATH} "$ENV{CMAKE_PREFIX_PATH}:${_path}" )
unset( _path )
......
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# Wrapper around CMake's built-in FindBLAS.cmake module. Making sure that
# the found include path and library directory are set up in a relocatable
# way.
#
# The LCG include(s):
include( LCGFunctions )
# Use the helper macro for the wrapping:
lcg_wrap_find_module( BLAS NO_LIBRARY_DIRS )
# Set up the RPM dependency:
lcg_need_rpm( blas )
......@@ -17,7 +17,8 @@ include( LCGFunctions )
lcg_external_module( NAME Herwig3
INCLUDE_SUFFIXES include
INCLUDE_NAMES Herwig/Analysis/EventShapes.h
LIBRARY_SUFFIXES lib/Herwig
Herwig/MatrixElement/HwMEBase.h
LIBRARY_SUFFIXES lib lib/Herwig
COMPULSORY_COMPONENTS Herwig.so )
# Handle the standard find_package arguments:
......
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# Wrapper around CMake's built-in FindLAPACK.cmake module. Making sure that
# the found include path and library directory are set up in a relocatable
# way.
#
# The LCG include(s):
include( LCGFunctions )
# Use the helper macro for the wrapping:
lcg_wrap_find_module( LAPACK NO_LIBRARY_DIRS )
# Set up the RPM dependency:
lcg_need_rpm( lapack )
......@@ -22,7 +22,15 @@ endif()
# Call CMake's own FindPythonInterp.cmake. Note that the arguments created
# for this script by CMake pass through to the official script. So we don't
# need to give any extra arguments to this call.
find_package( PythonInterp )
if( NOT PYTHON_EXECUTABLE )
find_package( PythonInterp )
# Persistify the variables set by the find module:
set( PYTHONINTERP_FOUND "${PYTHONINTERP_FOUND}" CACHE INTERNAL "Python interpreter found" )
set( PYTHON_VERSION_STRING "${PYTHON_VERSION_STRING}" CACHE INTERNAL "Python version" )
set( PYTHON_VERSION_MAJOR "${PYTHON_VERSION_MAJOR}" CACHE INTERNAL "Python major version" )
set( PYTHON_VERSION_MINOR "${PYTHON_VERSION_MINOR}" CACHE INTERNAL "Python minor version" )
set( PYTHON_VERSION_PATCH "${PYTHON_VERSION_PATCH}" CACHE INTERNAL "Python patch version" )
endif()
# Restore CMAKE_MODULE_PATH:
set( CMAKE_MODULE_PATH ${_modulePathBackup} )
......@@ -31,12 +39,19 @@ set( CMAKE_SYSTEM_IGNORE_PATH )
# Set some extra variable(s), to make the environment configuration easier:
if( PYTHON_EXECUTABLE )
get_filename_component( PythonInterp_BINARY_PATH ${PYTHON_EXECUTABLE} PATH )
execute_process( COMMAND
"${PYTHON_EXECUTABLE}" -c
"try: import sys; print( sys.prefix )\nexcept:pass\n"
OUTPUT_VARIABLE PYTHONHOME
OUTPUT_STRIP_TRAILING_WHITESPACE )
if( NOT PYTHONHOME )
get_filename_component( PythonInterp_BINARY_PATH ${PYTHON_EXECUTABLE}
PATH )
set( PythonInterp_BINARY_PATH "${PythonInterp_BINARY_PATH}" CACHE INTERNAL
"Python binary/executable path" )
execute_process( COMMAND
"${PYTHON_EXECUTABLE}" -c
"try: import sys; print( sys.prefix )\nexcept:pass\n"
OUTPUT_VARIABLE PYTHONHOME
OUTPUT_STRIP_TRAILING_WHITESPACE )
# Store PYTHONHOME in cache:
set( PYTHONHOME "${PYTHONHOME}" CACHE INTERNAL "PYTHONHOME" )
endif()
if( NOT "${PYTHONHOME}" STREQUAL "" )
set ( PythonInterp_ENVIRONMENT
FORCESET PYTHONHOME ${PYTHONHOME} )
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#
# Module finding Superchic in the LCG release. Defines:
# - SUPERCHIC_FOUND
# - SUPERCHIC_INCLUDE_DIR
# - SUPERCHIC_INCLUDE_DIRS
#
# Can be steered by SUPERCHIC_ROOT.
#
# The LCG include(s):
include( LCGFunctions )
# Declare the external module:
lcg_external_module( NAME Superchic
INCLUDE_NAMES obj/superchic.o
SEARCH_PATHS ${SUPERCHIC_ROOT} )
# Superchic just holds objects. So now set the correct variable for the
# proper environment setting:
set( SUPERCHIC_OBJ_PATH ${SUPERCHIC_INCLUDE_DIRS} )
# Handle the standard find_package arguments:
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Superchic DEFAULT_MSG SUPERCHIC_INCLUDE_DIR )
mark_as_advanced( SUPERCHIC_FOUND SUPERCHIC_INCLUDE_DIR SUPERCHIC_INCLUDE_DIRS )
# Set up the RPM dependency:
lcg_need_rpm( superchic FOUND_NAME SUPERCHIC )
# Set the SUPERCHICPATH environment variable:
if( SUPERCHIC_FOUND )
set( SUPERCHIC_ENVIRONMENT
FORCESET SUPERCHICPATH ${SUPERCHIC_ROOT} )
endif()
# Unset the include directories. They would just pollute the runtime
# environment.
unset( SUPERCHIC_INCLUDE_DIR )
unset( SUPERCHIC_INCLUDE_DIRS )
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#
# Defines:
#
# CPPGSL_FOUND
# CPPGSL_INCLUDE_DIR
# CPPGSL_INCLUDE_DIRS
#
# Can be steered by CPPGSL_ROOT.
#
# The LCG include(s):
include( LCGFunctions )
# Declare the external module:
lcg_external_module( NAME cppgsl
INCLUDE_SUFFIXES include
INCLUDE_NAMES gsl/gsl )
# Handle the standard find_package arguments:
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( cppgsl DEFAULT_MSG CPPGSL_INCLUDE_DIR )
mark_as_advanced( CPPGSL_FOUND CPPGSL_INCLUDE_DIR CPPGSL_INCLUDE_DIRS )
# Set up the RPM dependency:
lcg_need_rpm( cppgsl )
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# Sets:
# CYCLER_PYTHON_PATH
#
# Can be steered by CYCLER_ROOT.
#
# The LCG include(s):
include( LCGFunctions )
# Dependencies:
find_package( PythonLibs )
find_package( PythonInterp )
# If it was already found, let's be quiet:
if( CYCLER_FOUND )
set( cycler_FIND_QUIETLY TRUE )
endif()
# Ignore system paths when an LCG release was set up:
if( CYCLER_ROOT )
set( _extraClrArgs NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH )
endif()
# Find the python path:
find_path( CYCLER_PYTHON_PATH
NAMES cycler.py cycler/__init__.py
PATH_SUFFIXES lib/python2.7/site-packages
PATHS ${CYCLER_ROOT}
${_extraClrArgs} )
# Handle the standard find_package arguments:
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( cycler DEFAULT_MSG
CYCLER_PYTHON_PATH PYTHONLIBS_FOUND PYTHONINTERP_FOUND )
# Set up the RPM dependency:
lcg_need_rpm( cycler )
# Clean up:
if( _extraClrArgs )
unset( _extraClrArgs )
endif()
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# Sets:
# KIWISOLVER_PYTHON_PATH
#
# Can be steered by KIWISOLVER_ROOT.
#
# The LCG include(s):
include( LCGFunctions )
# Dependencies:
find_package( PythonLibs )
find_package( PythonInterp )
# If it was already found, let's be quiet:
if( KIWISOLVER_FOUND )
set( kiwisolver_FIND_QUIETLY TRUE )
endif()
# Ignore system paths when an LCG release was set up:
if( KIWISOLVER_ROOT )
set( _extraKslwArgs NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH )
endif()
# Find the python path:
find_path( KIWISOLVER_PYTHON_PATH
NAMES "kiwisolver${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATH_SUFFIXES lib/python2.7/site-packages
PATHS ${KIWISOLVER_ROOT}
${_extraKslwArgs} )
# Handle the standard find_package arguments:
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( kiwisolver DEFAULT_MSG
KIWISOLVER_PYTHON_PATH PYTHONLIBS_FOUND PYTHONINTERP_FOUND )
# Set up the RPM dependency:
lcg_need_rpm( kiwisolver )
# Clean up:
if( _extraKslwArgs )
unset( _extraKslwArgs )
endif()
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# Sets:
# PYANALYSIS_BINARY_PATH
......@@ -10,6 +10,12 @@
# The LCG include(s):
include( LCGFunctions )
# Dependencies:
find_package( PythonLibs )
find_package( PythonInterp )
find_package( kiwisolver )
find_package( cycler )
# If it was already found, let's be quiet:
if( PYANALYSIS_FOUND )
set( pyanalysis_FIND_QUIETLY TRUE )
......@@ -34,7 +40,8 @@ find_path( PYANALYSIS_PYTHON_PATH site.py numpy/__init__.py
# Handle the standard find_package arguments:
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( pyanalysis DEFAULT_MSG
PYANALYSIS_PYTHON_PATH PYANALYSIS_BINARY_PATH )
PYANALYSIS_PYTHON_PATH PYANALYSIS_BINARY_PATH
PYTHONLIBS_FOUND PYTHONINTERP_FOUND )
# Set up the RPM dependency:
lcg_need_rpm( pyanalysis )
......
......@@ -187,6 +187,14 @@ function( lcg_need_rpm name )
return()
endif()
# If an LCG release *is* set up, but it doesn't provide this external,
# then stop as well.
string( TOUPPER ${name} nameUpper )
if( NOT ${name}_ROOT AND NOT ${nameUpper}_ROOT )
return()
endif()
unset( nameUpper )
# Create the "found name" of the package:
if( ARG_FOUND_NAME )
set( nameFound ${ARG_FOUND_NAME} )
......