-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
165 lines (154 loc) · 3.32 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
set(NS3_WITH_WOSS_SOURCE
""
CACHE
PATH
"Path to WOSS source directory, for NS-3 WOSS Integration Framework support"
)
set(NS3_WITH_WOSS_LIBRARY
""
CACHE
PATH
"Path to WOSS library directory, for NS-3 WOSS Integration Framework support"
)
set(NS3_WITH_NETCDF_INSTALL
""
CACHE
PATH
"Path to NetCDF legacy library install, for WOSS Integration Framework support"
)
set(NS3_WITH_NETCDF4_INSTALL
""
CACHE
PATH
"Path to NetCDF4 and HDF5 library install, for WOSS Integration Framework support"
)
set(ENABLE_WOSS
"OFF"
CACHE INTERNAL
"ON if WOSS can be built"
)
find_external_library(
DEPENDENCY_NAME WOSS
LIBRARY_NAME WOSS
HEADER_NAMES
location-definitions.h
woss-manager.h
woss-db-manager.h
SEARCH_PATHS ${NS3_WITH_WOSS_SOURCE}
${NS3_WITH_WOSS_LIBRARY}
PATH_SUFFIXES
/woss
/woss_def
/woss_db
/woss/woss_def
/woss/woss_db
/build
/build/lib
)
set(woss_libraries)
# If we can't find WOSS sources or library, don't process this module
if(NOT
${WOSS_FOUND}
)
message(
${HIGHLIGHTED_STATUS}
"Skipping contrib/woss-ns3"
)
return()
else()
message(STATUS "WOSS library was found: ${WOSS_LIBRARIES}")
set(ENABLE_WOSS
"ON"
CACHE INTERNAL
"ON if woss-ns3 can be built"
)
include_directories(${WOSS_INCLUDE_DIRS})
set(woss_libraries
${WOSS_LIBRARIES}
)
endif()
# Process optional NETCDF libraries
find_external_library(
DEPENDENCY_NAME NETCDF
HEADER_NAMES
netcdf.h
ncFile.h
LIBRARY_NAME netcdf_c++
netcdf
SEARCH_PATHS ${NS3_WITH_NETCDF_INSTALL}
PATH_SUFFIXES
/include
/lib
)
find_external_library(
DEPENDENCY_NAME NETCDF4
HEADER_NAMES
hdf5.h
netcdf.h
ncFile.h
LIBRARY_NAMES
netcdf_c++4
netcdf
hdf5
SEARCH_PATHS ${NS3_WITH_NETCDF4_INSTALL}
PATH_SUFFIXES
/include
/lib
)
set(netcdf_libraries)
if(${NETCDF4_FOUND})
message(STATUS "NETCDF4 was found.")
add_definitions(
-DWOSS_NETCDF_SUPPORT
-DWOSS_NETCDF4_SUPPORT
)
include_directories(${NETCDF4_INCLUDE_DIRS})
set(netcdf_libraries
${NETCDF4_LIBRARIES}
)
else()
if(${NETCDF_FOUND})
message(STATUS "NETCDF was found.")
add_definitions(-DWOSS_NETCDF_SUPPORT)
include_directories(${NETCDF_INCLUDE_DIRS})
set(netcdf_libraries
${NETCDF_LIBRARIES}
)
else()
message(STATUS "NETCDF was not found")
endif()
endif()
add_definitions(
-DNS3_WOSS_SUPPORT
-DWOSS_MULTITHREAD
)
build_lib(
LIBNAME woss-ns3
SOURCE_FILES
model/definitions/woss-location.cc
model/definitions/woss-time-reference.cc
model/definitions/woss-random-generator.cc
model/woss-prop-model.cc
model/woss-channel.cc
model/woss-position-allocator.cc
model/woss-waypoint-mobility-model.cc
helper/woss-helper.cc
HEADER_FILES
model/definitions/woss-location.h
model/definitions/woss-time-reference.h
model/definitions/woss-random-generator.h
model/woss-prop-model.h
model/woss-channel.h
model/woss-position-allocator.h
model/woss-waypoint-mobility-model.h
helper/woss-helper.h
LIBRARIES_TO_LINK
${libnetanim}
${libnetwork}
${libenergy}
${libmobility}
${libuan}
${woss_libraries}
${netcdf_libraries}
TEST_SOURCES test/woss-test.cc
)