Commit 42f6e264 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Fix CORALCOOL-2926 on Mac


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@20111 4525493e-7705-40b1-a816-d608a930855b
parent 6fb082c2
......@@ -108,14 +108,10 @@ function(_env_package pack output)
endif()
string(TOUPPER ${pack} _pack_upper)
if(${_pack_upper}_EXECUTABLE)
get_filename_component(bin_path ${${_pack_upper}_EXECUTABLE} PATH)
list(APPEND _env PREPEND PATH ${bin_path}) # All packages including Python
endif()
if(${_pack_upper}_EXECUTABLE AND NOT ${_pack_upper}_BINARY_PATH)
get_filename_component(${_pack_upper}_BINARY_PATH ${${_pack_upper}_EXECUTABLE} PATH)
endif()
if(${_pack_upper}_BINARY_PATH)
get_filename_component(prefix_path ${${_pack_upper}_BINARY_PATH} PATH)
find_path(${_pack_upper}_MANPATH NAMES man1 man3 HINTS ${prefix_path}/man ${prefix_path}/share/man NO_DEFAULT_PATH)
......@@ -123,6 +119,7 @@ function(_env_package pack output)
list(APPEND _env PREPEND MANPATH ${${_pack_upper}_MANPATH})
endif()
endif()
if(${_pack_upper}_INCLUDE_DIR)
get_filename_component(prefix_path ${${_pack_upper}_INCLUDE_DIR} PATH)
find_path(${_pack_upper}_MANPATH NAMES man1 man3 HINTS ${prefix_path}/man ${prefix_path}/share/man NO_DEFAULT_PATH)
......@@ -144,8 +141,17 @@ function(_env_package pack output)
set(python_path ${${pack}_PYTHON_PATH} ${${_pack_upper}_PYTHON_PATH})
set(environment ${${pack}_ENVIRONMENT} ${${_pack_upper}_ENVIRONMENT})
set(library_path2 ${${pack}_LIBRARY_DIR} ${${pack}_LIBRARY_DIRS}
${${_pack_upper}_LIBRARY_DIR} ${${_pack_upper}_LIBRARY_DIRS})
# use also the libraries variable
${${_pack_upper}_LIBRARY_DIR}
${${_pack_upper}_LIBRARY_DIRS})
# Add _EXECUTABLE path to PATH for all packages including Python
if(${_pack_upper}_EXECUTABLE)
get_filename_component(bin_path ${${_pack_upper}_EXECUTABLE} PATH)
###list(APPEND _env PREPEND PATH ${bin_path}) # Not ok for sqlite on Mac
set(binary_path ${bin_path} ${binary_path}) # Fix CORALCOOL-2926 on Mac
endif()
# Use also the _LIBRARIES variable
foreach(_lib ${${pack}_LIBRARIES} ${${_pack_upper}_LIBRARIES})
if(EXISTS ${_lib})
get_filename_component(_lib ${_lib} PATH)
......@@ -153,6 +159,7 @@ function(_env_package pack output)
endif()
endforeach()
# Concatenate the two library paths (?)
set(library_path ${library_path} ${library_path2})
# Remove system directories from the library_path
......@@ -171,7 +178,10 @@ function(_env_package pack output)
set(binary_path)
foreach(d ${old_binary_path})
if(NOT d MATCHES "^(/usr|/usr/local)?/(s)?bin")
###message(STATUS "NOMATCH ${d}") # debug CORALCOOL-2926
set(binary_path ${binary_path} ${d})
else()
###message(STATUS "MATCH ${d}") # debug CORALCOOL-2926
endif()
endforeach()
......@@ -313,7 +323,7 @@ function(_coral_write_env_conf filename)
foreach(root_var ${root_vars})
get_filename_component(_path ${${root_var}} REALPATH) # see CORALCOOL-2836 and CORALCOOL-2876
set(data "${data} <env:default variable=\"${root_var}\">${_path}</env:default>\n")
set(data "${data} <env:default variable=\"${root_var}\">${_path}</env:default>\n")
endforeach()
set(commands ${ARG_UNPARSED_ARGUMENTS})
......
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