Commit 73a62810 authored by will buttinger's avatar will buttinger
Browse files

use REALPATH mode

parent 6102ecd1
Pipeline #3059255 passed with stage
in 0 seconds
......@@ -63,19 +63,13 @@ if( Python_EXECUTABLE )
# Derive PYTHONHOME and cache.
if( NOT PYTHONHOME )
execute_process( COMMAND
"${CMAKE_COMMAND}" -E env
LD_LIBRARY_PATH=${Python_LIBRARY_DIRS}:$ENV{LD_LIBRARY_PATH}
DYLD_LIBRARY_PATH=${Python_LIBRARY_DIRS}:$ENV{DYLD_LIBRARY_PATH}
"${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()
# Python_EXECUTABLE may be a symlink, so use REALPATH to resolve before
# obtaining path
get_filename_component( _realPath ${Python_EXECUTABLE} REALPATH )
get_filename_component( _realBinDir ${_realPath} DIRECTORY )
get_filename_component( PYTHONHOME ${_realBinDir}/../ ABSOLUTE )
set( PYTHONHOME "${PYTHONHOME}" CACHE INTERNAL "PYTHONHOME" )
if( NOT "${PYTHONHOME}" STREQUAL "" AND NOT GAUDI_ATLAS )
set ( Python_ENVIRONMENT FORCESET PYTHONHOME ${PYTHONHOME} )
endif()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment