-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
84 lines (70 loc) · 2.22 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(CUASTAR VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
option(BUILD_TESTS "Building CXX or CUDA Tests" ON)
option(BUILD_EXEMPLES "Building CXX or CUDA Exemples " OFF)
option(BUILD_DOCS "Build documentation or not" OFF)
option(USE_CUDA "Building with CUDA Support " ON)
option(USE_VTK "Building with VTK Support " OFF)
option(USE_CPM "Whether to use CPM." OFF)
option(USE_CONAN "Whether to use Conan." OFF)
option(USE_VCPKG "Whether to use VCPKG." OFF)
if(USE_CPM)
file(
DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.38.3/CPM.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake
EXPECTED_HASH SHA256=cc155ce02e7945e7b8967ddfaff0b050e958a723ef7aad3766d368940cb15494
)
include(${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake)
CPMAddPackage(...)
endif()
if(NOT(USE_CPM) AND NOT(USE_CONAN) AND NOT(USE_VCPKG) )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/extern")
endif()
if(USE_CUDA)
find_package(CUDAToolkit REQUIRED)
enable_language(CUDA)
else()
endif()
if(USE_VTK)
set(VTK_INCLUDE_DIR "C:/Program Files/VTK-9.3.1/src")
set(VTK_DIR "C:/Program Files/VTK-9.3.1/build")
set(VTK_LIB_DIR "C:/Program Files/VTK-9.3.1/build/lib")
link_directories("C:/Program Files/VTK-9.3.1")
include_directories(${VTK_INCLUDE_DIR})
find_package(VTK REQUIRED)
find_package(VTK COMPONENTS
CommonColor
CommonCore
FiltersSources
IOImage
InteractionStyle
RenderingContextOpenGL2
RenderingCore
RenderingFreeType
RenderingGL2PSOpenGL2
RenderingOpenGL2
RenderingUI
IOPLY
CommonDataModel
)
if (NOT VTK_FOUND)
message(FATAL_ERROR "VTK build folder not found.")
endif()
set(CMAKE_NINJA_FORCE_RESPONSE_FILE "ON" CACHE BOOL "Force Ninja to use response files.")
vtk_module_autoinit(
TARGETS
MODULES ${VTK_LIBRARIES}
)
endif()
add_library(LOGURU STATIC ${PROJECT_SOURCE_DIR}/extern/loguru/loguru.cpp)
if(BUILD_TESTS)
add_subdirectory(test)
endif()
if(BUILD_DOCS)
find_package(Doxygen REQUIRED)
endif()