-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (35 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
42
43
44
45
46
cmake_minimum_required(VERSION 3.10)
# set project name
project(FluenceGUI VERSION 1.0
DESCRIPTION "Towards a GUI for Monte Carlo simulations"
LANGUAGES CUDA CXX)
# prepare for cuda compilation
enable_language(CUDA)
find_package(CUDA REQUIRED QUIET)
INCLUDE(FindCUDA)
INCLUDE_DIRECTORIES(/opt/cuda/include include)
set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON )
# set(CMAKE_CUDA_FLAGS "${CUDA_CUDA_FLAGS} -rdc=true -ftz=false -prec-div=true -prec-sqrt=true")
set(CMAKE_CUDA_FLAGS "${CUDA_CUDA_FLAGS} -rdc=true -Xptxas -v -O2")
set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-x cu -rdc=true -ftz=false -prec-div=true -prec-sqrt=true -g
)
add_subdirectory(src/)
add_subdirectory(lib/)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(OpenGL_GL_PREFERENCE GLVND)
cmake_policy(SET CMP0079 NEW)
# add_compile_options("-g3 -ggdb")
find_library(TERM_LIB curses)
add_executable(main_exp src/main.cu)
set_property(TARGET main_exp PROPERTY CUDA_SEPARABLE_COMPILATION ON)
set_property(TARGET main_exp PROPERTY CUDA_ARCHITECTURES 50 75 86)
target_link_libraries(main_exp PUBLIC
MC
Interface)
install(TARGETS main_exp DESTINATION bin)