Skip to content

Commit

Permalink
Preserve LD_LIBRARY_PATH entries (#16)
Browse files Browse the repository at this point in the history
* Reapply "Set LD_LIBRARY_PATH and ROOT_INCLUDE_PATH within CheckClassVersion (#15)"

This reverts commit edc0b1d.

* Preserve existing LD_LIBRARY_PATH entries.

* Use simpler string concatenation.

Co-authored-by: Chris Green <[email protected]>

* Accommodate macOS systems.

* Correctly account for macOS systems.

---------

Co-authored-by: Chris Green <[email protected]>
  • Loading branch information
knoepfel and greenc-FNAL authored Nov 27, 2023
1 parent 61cee84 commit dd3fcb2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Modules/CheckClassVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ function(check_class_version)
list(APPEND CMD_ENV "${ev}=$ENV{${ev}}")
endif()
endforeach()
if (TARGET ${dictname}_dict)
set(LD_PATH_FOR_DICT "$<JOIN:$<TARGET_PROPERTY:${dictname}_dict,LINK_DIRECTORIES>,:>")
if (APPLE)
set(DY DY)
else()
set(DY)
endif()
string(JOIN ":" LD_PATH_FOR_DICT "${LD_PATH_FOR_DICT}" $ENV{${DY}LD_LIBRARY_PATH})
list(APPEND CMD_ENV "${DY}LD_LIBRARY_PATH=${LD_PATH_FOR_DICT}")
list(APPEND CMD_ENV "ROOT_INCLUDE_PATH=$<JOIN:$<TARGET_PROPERTY:${dictname}_dict,INCLUDE_DIRECTORIES>,:>")
endif()
# Add the check to the end of the dictionary building step.
add_custom_command(OUTPUT ${dictname}_dict_checked
COMMAND ${CMAKE_COMMAND} -E env ${CMD_ENV} ${CCV_ENVIRONMENT}
Expand Down

0 comments on commit dd3fcb2

Please sign in to comment.