Skip to content

Commit

Permalink
Fix : take the folder name instead of a full path filename
Browse files Browse the repository at this point in the history
  • Loading branch information
lanierd-adsk committed Feb 21, 2024
1 parent 98f661a commit 3c50e94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ set(MAYA_USD_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if(MayaUsd_FOUND)
if(IS_MACOSX OR IS_LINUX)
#When MayaUsd_FOUND is true, MAYAUSDAPI_LIBRARY exists as it is required.
#So add MAYAUSDAPI_LIBRARY (the path where maya USD library files are) to the ADDITIONAL_LD_LIBRARY_PATH which is used to run the tests
#MAYAUSDAPI_LIBRARY is the full path name of the maya USD API shared library, so get only its directory into MAYAUSDAPI_LIBRARY_PATH
get_filename_component(MAYAUSDAPI_LIBRARY_PATH "${MAYAUSDAPI_LIBRARY}" DIRECTORY)

#So add MAYAUSDAPI_LIBRARY_PATH to the ADDITIONAL_LD_LIBRARY_PATH which is used to run the tests
set(CURRENT_ADDITIONAL_LD_LIBRARY_PATH $ENV{ADDITIONAL_LD_LIBRARY_PATH})
set(ADDITIONAL_LD_LIBRARY_PATH "${CURRENT_ADDITIONAL_LD_LIBRARY_PATH}:${MAYAUSDAPI_LIBRARY}")
set(ADDITIONAL_LD_LIBRARY_PATH "${CURRENT_ADDITIONAL_LD_LIBRARY_PATH}:${MAYAUSDAPI_LIBRARY_PATH}")
# Export the new value to the environment
set(ENV{ADDITIONAL_LD_LIBRARY_PATH} ${ADDITIONAL_LD_LIBRARY_PATH})
message(STATUS "ADDITIONAL_LD_LIBRARY_PATH is now : ${ADDITIONAL_LD_LIBRARY_PATH}")
Expand Down

0 comments on commit 3c50e94

Please sign in to comment.