-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathCMakeLists.txt
120 lines (100 loc) · 2.83 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# ________ _______ ______ __ __ ________ ________
# | \| \ / \ | \ | \| \| \
# | $$$$$$$$| $$$$$$$\| $$$$$$\| $$\ | $$| $$$$$$$$ \$$$$$$$$
# | $$__ | $$__/ $$| $$__| $$| $$$\| $$| $$__ | $$
# | $$ \ | $$ $$| $$ $$| $$$$\ $$| $$ \ | $$
# | $$$$$ | $$$$$$$ | $$$$$$$$| $$\$$ $$| $$$$$ | $$
# | $$_____ | $$ | $$ | $$| $$ \$$$$| $$_____ | $$
# | $$ \| $$ | $$ | $$| $$ \$$$| $$ \ | $$
# \$$$$$$$$ \$$ \$$ \$$ \$$ \$$ \$$$$$$$$ \$$
#
#
#
# _______ ________ __ __
# | \| \| \ | \
# | $$$$$$$\\$$$$$$$$| $$ | $$
# | $$__| $$ | $$ \$$\/ $$
# | $$ $$ | $$ >$$ $$
# | $$$$$$$\ | $$ / $$$$\
# | $$ | $$ | $$ | $$ \$$\
# | $$ | $$ | $$ | $$ | $$
# \$$ \$$ \$$ \$$ \$$
#
#
cmake_minimum_required (VERSION 3.15)
project (EPANET-RTX)
SET (CMAKE_C_FLAGS "-std=c99")
SET (CMAKE_CXX_FLAGS "-Wall -std=c++17")
SET (CMAKE_POSITION_INDEPENDENT_CODE ON)
add_definitions(-DRTX_NO_MYSQL)
message("prefix: ${CMAKE_FIND_LIBRARY_PREFIXES}")
message("suffix: ${CMAKE_FIND_LIBRARY_SUFFIXES}")
SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
IF(APPLE)
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
FIND_LIBRARY(CORE_FRAMEWORK CoreFoundation)
SET(EXTRA_LIBS ${SECURITY_FRAMEWORK} ${CORE_FRAMEWORK})
ENDIF (APPLE)
find_package(CURL REQUIRED)
find_package(epanet REQUIRED)
find_package(tsflib REQUIRED)
find_package(Boost REQUIRED)
find_package(SQLite3 REQUIRED)
find_package(sqlite_modern_cpp REQUIRED)
find_package(oatpp REQUIRED)
find_package(oatpp-openssl REQUIRED)
find_package(nlohmann_json REQUIRED)
# the rtx library
include_directories(
./src
)
add_library(epanetrtx
./src/Dma.cpp
./src/Element.cpp
./src/EpanetModel.cpp
./src/EpanetModelExporter.cpp
./src/EpanetSyntheticModel.cpp
./src/InpTextPattern.cpp
./src/Junction.cpp
./src/Link.cpp
./src/Model.cpp
./src/Node.cpp
./src/Pipe.cpp
./src/Pump.cpp
./src/Reservoir.cpp
./src/RtxObject.cpp
./src/Tank.cpp
./src/Valve.cpp
)
set_target_properties(
epanetrtx PROPERTIES
CXX_STANDARD 17
)
target_compile_definitions(epanetrtx PRIVATE MAXFLOAT=3.40282347e+38F)
set(rtx_lib_deps
CURL::libcurl
epanet::epanet
tsflib::tsflib
boost::boost
SQLite::SQLite3
sqlite_modern_cpp::sqlite_modern_cpp
oatpp::oatpp
oatpp::oatpp-openssl
nlohmann_json::nlohmann_json
)
target_link_libraries(
epanetrtx
${rtx_lib_deps}
)
add_executable(rtx_test
./test/test_main.cpp
./test/test_element.cpp
)
target_link_libraries(rtx_test
epanetrtx
${rtx_lib_deps}
)
add_test(rtx_test rtx_test)
install(DIRECTORY ./src/ DESTINATION include FILES_MATCHING PATTERN "*.h")
install(TARGETS epanetrtx DESTINATION lib)