-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDependencies.cmake
186 lines (166 loc) · 5.75 KB
/
Dependencies.cmake
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Copyright (c) 2014-2015 Kartik Kumar, Dinamica Srl
# Copyright (c) 2014-2015 Marko Jankovic, DFKI GmbH
# Copyright (c) 2014-2015 Natalia Ortiz, University of Southampton
# Copyright (c) 2014-2015 Juan Romero, University of Strathclyde
# Distributed under the MIT License.
# See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT
# Include script to build external library with CMake.
include(ExternalProject)
if(NOT BUILD_DEPENDENCIES)
find_package(rapidjson)
endif(NOT BUILD_DEPENDENCIES)
if(NOT RAPIDJSON_FOUND)
message(STATUS "RapidJSON will be downloaded when ${CMAKE_PROJECT_NAME} is built")
ExternalProject_Add(rapidjson-lib
PREFIX ${EXTERNAL_PATH}/RapidJson
#--Download step--------------
URL https://github.com/miloyip/rapidjson/archive/master.zip
TIMEOUT 30
#--Update/Patch step----------
#--Configure step-------------
CONFIGURE_COMMAND ""
#--Build step-----------------
BUILD_COMMAND ""
#--Install step---------------
INSTALL_COMMAND ""
#--Output logging-------------
LOG_DOWNLOAD ON
)
ExternalProject_Get_Property(rapidjson-lib source_dir)
set(RAPIDJSON_INCLUDE_DIRS ${source_dir}/include
CACHE INTERNAL "Path to include folder for RapidJSON")
endif(NOT RAPIDJSON_FOUND)
if(NOT APPLE)
include_directories(SYSTEM AFTER "${RAPIDJSON_INCLUDE_DIRS}")
else(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem \"${RAPIDJSON_INCLUDE_DIRS}\"")
endif(NOT APPLE)
# -------------------------------
if(NOT BUILD_DEPENDENCIES)
find_package(SML)
endif(NOT BUILD_DEPENDENCIES)
if(NOT SML_FOUND)
message(STATUS "SML will be downloaded when ${CMAKE_PROJECT_NAME} is built")
ExternalProject_Add(sml-lib
PREFIX ${EXTERNAL_PATH}/SML
#--Download step--------------
URL https://github.com/kartikkumar/sml/archive/master.zip
TIMEOUT 30
#--Update/Patch step----------
UPDATE_COMMAND ""
PATCH_COMMAND ""
#--Configure step-------------
CONFIGURE_COMMAND ""
#--Build step-----------------
BUILD_COMMAND ""
#--Install step---------------
INSTALL_COMMAND ""
#--Output logging-------------
LOG_DOWNLOAD ON
)
ExternalProject_Get_Property(sml-lib source_dir)
set(SML_INCLUDE_DIRS ${source_dir}/include CACHE INTERNAL "Path to include folder for SML")
endif(NOT SML_FOUND)
if(NOT APPLE)
include_directories(SYSTEM AFTER "${SML_INCLUDE_DIRS}")
else(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem \"${SML_INCLUDE_DIRS}\"")
endif(NOT APPLE)
# -------------------------------
if(NOT BUILD_DEPENDENCIES)
find_package(Astro)
endif(NOT BUILD_DEPENDENCIES)
if(NOT ASTRO_FOUND)
message(STATUS "Astro will be downloaded when ${CMAKE_PROJECT_NAME} is built")
ExternalProject_Add(astro-lib
DEPENDS sml-lib
PREFIX ${EXTERNAL_PATH}/Astro
#--Download step--------------
URL https://github.com/kartikkumar/astro/archive/master.zip
TIMEOUT 30
#--Update/Patch step----------
UPDATE_COMMAND ""
PATCH_COMMAND ""
#--Configure step-------------
CONFIGURE_COMMAND ""
#--Build step-----------------
BUILD_COMMAND ""
#--Install step---------------
INSTALL_COMMAND ""
#--Output logging-------------
LOG_DOWNLOAD ON
)
ExternalProject_Get_Property(astro-lib source_dir)
set(ASTRO_INCLUDE_DIRS ${source_dir}/include CACHE INTERNAL "Path to include folder for Astro")
endif(NOT ASTRO_FOUND)
if(NOT APPLE)
include_directories(SYSTEM AFTER "${ASTRO_INCLUDE_DIRS}")
else(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem \"${ASTRO_INCLUDE_DIRS}\"")
endif(NOT APPLE)
# -------------------------------
if(NOT BUILD_DEPENDENCIES)
find_package(Spot)
endif(NOT BUILD_DEPENDENCIES)
if(NOT SPOT_FOUND)
message(STATUS "Spot will be downloaded when ${CMAKE_PROJECT_NAME} is built")
ExternalProject_Add(spot-lib
PREFIX ${EXTERNAL_PATH}/Spot
#--Download step--------------
URL https://github.com/kartikkumar/spot/archive/master.zip
TIMEOUT 120
#--Update/Patch step----------
#--Configure step-------------
#--Build step-----------------
BUILD_IN_SOURCE 1
#--Install step---------------
INSTALL_COMMAND ""
#--Output logging-------------
LOG_DOWNLOAD ON
)
ExternalProject_Get_Property(spot-lib source_dir)
set(SPOT_INCLUDE_DIRS ${source_dir}/include
CACHE INTERNAL "Path to Spot include folder")
set(SPOT_LIBRARY_DIR ${source_dir}/lib
CACHE INTERNAL "Path to Spot library")
set(SPOT_LIBRARY "spot")
endif(NOT SPOT_FOUND)
if(NOT APPLE)
include_directories(SYSTEM AFTER "${SPOT_INCLUDE_DIRS}")
else(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem \"${SPOT_INCLUDE_DIRS}\"")
endif(NOT APPLE)
link_directories(${SPOT_LIBRARY_DIR})
# -------------------------------
if(BUILD_TESTS)
if(NOT BUILD_DEPENDENCIES)
find_package(CATCH)
endif(NOT BUILD_DEPENDENCIES)
if(NOT CATCH_FOUND)
message(STATUS "Catch will be downloaded when ${CMAKE_PROJECT_NAME} is built")
ExternalProject_Add(catch
PREFIX ${EXTERNAL_PATH}/Catch
#--Download step--------------
URL https://github.com/kartikkumar/Catch/archive/master.zip
TIMEOUT 30
#--Update/Patch step----------
UPDATE_COMMAND ""
PATCH_COMMAND ""
#--Configure step-------------
CONFIGURE_COMMAND ""
#--Build step-----------------
BUILD_COMMAND ""
#--Install step---------------
INSTALL_COMMAND ""
#--Output logging-------------
LOG_DOWNLOAD ON
)
ExternalProject_Get_Property(catch source_dir)
set(CATCH_INCLUDE_DIRS ${source_dir}/include CACHE INTERNAL "Path to include folder for Catch")
endif(NOT CATCH_FOUND)
if(NOT APPLE)
include_directories(SYSTEM AFTER "${CATCH_INCLUDE_DIRS}")
else(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem \"${CATCH_INCLUDE_DIRS}\"")
endif(NOT APPLE)
endif(BUILD_TESTS)