Commit 1cdedf70 authored by PRUVOST Florent's avatar PRUVOST Florent

replace libs in CUDA_LIBRARIES with absolute paths

parent 4ee7b8b5
......@@ -408,7 +408,24 @@ if(NOT CHAMELEON_SIMULATION)
if (CHAMELEON_USE_CUDA)
find_package(CUDA REQUIRED)
if( CUDA_FOUND )
if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
elseif(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
string(REGEX REPLACE "-l" "" CUDA_LIBS "${CUDA_LIBRARIES}")
set(CUDA_LIBRARIES)
foreach(_lib ${CUDA_LIBS})
find_library(CUDA_${_lib}_LIBRARY NAMES ${_lib}
HINTS $ENV{CUDA_ROOT}/lib64 ${_lib_env} ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (CUDA_${_lib}_LIBRARY)
list(APPEND CUDA_LIBRARIES ${CUDA_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
if (CUDA_FOUND)
message("-- ${Blue}Add definition CHAMELEON_USE_CUDA"
" - Activate CUDA in Chameleon${ColourReset}")
......
Markdown is supported
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