-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
38 lines (30 loc) · 1.14 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.11)
SET(VCPKG_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/Simulator/Thirdparty/vcpkg)
SET(CMAKE_TOOLCHAIN_FILE ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake CACHE FILEPATH "" FORCE)
PROJECT(VT-Physics)
ENABLE_LANGUAGE(CXX CUDA)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_C_STANDARD 17)
SET(CMAKE_CUDA_ARCHITECTURES 80)
IF (MSVC)
SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=/utf-8")
ENDIF ()
SET(VP_SOURCE_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
SET(VP_SIMULATOR_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/Simulator)
SET(VP_RUNTIME_ROOT ${VP_SIMULATOR_ROOT}/Runtime)
SET(VP_TEMPLATES_ROOT ${VP_SIMULATOR_ROOT}/Templates)
SET(VP_3RD_ROOT ${VP_SIMULATOR_ROOT}/Thirdparty)
SET(VP_LIB_ROOT ${VP_SIMULATOR_ROOT}/Library)
SET(VP_CONFIG_ROOT ${VP_SOURCE_ROOT}/ConfigTemplates)
FIND_PACKAGE(OpenMP REQUIRED)
IF (OpenMP_CXX_FOUND)
ADD_DEFINITIONS(-DVP_TURN_ON_OMP)
IF (MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp")
ELSE ()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF ()
ENDIF ()
#===================================== Build Components.
ADD_SUBDIRECTORY(Simulator)
ADD_SUBDIRECTORY(Examples)