-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
41 lines (32 loc) · 1.2 KB
/
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
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.15)
project(imgRCC LANGUAGES CXX CUDA)
# Include common configuration
include(${CMAKE_SOURCE_DIR}/cmake/CommonConfig.cmake)
# Include CUDA-specific configuration
include(${CMAKE_SOURCE_DIR}/cmake/CudaConfig.cmake)
# Add source files (C++ and CUDA files)
set(SOURCE_FILES
src/cpp/common.cpp
src/cpp/image.cpp
src/cuda/image.cu
src/cpp/algorithms_cpu.cpp
src/cuda/algorithms_gpu.cu
src/cpp/common.cpp
src/cuda/common.cu
)
# Add a library target for the project (C++/CUDA integration)
add_library(img_rcc STATIC ${SOURCE_FILES})
# Link the CUDA libraries to the img_rcc target
target_link_libraries(img_rcc ${CUDA_LIBRARIES})
# Add the benchmark executable
add_executable(img_rcc_benchmark benchmarks/benchmark_gpu.cpp)
# Link the benchmark executable to the img_rcc library and CUDA
target_link_libraries(img_rcc_benchmark img_rcc ${CUDA_LIBRARIES})
# Only build the benchmark executable in Benchmark mode
if(CMAKE_BUILD_TYPE STREQUAL "Benchmark")
add_dependencies(img_rcc_benchmark img_rcc)
endif()
# Set output directories for the benchmark executable
set_target_properties(img_rcc_benchmark PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)