forked from kysucix/fusibile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (56 loc) · 1.86 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
cmake_minimum_required (VERSION 3.9)
project (fusibile)
# Enable C++11 globally
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Support IDEs: https://cliutils.gitlab.io/modern-cmake/chapters/features/ides.html
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "cmake-default-targets")
find_package(OpenCV REQUIRED )
find_package(CUDA 6.0 REQUIRED ) # For Cuda Managed Memory and c++11
if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(.)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=sm_75)
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-std=c++11)
add_definitions(-Wall)
add_definitions(-Wextra)
add_definitions(-pedantic)
add_definitions(-Wno-unused-function)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -ffast-math -march=native") # extend release-profile with fast-math
#add_definitions(-march=native)
endif()
# for YouCompleteMe
set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
# For compilation ...
# Specify target & source files to compile it from
cuda_add_executable(
fusibile
cameraGeometryUtils.h
vector_operations.h
camera.h
globalstate.h
algorithmparameters.h
cameraparameters.h
linestate.h
displayUtils.h
mathUtils.h
fileIoUtils.h
fusibile.cu
main.cpp
)
# https://cliutils.gitlab.io/modern-cmake/chapters/packages/OpenMP.html
find_package(OpenMP)
# For linking ...
# Specify target & libraries to link it with
target_link_libraries(fusibile
${OpenCV_LIBS}
OpenMP::OpenMP_CXX
)
include(FeatureSummary)
feature_summary(WHAT ALL)