Commit da166692 authored by PRUVOST Florent's avatar PRUVOST Florent

use the morse macro to do that

parent 99c1011f
......@@ -258,17 +258,9 @@ set(CHAMELEON_DEP "")
# ------------------------
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
list(APPEND EXTRA_LIBRARIES ${THREADS_${_lib}_LIBRARY})
if( THREADS_FOUND AND CMAKE_THREAD_LIBS_INIT )
libraries_absolute_path(CMAKE_THREAD_LIBS_INIT "")
list(APPEND EXTRA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif ()
# Add math library to the list of extra
......@@ -408,27 +400,10 @@ 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}")
libraries_absolute_path(CUDA_LIBRARIES "$ENV{CUDA_ROOT}/lib64")
set(EXTRA_LIBRARIES_CUDA)
set(CHAMELEON_USE_CUDA 1)
if(CUDA_VERSION VERSION_LESS "3.0")
......
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