-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
71 lines (62 loc) · 2.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
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
cmake_minimum_required(VERSION 3.16)
project(CloudTools)
# Set a default build type if none was specified
set(DEFAULT_BUILD_TYPE "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(MSVC)
# warning level 4
add_compile_options(/W4)
else()
# add most warnings
add_compile_options(-pedantic -Wall -Wno-unknown-pragmas -Wno-reorder)
endif()
find_package(Boost 1.71 REQUIRED COMPONENTS filesystem program_options regex)
find_package(GDAL 3.0 REQUIRED)
find_package(OpenCV 4.2 REQUIRED COMPONENTS core imgproc)
find_package(Threads REQUIRED)
find_package(MPI)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${GDAL_INCLUDE_DIR})
include_directories(${OpenCV_INCLUDE_DIRS})
if(MSVC)
link_directories(${Boost_LIBRARY_DIRS})
else()
link_libraries(${Boost_LIBRARIES})
endif()
link_libraries(${GDAL_LIBRARY})
link_libraries(${OpenCV_LIBS})
add_subdirectory(CloudTools.Common)
add_subdirectory(CloudTools.DEM)
add_subdirectory(CloudTools.DEM.Difference)
add_subdirectory(CloudTools.DEM.Mask)
add_subdirectory(AHN.Buildings)
add_subdirectory(AHN.Buildings.Parallel)
add_subdirectory(AHN.Buildings.Aggregate)
add_subdirectory(AHN.Buildings.Verify)
add_subdirectory(CloudTools.Vegetation)
add_subdirectory(CloudTools.Vegetation.Verify)
if(MPI_CXX_FOUND)
add_subdirectory(AHN.Buildings.MPI)
else()
message(WARNING "MPI not found, AHN.Buildings.MPI will not be built.")
endif()
if(WIN32)
install(FILES Shell.bat
DESTINATION ${CMAKE_INSTALL_PREFIX})
if(EXISTS ${CMAKE_SOURCE_DIR}/Shell.config.cmd)
install(FILES Shell.config.cmd
DESTINATION ${CMAKE_INSTALL_PREFIX})
else()
message(WARNING "Create Shell.config.cmd config file from Shell.config.cmd.sample!")
endif()
endif()