forked from InteractiveComputerGraphics/cuNSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (69 loc) · 1.96 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
85
86
87
88
cmake_minimum_required(VERSION 3.12)
#Requires cmake 3.12 for first class cuda support with visual studio
project(cuNSearch LANGUAGES CXX CUDA)
# Visual studio solution directories.
set_property(GLOBAL PROPERTY USE_FOLDERS on)
option(CUNSEARCH_USE_DOUBLE_PRECISION "Use double precision." ON)
if(CUNSEARCH_USE_DOUBLE_PRECISION)
message(STATUS "cuNSearch::Real = double")
else()
message(STATUS "cuNSearch::Real = float")
endif(CUNSEARCH_USE_DOUBLE_PRECISION)
if(CUNSEARCH_USE_DOUBLE_PRECISION)
add_compile_options(-DCUNSEARCH_USE_DOUBLE_PRECISION)
endif(CUNSEARCH_USE_DOUBLE_PRECISION)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_DEBUG_POSTFIX "_d")
find_package(CUDA 9.0 REQUIRED)
set (INCLUDE_HEADERS
include/PointSet.h
include/ActivationTable.h
include/Common.h
include/cuNSearch.h
)
set (HEADER_FILES
src/Types.h
src/cuNSearchDeviceData.h
src/GridInfo.h
src/NotImplementedException.h
src/PointSetImplementation.h
src/cuNSearchKernels.cuh
src/helper_linearIndex.h
src/helper_mortonCode.h
Utils/cuda_helper.h
Utils/Timing.h
Utils/IDFactory.h
)
set (SOURCE_FILES
src/PointSet.cpp
src/PointSetImplementation.cu
src/cuNSearch.cu
src/cuNSearchDeviceData.cu
src/cuNSearchKernels.cu
Utils/cuda_helper.cpp
Utils/Timing.cpp
Utils/IDFactory.cpp
)
include_directories(
"include"
"Utils"
${CUDA_INCLUDE_DIRS}
${CUDA_CUT_INCLUDE_DIR}
)
add_library(cuNSearch STATIC ${INCLUDE_HEADERS} ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(cuNSearch ${CUDA_LIBRARIES})
target_compile_definitions(cuNSearch PUBLIC $<$<CONFIG:DEBUG>:DEBUG>)
install(FILES ${INCLUDE_HEADERS}
DESTINATION include/)
install(TARGETS cuNSearch
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
option(BUILD_DEMO "Build example of how to use this library."
ON)
if(BUILD_DEMO)
add_subdirectory(demo)
endif(BUILD_DEMO)
unset(USE_DOUBLE_PRECISION CACHE)