-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
25 lines (19 loc) · 882 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cmake_minimum_required (VERSION 3.5)
project(dimreduce4gpu)
find_package(OpenMP)
find_package(CUDA QUIET REQUIRED)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};--expt-extended-lambda;")
include_directories(include)
file(GLOB_RECURSE SOURCES "src/*" "include/*")
#Set library output directories
if(MSVC)
#With MSVC shared library is considered runtime
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/lib)
else()
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-Xcompiler -fPIC; -std=c++14")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR})
endif()
cuda_add_library(dimreduce4gpu SHARED ${SOURCES})
target_link_libraries(dimreduce4gpu ${CUDA_CUBLAS_LIBRARIES} ${CUDA_cusolver_LIBRARY} ${CUDA_cusparse_LIBRARY})