diff --git a/Build/AtlasLCG/LCGConfig-version.cmake b/Build/AtlasLCG/LCGConfig-version.cmake index 9795667aa61212dec3f8a9513a45aa0dea253698..873dd461907340b2c4d0715f4576d4b5296e92ad 100644 --- a/Build/AtlasLCG/LCGConfig-version.cmake +++ b/Build/AtlasLCG/LCGConfig-version.cmake @@ -11,15 +11,19 @@ # # Set the LCG root directory: -if( NOT LCG_RELEASE_BASE ) - if( NOT "$ENV{LCG_RELEASE_BASE}" STREQUAL "" ) - set( LCG_RELEASE_BASE $ENV{LCG_RELEASE_BASE} CACHE - PATH "Directory holding LCG releases" ) - else() - set( LCG_RELEASE_BASE "/afs/cern.ch/sw/lcg/releases" CACHE - PATH "Directory holding LCG releases" ) - endif() +if( NOT "$ENV{LCG_NIGHTLY}" STREQUAL "" ) + set( LCG_RELEASE_BASE "/cvmfs/sft.cern.ch/lcg/nightlies" CACHE + PATH "Directory holding LCG nightlies" ) + set( LCG_NIGHTLY "$ENV{LCG_NIGHTLY}" CACHE STRING + "The LCG nightly to use for the build" ) +elseif( NOT "$ENV{LCG_RELEASE_BASE}" STREQUAL "" ) + set( LCG_RELEASE_BASE $ENV{LCG_RELEASE_BASE} CACHE + PATH "Directory holding LCG releases" ) +else() + set( LCG_RELEASE_BASE "/cvmfs/sft.cern.ch/lcg/releases" CACHE + PATH "Directory holding LCG releases" ) endif() + # Variable used by Gaudi: set( LCG_releases_base ${LCG_RELEASE_BASE} CACHE PATH "Directory holding LCG releases" FORCE ) @@ -30,6 +34,7 @@ if( PACKAGE_FIND_VERSION EQUAL 0 ) message( STATUS "Using the LCG modules without setting up a release" ) set( PACKAGE_VERSION 0 ) set( PACKAGE_VERSION_NUMBER 0 ) + set( PACKAGE_VERSION_STRING "" ) set( PACKAGE_VERSION_COMPATIBLE TRUE ) set( PACKAGE_VERSION_EXACT FALSE ) elseif( NOT PACKAGE_FIND_VERSION ) @@ -37,6 +42,7 @@ elseif( NOT PACKAGE_FIND_VERSION ) message( STATUS "No LCG version requested. Not setting up release." ) set( PACKAGE_VERSION 0 ) set( PACKAGE_VERSION_NUMBER 0 ) + set( PACKAGE_VERSION_STRING "" ) set( PACKAGE_VERSION_COMPATIBLE TRUE ) set( PACKAGE_VERSION_EXACT FALSE ) # If a directory with the requested version string exists, then we're @@ -45,6 +51,14 @@ elseif( EXISTS ${LCG_RELEASE_BASE}/LCG_${PACKAGE_FIND_VERSION}${LCG_VERSION_POSTFIX} ) set( PACKAGE_VERSION ${PACKAGE_FIND_VERSION}${LCG_VERSION_POSTFIX} ) set( PACKAGE_VERSION_NUMBER ${PACKAGE_FIND_VERSION} ) + set( PACKAGE_VERSION_STRING "LCG_${PACKAGE_VERSION}" ) + set( PACKAGE_VERSION_COMPATIBLE TRUE ) + set( PACKAGE_VERSION_EXACT TRUE ) +# If a nightly was requested: +elseif( EXISTS ${LCG_RELEASE_BASE}/${LCG_NIGHTLY} ) + set( PACKAGE_VERSION ${LCG_NIGHTLY} ) + set( PACKAGE_VERSION_NUMBER ${PACKAGE_FIND_VERSION} ) + set( PACKAGE_VERSION_STRING "${PACKAGE_VERSION}" ) set( PACKAGE_VERSION_COMPATIBLE TRUE ) set( PACKAGE_VERSION_EXACT TRUE ) else() @@ -52,12 +66,13 @@ else() # newer than the one requested. message( WARNING "Can't find the requested LCG version. " "Falling back to LCG_84." ) - set( PACKAGE_VERSION "84" ) + set( PACKAGE_VERSION 84 ) set( PACKAGE_VERSION_NUMBER ${PACKAGE_VERSION} ) - if( "${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set( PACKAGE_VERSION_STRING "LCG_${PACKAGE_VERSION}" ) + if( "${PACKAGE_VERSION_NUMBER}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) set( PACKAGE_VERSION_COMPATIBLE FALSE ) else() - # Apparently the latest release will work... + # Apparently this release will work... set( PACKAGE_VERSION_COMPATIBLE TRUE ) set( PACKAGE_VERSION_EXACT FALSE ) endif() @@ -70,6 +85,8 @@ set( LCG_VERSION_NUMBER ${PACKAGE_VERSION_NUMBER} CACHE STRING "LCG version (just the number) used" FORCE ) set( LCG_VERSION_POSTFIX ${LCG_VERSION_POSTFIX} CACHE STRING "LCG version postfix used" FORCE ) +set( LCG_VERSION_STRING ${PACKAGE_VERSION_STRING} + CACHE STRING "LCG directory name to use" FORCE ) # Mark all these cache variables as advanced options: mark_as_advanced( LCG_releases_base LCG_VERSION LCG_VERSION_NUMBER diff --git a/Build/AtlasLCG/LCGConfig.cmake b/Build/AtlasLCG/LCGConfig.cmake index 70eb11f39c27dabc1b719ad3c89f152c57490249..2272cac46b5523efddc011e7a5c519425adf4b6a 100644 --- a/Build/AtlasLCG/LCGConfig.cmake +++ b/Build/AtlasLCG/LCGConfig.cmake @@ -367,7 +367,7 @@ if( NOT LCG_VERSION EQUAL 0 ) # Tell the user what's happening: if( NOT LCG_FIND_QUIETLY ) message( STATUS - "Setting up LCG release \"${LCG_VERSION}\" for platform: " + "Setting up LCG release \"${LCG_VERSION_STRING}\" for platform: " "${LCG_PLATFORM}" ) endif() @@ -378,7 +378,7 @@ if( NOT LCG_VERSION EQUAL 0 ) endif() # Construct the path to pick up the release from: - set( LCG_RELEASE_DIR ${LCG_RELEASE_BASE}/LCG_${LCG_VERSION} + set( LCG_RELEASE_DIR ${LCG_RELEASE_BASE}/${LCG_VERSION_STRING} CACHE PATH "Directory holding the LCG release" ) # Start out with the assumption that LCG is now found: diff --git a/Build/AtlasLCG/modules/LCGFunctions.cmake b/Build/AtlasLCG/modules/LCGFunctions.cmake index ca8ee0f90dcc72bf6d81486c1679cf5375b5185e..d83d025c09fc85af4e54a27adbf15b59d587c52e 100644 --- a/Build/AtlasLCG/modules/LCGFunctions.cmake +++ b/Build/AtlasLCG/modules/LCGFunctions.cmake @@ -491,6 +491,13 @@ function( lcg_generate_env ) " export LCG_PLATFORM=${LCG_PLATFORM}\n" "fi\n" ) endif() + # Set the LCG_NIGHTLY variable if necessary: + if( LCG_NIGHTLY ) + file( APPEND ${ARG_SH_FILE}.in + "if [ -z \"\${LCG_NIGHTLY}\" ]; then\n" + " export LCG_NIGHTLY=${LCG_NIGHTLY}\n" + "fi\n" ) + endif() # List of configured environment variables: set( _envVarNamesAndValues ) @@ -643,6 +650,13 @@ function( lcg_generate_env ) " setenv LCG_PLATFORM ${LCG_PLATFORM}\n" "endif\n" ) endif() + # Set LCG_NIGHTLY if necessary: + if( LCG_NIGHTLY ) + file( APPEND ${ARG_CSH_FILE}.in + "if (! \$?LCG_NIGHTLY ) then\n" + " setenv LCG_NIGHTLY ${LCG_NIGHTLY}\n" + "endif\n" ) + endif() # List of configured environment variables: set( _envVarNamesAndValues ) @@ -796,6 +810,12 @@ function( lcg_generate_env ) " <env:default variable=\"LCG_PLATFORM\">" "${LCG_PLATFORM}</env:default>\n" ) endif() + # Set LCG_NIGHTLY if necessary: + if( LCG_NIGHTLY ) + file( APPEND ${ARG_XENV_FILE}.in + " <env:default variable=\"LCG_NIGHTLY\">" + "${LCG_NIGHTLY}</env:default>\n" ) + endif() # Set the general environment variables: set( _envCopy ${_environments} )