Commit 0962f47f authored by Marco Clemencic's avatar Marco Clemencic
Browse files

propagate custom (external) and project env to user projects

parent 1ecce7a4
......@@ -1179,6 +1179,7 @@ macro(gaudi_generate_project_platform_config_file)
get_property(linker_libraries GLOBAL PROPERTY LINKER_LIBRARIES)
get_property(component_libraries GLOBAL PROPERTY COMPONENT_LIBRARIES)
string(REPLACE "\$" "\\\$" project_environment_string "${project_environment}")
set(filename ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}PlatformConfig.cmake)
file(WRITE ${filename}
"# File automatically generated: DO NOT EDIT.
......@@ -1202,6 +1203,8 @@ endif()
set(${CMAKE_PROJECT_NAME}_COMPONENT_LIBRARIES ${component_libraries})
set(${CMAKE_PROJECT_NAME}_LINKER_LIBRARIES ${linker_libraries})
set(${CMAKE_PROJECT_NAME}_ENVIRONMENT ${project_environment_string})
set(${CMAKE_PROJECT_NAME}_EXPORTED_SUBDIRS)
foreach(p ${packages})
get_filename_component(pn \${p} NAME)
......@@ -1273,9 +1276,9 @@ function(gaudi_generate_env_conf filename)
set(data "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<env:config xmlns:env=\"EnvSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"EnvSchema EnvSchema.xsd \">\n")
set(commands ${ARGN})
# message(STATUS "start - ${commands}")
#message(STATUS "start - ${commands}")
while(commands)
# message(STATUS "iter - ${commands}")
#message(STATUS "iter - ${commands}")
_env_conf_pop_instruction(instr commands)
# ensure that the variables in the value are not expanded when passing the arguments
string(REPLACE "\$" "\\\$" instr "${instr}")
......@@ -1341,7 +1344,7 @@ macro(gaudi_external_project_environment)
# Remove system libraries from the library_path
list(REMOVE_ITEM library_path /usr/lib /lib /usr/lib64 /lib64 /usr/lib32 /lib32)
foreach(var library_path python_path binary_path environment)
foreach(var library_path python_path binary_path)
if(${var})
list(REMOVE_DUPLICATES ${var})
endif()
......@@ -1359,6 +1362,8 @@ macro(gaudi_external_project_environment)
set(project_environment ${project_environment} PREPEND LD_LIBRARY_PATH ${val})
endforeach()
set(project_environment ${project_environment} ${environment})
endmacro()
#-------------------------------------------------------------------------------
......
......@@ -39,7 +39,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(QMTest DEFAULT_MSG QMTEST_EXECUTABLE QMTEST_PY
mark_as_advanced(QMTEST_EXECUTABLE QMTEST_PYTHON_PATH)
set(QMTEST_ENVIRONMENT QM_home=${QMTEST_PREFIX_PATH})
set(QMTEST_ENVIRONMENT SET QM_home ${QMTEST_PREFIX_PATH})
if(WIN32)
set(QMTEST_LIBRARY_PATH ${QMTEST_PREFIX_PATH}/Lib/site-packages/pywin32_system32)
......
......@@ -192,7 +192,7 @@ macro (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN)
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
endmacro (ROOT_GENERATE_DICTIONARY)
set(ROOT_ENVIRONMENT ROOTSYS=${ROOTSYS})
set(ROOT_ENVIRONMENT SET ROOTSYS ${ROOTSYS})
set(ROOT_BINARY_PATH ${ROOTSYS}/bin)
if(WIN32)
......
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