-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
96 lines (70 loc) · 2.39 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
96
cmake_minimum_required(VERSION 3.3)
project (Druckwelle)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
add_definitions( -DLITTLE_ENDIAN=1 )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/3rdparty/")
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /openmp")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /openmp")
INCLUDE_EXTERNAL_MSPROJECT(libconfig++ "${CMAKE_SOURCE_DIR}/3rdparty/libconfig/lib/libconfig++.vcxproj")
INCLUDE_EXTERNAL_MSPROJECT(cpprestsdk140 "${CMAKE_SOURCE_DIR}/3rdparty/cpprestsdk/Release/src/build/vs14/casablanca140.vcxproj")
add_definitions( -DALLOW_AMP=0 )
add_definitions( -DNOMINMAX )
else()
#set(CMAKE_BUILD_TYPE Debug)
# Set C++11 feature set for both GCC and Clang
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# Debug symbols for GCC
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
add_definitions( -DALLOW_AMP=0 )
find_package(GDAL REQUIRED)
find_package(LibConfig REQUIRED)
add_subdirectory(3rdparty/cpprestsdk/Release EXCLUDE_FROM_ALL)
endif()
include_directories(
${CMAKE_SOURCE_DIR}/3rdparty/cpplinq/CppLinq
${CMAKE_SOURCE_DIR}/3rdparty/stb
${CMAKE_SOURCE_DIR}/3rdparty/ZFXMath/include
${CMAKE_SOURCE_DIR}/3rdparty/loose_quadtree/src/include
${CMAKE_SOURCE_DIR}/3rdparty/protobuf/src
${CMAKE_SOURCE_DIR}/3rdparty/libconfig/contrib/chained
${CMAKE_SOURCE_DIR}/3rdparty/cpprestsdk/Release/include
${GDAL_INCLUDE_DIR}
)
add_subdirectory(3rdparty/protobuf/cmake EXCLUDE_FROM_ALL)
add_subdirectory(3rdparty/zlib EXCLUDE_FROM_ALL)
set (THIRDPARTY
libprotobuf-lite
zlib)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(MSVC)
set_property(TARGET ${THIRDPARTY} libconfig++ cpprestsdk140 PROPERTY FOLDER "3rdparty")
endif()
link_libraries (
${THIRDPARTY}
)
if(MSVC)
include_directories(
${CMAKE_SOURCE_DIR}/3rdparty/libconfig/lib
${CMAKE_SOURCE_DIR}/3rdparty/GDAL/include
)
link_libraries (
${CMAKE_SOURCE_DIR}/3rdparty/GDAL/lib/gdal_i.lib
)
else()
link_libraries (
${GDAL_LIBRARY}
${LIBCONFIGPP_LIBRARIES}
stdc++fs
cpprestsdk140
)
endif()
add_subdirectory(src)
add_subdirectory(test)
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
"Reset the configurations to what we need"
FORCE)
endif()