Commit c038a085 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Replace absolute COOL paths by relative paths below COOLSYS (CORALCOOL-2829).

Move COOLSYS handling from CoralTest to CORALEnvironmentHandling.cmake.


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@19865 4525493e-7705-40b1-a816-d608a930855b
parent 748ad41b
......@@ -270,9 +270,6 @@ macro(_env_line cmd var val output)
endif()
endmacro()
include(CMakeParseArguments)
#-------------------------------------------------------------------------------
# _coral_write_env_conf(filename [ROOT_VARS var1 var2...] <env>)
#
......@@ -282,6 +279,7 @@ include(CMakeParseArguments)
# The variable names passed to ROOT_VARS are used to allow relocation of the
# resulting environment.
#-------------------------------------------------------------------------------
include(CMakeParseArguments)
function(_coral_write_env_conf filename)
cmake_parse_arguments(ARG "" "" "ROOT_VARS" ${ARGN})
......@@ -289,6 +287,7 @@ function(_coral_write_env_conf filename)
<env:config xmlns:env=\"EnvSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"EnvSchema EnvSchema.xsd \">\n")
# variables that need to be used to make the environment relative
set(root_vars ${ARG_ROOT_VARS}) # needed by _env_line (CORALCOOL-2829)
foreach(root_var ${ARG_ROOT_VARS})
set(data "${data} <env:default variable=\"${root_var}\">${${root_var}}</env:default>\n")
endforeach()
......@@ -311,11 +310,15 @@ function(_coral_write_env_conf filename)
file(WRITE ${filename} "${data}")
endfunction()
#-------------------------------------------------------------------------------
# Generate environment configuration files
# Replace CORALSYS/COOLSYS to ensure relocatability (CORALCOOL-2829)
#-------------------------------------------------------------------------------
function(coral_generate_env_conf)
get_property(_build_env GLOBAL PROPERTY CORAL_BUILD_ENVIRONMENT)
get_property(_release_env GLOBAL PROPERTY CORAL_RELEASE_ENVIRONMENT)
_coral_write_env_conf(${env_build_xml} ${_build_env})
_coral_write_env_conf(${env_release_xml} ${_release_env})
set(${CMAKE_PROJECT_NAME}SYS ${CMAKE_BINARY_DIR}) # local and child scope
_coral_write_env_conf(${env_build_xml} ${_build_env} ROOT_VARS ${CMAKE_PROJECT_NAME}SYS)
set(${CMAKE_PROJECT_NAME}SYS ${CMAKE_INSTALL_PREFIX}) # local and child scope
_coral_write_env_conf(${env_release_xml} ${_release_env} ROOT_VARS ${CMAKE_PROJECT_NAME}SYS)
endfunction()
......@@ -74,8 +74,9 @@ coral_build_env(PACKAGE QMTest SET QMTEST_CLASS_PATH ${CMAKE_BINARY_DIR}/CoolTes
coral_release_env(PACKAGE QMTest SET QMTEST_CLASS_PATH ${CMAKE_INSTALL_PREFIX}/CoolTest/qmtest)
# These are used within qmtest for logging (and configuring tests if needed)
coral_build_env(SET COOLSYS ${CMAKE_BINARY_DIR})
coral_release_env(SET COOLSYS ${CMAKE_INSTALL_PREFIX})
# [Moved to CORALEnvironmentHandling.cmake for relocatability (CORALCOOL-2829)]
###coral_build_env(SET COOLSYS ${CMAKE_BINARY_DIR})
###coral_release_env(SET COOLSYS ${CMAKE_INSTALL_PREFIX})
get_filename_component(CORALSYS ${CORAL_LIBRARY_DIRS} PATH)
coral_build_and_release_env(SET CORALSYS ${CORALSYS})
......
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