Skip to content
Snippets Groups Projects
Commit b4639e56 authored by Attila Krasznahorkay's avatar Attila Krasznahorkay
Browse files

Merge branch 'AnalysisBaseExternalsDevel_20170223' into 'master'

Fixes for the build of Python and Lhapdf for the analysis release

Python was installing incorrectly until now, breaking the SLC6 build of AnalysisBase.

The fix for the Lhapdf installation should just make the project a bit more robust. Allowing it to install everything else correctly if/when the build of Lhapdf breaks.

See merge request !1
parents 9a97676f ca338ddd
No related branches found
No related tags found
No related merge requests found
......@@ -8,54 +8,68 @@
set( _fileName
"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@/lhapdf-config" )
# Read in the generated configuration file:
file( READ ${_fileName} _content LIMIT 20000000 )
# Check if the file exists:
if( EXISTS ${_fileName} )
# Replace all occurences of the build directory with the installation path
# in the configuration file:
set( _outputContent )
foreach( _element ${_content} )
# Do the replacement:
string( REPLACE "@_buildDir@" "\${@CMAKE_PROJECT_NAME@_DIR}"
_newContent ${_element} )
# It's done like this to make it clear to CMake that the semicolon
# is to be kept in the string. And not to be used as a list separator.
if( _outputContent )
set( _outputContent "${_outputContent}\;${_newContent}" )
else()
set( _outputContent "${_newContent}" )
endif()
endforeach()
# Read in the generated configuration file:
file( READ ${_fileName} _content LIMIT 20000000 )
# Overwrite the original file:
file( WRITE ${_fileName} ${_outputContent} )
# Replace all occurences of the build directory with the installation path
# in the configuration file:
set( _outputContent )
foreach( _element ${_content} )
# Do the replacement:
string( REPLACE "@_buildDir@" "\${@CMAKE_PROJECT_NAME@_DIR}"
_newContent ${_element} )
# It's done like this to make it clear to CMake that the semicolon
# is to be kept in the string. And not to be used as a list separator.
if( _outputContent )
set( _outputContent "${_outputContent}\;${_newContent}" )
else()
set( _outputContent "${_newContent}" )
endif()
endforeach()
# Overwrite the original file:
file( WRITE ${_fileName} ${_outputContent} )
else()
message( WARNING "Didn't find file: ${_fileName}" )
endif()
# The second file to patch:
set( _fileName
"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@/lhapdf" )
# Read in the generated configuration file:
file( READ ${_fileName} _content LIMIT 20000000 )
# Check if the file exists:
if( EXISTS ${_fileName} )
# Read in the generated configuration file:
file( READ ${_fileName} _content LIMIT 20000000 )
# Replace all occurences of the build directory with the installation path
# in the configuration file:
set( _outputContent )
foreach( _element ${_content} )
# Do the replacement:
string( REGEX REPLACE "configured_datadir = '[^\n]*\n"
"configured_datadir = os.environ['@CMAKE_PROJECT_NAME@_DIR'] + '/share/LHAPDF'\n"
_newContent ${_element} )
# It's done like this to make it clear to CMake that the semicolon
# is to be kept in the string. And not to be used as a list separator.
if( _outputContent )
set( _outputContent "${_outputContent}\;${_newContent}" )
else()
set( _outputContent "${_newContent}" )
endif()
endforeach()
# Replace all occurences of the build directory with the installation path
# in the configuration file:
set( _outputContent )
foreach( _element ${_content} )
# Do the replacement:
string( REGEX REPLACE "configured_datadir = '[^\n]*\n"
"configured_datadir = os.environ['@CMAKE_PROJECT_NAME@_DIR'] + '/share/LHAPDF'\n"
_newContent ${_element} )
# It's done like this to make it clear to CMake that the semicolon
# is to be kept in the string. And not to be used as a list separator.
if( _outputContent )
set( _outputContent "${_outputContent}\;${_newContent}" )
else()
set( _outputContent "${_newContent}" )
endif()
endforeach()
# Overwrite the original file:
file( WRITE ${_fileName} ${_outputContent} )
# Overwrite the original file:
file( WRITE ${_fileName} ${_outputContent} )
else()
message( WARNING "Didn't find file: ${_fileName}" )
endif()
# Clean up:
unset( _fileName )
......
......@@ -46,5 +46,5 @@ ExternalProject_Add( Python
add_dependencies( Package_Python Python )
# Install Python:
install( DIRECTORY ${_buildDir}
install( DIRECTORY ${_buildDir}/
DESTINATION . USE_SOURCE_PERMISSIONS OPTIONAL )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment