-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (23 loc) · 857 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
26
27
28
29
30
31
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(bundle_adjustment LANGUAGES CXX CUDA)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Set CUDA standard
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
# Add cuda
enable_language(CUDA)
find_package(CUDA REQUIRED)
set( CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "-lcuda -lcudart --ptxas-options=-v" )
#include direcotries from CUDA and Thrust
include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/src)
set(CUDA_ARCHITECTURES 89)
set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCHITECTURES})
# Add source files in the 'src' directory
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.cu")
# Define the executable
cuda_add_executable(${PROJECT_NAME} ${SOURCES})
# Link libraries
target_link_libraries(${PROJECT_NAME} ${CUDA_LIBRARIES})