-
Notifications
You must be signed in to change notification settings - Fork 19
/
CMakeLists.txt
95 lines (80 loc) · 2.51 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
89
90
91
92
93
94
95
cmake_minimum_required(VERSION 3.9)
project(city4cfd)
#set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
set(CMAKE_CXX_FLAGS "-O3")
set(CMAKE_BUILD_TYPE "Release")
#if (COMMAND cmake_policy)
# cmake_policy(SET CMP0003 NEW)
#endif()
if (MSVC)
add_definitions(-DNOMINMAX)
add_definitions("/EHsc")
endif (MSVC)
# BOOST
find_package(Boost 1.66 REQUIRED COMPONENTS filesystem locale QUIET)
if (WIN32)
FIND_PACKAGE(Boost)
if (Boost_FOUND)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
ADD_DEFINITIONS( "-DHAS_BOOST" )
set(Boost_USE_STATIC_LIBS ON)
set(Boost_ARCHITECTURE "-x64")
endif()
endif (WIN32)
# CGAL
find_package(CGAL REQUIRED)
if (CGAL_VERSION VERSION_GREATER_EQUAL "5.5")
message(STATUS "Found CGAL version ${CGAL_VERSION}")
else()
message(FATAL_ERROR "Found CGAL version ${CGAL_VERSION} which is not supported!"
"Please use CGAL version 5.5 or higher")
return()
endif ()
# GDAL
find_package(GDAL 3.0 REQUIRED)
if (NOT GDAL_FOUND)
message(SEND_ERROR "City4CFD requires the GDAL library, check the README for configuration")
endif()
include_directories(${GDAL_INCLUDE_DIR})
# Eigen
find_package(Eigen3 3.3.4)
include(${CMAKE_SOURCE_DIR}/thirdparty/CGAL/cmake/CGAL_Eigen3_support.cmake)
# OpenMP
find_package(OpenMP)
if (OpenMP_CXX_FOUND)
set(OpenMP_support "OpenMP::OpenMP_CXX")
else()
message(STATUS "OpenMP not found. All functions will run single-threaded")
endif()
# Third-party
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/LAStools)
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/CSF/src)
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/roofer/src)
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/val3dity)
include_directories(${CMAKE_SOURCE_DIR}/thirdparty)
include_directories(${CMAKE_SOURCE_DIR}/thirdparty/valijson)
include_directories(${Boost_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/thirdparty/roofer/src)
# Tools
add_subdirectory(${CMAKE_SOURCE_DIR}/tools/prepare_point_cloud)
# Creating entries for target: City4CFD
FILE(GLOB SRC_FILES "src/*.cpp")
add_executable(city4cfd ${SRC_FILES})
set_target_properties(
city4cfd
PROPERTIES CXX_STANDARD 17
)
target_link_libraries(city4cfd
${CGAL_LIBRARIES}
${CGAL_3RD_PARTY_LIBRARIES}
${GDAL_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_LOCALE_LIBRARY}
LASlib
CGAL::Eigen3_support
roofer_api
val3dity
${OpenMP_support}
)
install(TARGETS city4cfd DESTINATION bin)