1 | cmake_minimum_required(VERSION 2.4.7) |
---|
2 | PROJECT(libindi C CXX) |
---|
3 | |
---|
4 | ################## INDI version ################################ |
---|
5 | set(INDI_SOVERSION "0") |
---|
6 | set(CMAKE_INDI_VERSION_MAJOR 0) |
---|
7 | set(CMAKE_INDI_VERSION_MINOR 9) |
---|
8 | set(CMAKE_INDI_VERSION_RELEASE 0) |
---|
9 | set(CMAKE_INDI_VERSION_STRING "${CMAKE_INDI_VERSION_MAJOR}.${CMAKE_INDI_VERSION_MINOR}.${CMAKE_INDI_VERSION_RELEASE}") |
---|
10 | |
---|
11 | ################## Paths ################################ |
---|
12 | set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") |
---|
13 | set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/indi/") |
---|
14 | set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") |
---|
15 | set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include") |
---|
16 | |
---|
17 | ################## setup install directories ################################ |
---|
18 | set (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) |
---|
19 | set (LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Library directory name") |
---|
20 | ## the following are directories where stuff will be installed to |
---|
21 | set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/" CACHE PATH "The subdirectory to the header prefix") |
---|
22 | set(PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig/" CACHE STRING "Base directory for pkgconfig files") |
---|
23 | |
---|
24 | ################## Includes ################################ |
---|
25 | Include (CheckCXXSourceCompiles) |
---|
26 | include (MacroOptionalFindPackage) |
---|
27 | include (MacroLogFeature) |
---|
28 | include (MacroBoolTo01) |
---|
29 | include (CheckIncludeFiles) |
---|
30 | |
---|
31 | FIND_PACKAGE(ZLIB REQUIRED) |
---|
32 | FIND_PACKAGE(USB REQUIRED) |
---|
33 | FIND_PACKAGE(CFITSIO REQUIRED) |
---|
34 | |
---|
35 | if (NOT CFITSIO_FOUND OR CFITSIO_VERSION_MAJOR LESS 3) |
---|
36 | message(FATAL_ERROR "CFITSIO version too old, Please install cfitsio 3.x and try again. http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html") |
---|
37 | endif (NOT CFITSIO_FOUND OR CFITSIO_VERSION_MAJOR LESS 3) |
---|
38 | |
---|
39 | macro_bool_to_01(CFITSIO_FOUND HAVE_CFITSIO_H) |
---|
40 | macro_log_feature(CFITSIO_FOUND "libcfitsio" "A library for reading and writing data files in FITS (Flexible Image Transport System) data format" "http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html" FALSE "3.03" "Provides INDI with FITS I/O support.") |
---|
41 | |
---|
42 | macro_optional_find_package(Nova) |
---|
43 | macro_bool_to_01(NOVA_FOUND HAVE_NOVA_H) |
---|
44 | macro_log_feature(NOVA_FOUND "libnova" "A general purpose, double precision, Celestial Mechanics, Astrometry and Astrodynamics library" "http://libnova.sourceforge.net" FALSE "0.12.1" "Provides INDI with astrodynamics library.") |
---|
45 | |
---|
46 | check_include_files(linux/videodev2.h HAVE_LINUX_VIDEODEV2_H) |
---|
47 | check_include_files(termios.h TERMIOS_FOUND) |
---|
48 | macro_bool_to_01(TERMIOS_FOUND HAVE_TERMIOS_H) |
---|
49 | |
---|
50 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) |
---|
51 | |
---|
52 | if(COMMAND cmake_policy) |
---|
53 | cmake_policy(SET CMP0003 NEW) |
---|
54 | endif(COMMAND cmake_policy) |
---|
55 | |
---|
56 | include_directories( ${CMAKE_CURRENT_BINARY_DIR}) |
---|
57 | include_directories( ${CMAKE_SOURCE_DIR}) |
---|
58 | include_directories( ${CMAKE_SOURCE_DIR}/libs) |
---|
59 | include_directories( ${CMAKE_SOURCE_DIR}/libs/webcam) |
---|
60 | |
---|
61 | if (CFITSIO_FOUND) |
---|
62 | include_directories(${CFITSIO_INCLUDE_DIR}) |
---|
63 | endif (CFITSIO_FOUND) |
---|
64 | |
---|
65 | if (NOVA_FOUND) |
---|
66 | include_directories(${NOVA_INCLUDE_DIR}) |
---|
67 | endif (NOVA_FOUND) |
---|
68 | |
---|
69 | set(liblilxml_SRCS ${CMAKE_SOURCE_DIR}/libs/lilxml.c ) |
---|
70 | |
---|
71 | set(libindicom_SRCS |
---|
72 | ${CMAKE_SOURCE_DIR}/libs/indicom.c |
---|
73 | ${CMAKE_SOURCE_DIR}/base64.c |
---|
74 | ) |
---|
75 | |
---|
76 | set(libwebcam_SRCS |
---|
77 | ${CMAKE_SOURCE_DIR}/libs/webcam/PPort.cpp |
---|
78 | ${CMAKE_SOURCE_DIR}/libs/webcam/port.cpp |
---|
79 | ${CMAKE_SOURCE_DIR}/libs/webcam/v4l2_base.cpp |
---|
80 | ${CMAKE_SOURCE_DIR}/libs/webcam/ccvt_c2.c |
---|
81 | ${CMAKE_SOURCE_DIR}/libs/webcam/ccvt_misc.c |
---|
82 | ) |
---|
83 | |
---|
84 | set (indimain_SRCS |
---|
85 | ${CMAKE_SOURCE_DIR}/indidriver.c |
---|
86 | ${CMAKE_SOURCE_DIR}/indidrivermain.c |
---|
87 | ${CMAKE_SOURCE_DIR}/eventloop.c |
---|
88 | ) |
---|
89 | |
---|
90 | set (indiclient_SRCS |
---|
91 | ${CMAKE_SOURCE_DIR}/libs/indibase/basedriver.cpp |
---|
92 | ${CMAKE_SOURCE_DIR}/libs/indibase/baseclient.cpp |
---|
93 | ) |
---|
94 | |
---|
95 | set (indidriver_SRCS |
---|
96 | ${CMAKE_SOURCE_DIR}/libs/indibase/basedriver.cpp |
---|
97 | ${CMAKE_SOURCE_DIR}/libs/indibase/defaultdriver.cpp |
---|
98 | ${CMAKE_SOURCE_DIR}/libs/indibase/indiccd.cpp |
---|
99 | ${CMAKE_SOURCE_DIR}/libs/indibase/inditelescope.cpp |
---|
100 | ${CMAKE_SOURCE_DIR}/libs/indibase/indifilterwheel.cpp |
---|
101 | ${CMAKE_SOURCE_DIR}/libs/indibase/indifocuser.cpp |
---|
102 | ${CMAKE_SOURCE_DIR}/libs/indibase/indiusbdevice.cpp |
---|
103 | ${CMAKE_SOURCE_DIR}/libs/indibase/indiguiderinterface.cpp |
---|
104 | ${CMAKE_SOURCE_DIR}/libs/indibase/indifilterinterface.cpp |
---|
105 | |
---|
106 | ) |
---|
107 | |
---|
108 | |
---|
109 | ###################################### |
---|
110 | ########### INDI SERVER ############## |
---|
111 | ###################################### |
---|
112 | |
---|
113 | set(indiserver_SRCS indiserver.c fq.c) |
---|
114 | |
---|
115 | add_executable(indiserver ${indiserver_SRCS} ${liblilxml_SRCS}) |
---|
116 | |
---|
117 | target_link_libraries(indiserver pthread) |
---|
118 | |
---|
119 | if (NOVA_FOUND) |
---|
120 | target_link_libraries(indiserver ${NOVA_LIBRARIES}) |
---|
121 | endif (NOVA_FOUND) |
---|
122 | |
---|
123 | install(TARGETS indiserver RUNTIME DESTINATION bin) |
---|
124 | |
---|
125 | ################################################# |
---|
126 | ############# INDI Shared Library ############### |
---|
127 | # To offer lilxml and communination routines # |
---|
128 | # Mostly used by generic clients # |
---|
129 | ################################################# |
---|
130 | add_library(indi SHARED ${libindicom_SRCS} ${liblilxml_SRCS}) |
---|
131 | target_link_libraries(indi m z) |
---|
132 | |
---|
133 | if (NOVA_FOUND) |
---|
134 | target_link_libraries(indi ${NOVA_LIBRARIES}) |
---|
135 | endif(NOVA_FOUND) |
---|
136 | if (CFITSIO_FOUND) |
---|
137 | target_link_libraries(indi ${CFITSIO_LIBRARIES}) |
---|
138 | endif(CFITSIO_FOUND) |
---|
139 | |
---|
140 | install(TARGETS indi LIBRARY DESTINATION ${LIB_DESTINATION}) |
---|
141 | set_target_properties(indi PROPERTIES VERSION ${CMAKE_INDI_VERSION_STRING} SOVERSION ${INDI_SOVERSION}) |
---|
142 | |
---|
143 | ################################################## |
---|
144 | ############ INDI Main Static Library ############ |
---|
145 | # To link with main() for 3rd party drivers # |
---|
146 | ################################################## |
---|
147 | add_library(indimain STATIC ${indimain_SRCS}) |
---|
148 | install(TARGETS indimain ARCHIVE DESTINATION ${LIB_DESTINATION}) |
---|
149 | |
---|
150 | ################################################## |
---|
151 | ###### INDI Default Driver Static Library ######## |
---|
152 | # To link with main() and indibase classes # |
---|
153 | ################################################## |
---|
154 | add_library(indidriver STATIC ${indimain_SRCS} ${indidriver_SRCS}) |
---|
155 | install(TARGETS indidriver ARCHIVE DESTINATION ${LIB_DESTINATION}) |
---|
156 | |
---|
157 | ################################################## |
---|
158 | ########### INDI Client Static Library ########### |
---|
159 | ################################################## |
---|
160 | add_library(indiclient STATIC ${indiclient_SRCS}) |
---|
161 | target_link_libraries(indiclient indi pthread) |
---|
162 | install(TARGETS indiclient ARCHIVE DESTINATION ${LIB_DESTINATION}) |
---|
163 | |
---|
164 | ##################################### |
---|
165 | ########## TELESCOPE GROUP ########## |
---|
166 | ##################################### |
---|
167 | |
---|
168 | ########### LX200 Basic ############# |
---|
169 | set(lx200basic_SRCS |
---|
170 | ${indimain_SRCS} |
---|
171 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200driver.c |
---|
172 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200basic.cpp ) |
---|
173 | |
---|
174 | add_executable(indi_lx200basic ${lx200basic_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
175 | |
---|
176 | if (NOVA_FOUND) |
---|
177 | target_link_libraries(indi_lx200basic ${NOVA_LIBRARIES}) |
---|
178 | endif (NOVA_FOUND) |
---|
179 | |
---|
180 | install(TARGETS indi_lx200basic RUNTIME DESTINATION bin ) |
---|
181 | |
---|
182 | ################################################################################# |
---|
183 | |
---|
184 | ########### LX200 Generic ########### |
---|
185 | set(lx200generic_SRCS |
---|
186 | ${indimain_SRCS} |
---|
187 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200driver.c |
---|
188 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200autostar.cpp |
---|
189 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200_16.cpp |
---|
190 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200gps.cpp |
---|
191 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200generic.cpp |
---|
192 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200classic.cpp |
---|
193 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200apdriver.c |
---|
194 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200ap.cpp |
---|
195 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200fs2.cpp) |
---|
196 | |
---|
197 | add_executable(indi_lx200generic ${lx200generic_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
198 | |
---|
199 | target_link_libraries(indi_lx200generic m ) |
---|
200 | |
---|
201 | if (NOVA_FOUND) |
---|
202 | target_link_libraries(indi_lx200generic ${NOVA_LIBRARIES}) |
---|
203 | endif (NOVA_FOUND) |
---|
204 | |
---|
205 | install(TARGETS indi_lx200generic RUNTIME DESTINATION bin ) |
---|
206 | |
---|
207 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_lx200generic_symlink.cmake |
---|
208 | "exec_program(${CMAKE_COMMAND} ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200classic)\n |
---|
209 | exec_program(${CMAKE_COMMAND} ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200autostar)\n |
---|
210 | exec_program(${CMAKE_COMMAND} ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200_16)\n |
---|
211 | exec_program(${CMAKE_COMMAND} ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200gps)\n |
---|
212 | exec_program(${CMAKE_COMMAND} ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200ap)\n |
---|
213 | exec_program(${CMAKE_COMMAND} ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200fs2)\n |
---|
214 | ") |
---|
215 | set_target_properties(indi_lx200generic PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_lx200generic_symlink.cmake) |
---|
216 | ################################################################################# |
---|
217 | |
---|
218 | ########### Celestron GPS ############ |
---|
219 | set(celestrongps_SRCS |
---|
220 | ${indimain_SRCS} |
---|
221 | ${CMAKE_SOURCE_DIR}/drivers/telescope/celestronprotocol.c |
---|
222 | ${CMAKE_SOURCE_DIR}/drivers/telescope/celestrongps.cpp ) |
---|
223 | |
---|
224 | add_executable(indi_celestron_gps ${celestrongps_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
225 | |
---|
226 | target_link_libraries(indi_celestron_gps m ) |
---|
227 | |
---|
228 | |
---|
229 | if (NOVA_FOUND) |
---|
230 | target_link_libraries(indi_celestron_gps ${NOVA_LIBRARIES}) |
---|
231 | endif (NOVA_FOUND) |
---|
232 | |
---|
233 | install(TARGETS indi_celestron_gps RUNTIME DESTINATION bin ) |
---|
234 | |
---|
235 | ################################################################################# |
---|
236 | |
---|
237 | ########### Orion Atlas ############# |
---|
238 | set(orionatlas_SRCS |
---|
239 | ${indimain_SRCS} |
---|
240 | ${CMAKE_SOURCE_DIR}/drivers/telescope/orionatlas.cpp ) |
---|
241 | |
---|
242 | add_executable(indi_orion_atlas ${orionatlas_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
243 | |
---|
244 | #target_link_libraries(indi_orion_atlas ${KDE4_KDECORE_LIBS}) |
---|
245 | |
---|
246 | if (NOVA_FOUND) |
---|
247 | target_link_libraries(indi_orion_atlas ${NOVA_LIBRARIES}) |
---|
248 | endif (NOVA_FOUND) |
---|
249 | |
---|
250 | install(TARGETS indi_orion_atlas RUNTIME DESTINATION bin ) |
---|
251 | |
---|
252 | ################################################################################# |
---|
253 | |
---|
254 | ########### Takahashi Temma ########## |
---|
255 | if (NOVA_FOUND) |
---|
256 | |
---|
257 | set(temma_SRCS |
---|
258 | ${indimain_SRCS} |
---|
259 | ${CMAKE_SOURCE_DIR}/drivers/telescope/temmadriver.c ) |
---|
260 | |
---|
261 | add_executable(indi_temma ${temma_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
262 | |
---|
263 | target_link_libraries(indi_temma ${NOVA_LIBRARIES} m ) |
---|
264 | |
---|
265 | install(TARGETS indi_temma RUNTIME DESTINATION bin ) |
---|
266 | |
---|
267 | endif (NOVA_FOUND) |
---|
268 | ################################################################################# |
---|
269 | |
---|
270 | ########### Sky Commander ############# |
---|
271 | set(skycommander_SRCS |
---|
272 | ${indimain_SRCS} |
---|
273 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200driver.c |
---|
274 | ${CMAKE_SOURCE_DIR}/drivers/telescope/skycommander.c ) |
---|
275 | |
---|
276 | add_executable(indi_skycommander ${skycommander_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
277 | |
---|
278 | target_link_libraries(indi_skycommander m ) |
---|
279 | |
---|
280 | if (NOVA_FOUND) |
---|
281 | target_link_libraries(indi_skycommander ${NOVA_LIBRARIES}) |
---|
282 | endif (NOVA_FOUND) |
---|
283 | |
---|
284 | install(TARGETS indi_skycommander RUNTIME DESTINATION bin ) |
---|
285 | |
---|
286 | ################################################################################# |
---|
287 | |
---|
288 | ########### Intelliscope ############### |
---|
289 | set(intelliscope_SRCS |
---|
290 | ${indimain_SRCS} |
---|
291 | ${CMAKE_SOURCE_DIR}/drivers/telescope/lx200driver.c |
---|
292 | ${CMAKE_SOURCE_DIR}/drivers/telescope/intelliscope.c ) |
---|
293 | |
---|
294 | add_executable(indi_intelliscope ${intelliscope_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
295 | |
---|
296 | target_link_libraries(indi_intelliscope m ) |
---|
297 | |
---|
298 | if (NOVA_FOUND) |
---|
299 | target_link_libraries(indi_intelliscope ${NOVA_LIBRARIES}) |
---|
300 | endif (NOVA_FOUND) |
---|
301 | |
---|
302 | install(TARGETS indi_intelliscope RUNTIME DESTINATION bin ) |
---|
303 | |
---|
304 | ########### BAO ############### |
---|
305 | set(BAO_SRCS |
---|
306 | ${indimain_SRCS} |
---|
307 | ${CMAKE_SOURCE_DIR}/communs/Socket.cpp |
---|
308 | ${CMAKE_SOURCE_DIR}/communs/ServerSocket.cpp |
---|
309 | ${CMAKE_SOURCE_DIR}/communs/astro.cpp |
---|
310 | ${CMAKE_SOURCE_DIR}/communs/exception.cpp |
---|
311 | ${CMAKE_SOURCE_DIR}/communs/filetools.cpp |
---|
312 | ${CMAKE_SOURCE_DIR}/communs/alignement.cpp |
---|
313 | ${CMAKE_SOURCE_DIR}/communs/logs.cpp |
---|
314 | ${CMAKE_SOURCE_DIR}/drivers/telescope/BAO.cpp |
---|
315 | ) |
---|
316 | |
---|
317 | add_executable(indi_BAO ${BAO_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
318 | |
---|
319 | target_link_libraries(indi_BAO m -lpthread |
---|
320 | ) |
---|
321 | |
---|
322 | if (NOVA_FOUND) |
---|
323 | target_link_libraries(indi_BAO ${NOVA_LIBRARIES}) |
---|
324 | endif (NOVA_FOUND) |
---|
325 | |
---|
326 | install(TARGETS indi_BAO RUNTIME DESTINATION bin ) |
---|
327 | ########### Syncscan ############### |
---|
328 | set(synscan_SRCS |
---|
329 | ${indimain_SRCS} |
---|
330 | ${CMAKE_SOURCE_DIR}/drivers/telescope/synscanmount.cpp ) |
---|
331 | |
---|
332 | add_executable(indi_synscan ${synscan_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
333 | |
---|
334 | target_link_libraries(indi_synscan indidriver m z) |
---|
335 | |
---|
336 | if (NOVA_FOUND) |
---|
337 | target_link_libraries(indi_synscan ${NOVA_LIBRARIES}) |
---|
338 | endif (NOVA_FOUND) |
---|
339 | |
---|
340 | install(TARGETS indi_synscan RUNTIME DESTINATION bin ) |
---|
341 | |
---|
342 | ########### Magellan I ############# |
---|
343 | set(magellan_SRCS |
---|
344 | ${indimain_SRCS} |
---|
345 | ${CMAKE_SOURCE_DIR}/drivers/telescope/magellandriver.c |
---|
346 | ${CMAKE_SOURCE_DIR}/drivers/telescope/magellan1.cpp ) |
---|
347 | |
---|
348 | add_executable(indi_magellan1 ${magellan_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
349 | |
---|
350 | if (NOVA_FOUND) |
---|
351 | target_link_libraries(indi_magellan1 ${NOVA_LIBRARIES}) |
---|
352 | endif (NOVA_FOUND) |
---|
353 | |
---|
354 | install(TARGETS indi_magellan1 RUNTIME DESTINATION bin ) |
---|
355 | |
---|
356 | ########### IEQ45 ############# |
---|
357 | set(ieq45_SRCS |
---|
358 | ${indimain_SRCS} |
---|
359 | ${CMAKE_SOURCE_DIR}/drivers/telescope/ieq45driver.c |
---|
360 | ${CMAKE_SOURCE_DIR}/drivers/telescope/ieq45.cpp ) |
---|
361 | |
---|
362 | add_executable(indi_ieq45 ${ieq45_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
363 | |
---|
364 | if (NOVA_FOUND) |
---|
365 | target_link_libraries(indi_ieq45 ${NOVA_LIBRARIES}) |
---|
366 | endif (NOVA_FOUND) |
---|
367 | |
---|
368 | install(TARGETS indi_ieq45 RUNTIME DESTINATION bin ) |
---|
369 | |
---|
370 | ########### Telescope Simulator ############## |
---|
371 | set(telescopesimulator_SRCS |
---|
372 | ${indimain_SRCS} |
---|
373 | ${CMAKE_SOURCE_DIR}/drivers/telescope/telescope_simulator.cpp |
---|
374 | ) |
---|
375 | |
---|
376 | add_executable(indi_simulator_telescope ${telescopesimulator_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
377 | |
---|
378 | target_link_libraries(indi_simulator_telescope indidriver ${CFITSIO_LIBRARIES} m z pthread) |
---|
379 | |
---|
380 | if (NOVA_FOUND) |
---|
381 | target_link_libraries(indi_simulator_telescope ${NOVA_LIBRARIES}) |
---|
382 | endif (NOVA_FOUND) |
---|
383 | |
---|
384 | install(TARGETS indi_simulator_telescope RUNTIME DESTINATION bin ) |
---|
385 | |
---|
386 | ########### CCD Simulator ############## |
---|
387 | if (CFITSIO_FOUND) |
---|
388 | |
---|
389 | set(ccdsimulator_SRCS |
---|
390 | ${indimain_SRCS} |
---|
391 | ${CMAKE_SOURCE_DIR}/drivers/ccd/ccd_simulator.cpp |
---|
392 | ) |
---|
393 | |
---|
394 | add_executable(indi_simulator_ccd ${ccdsimulator_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
395 | |
---|
396 | target_link_libraries(indi_simulator_ccd indidriver ${CFITSIO_LIBRARIES} m z pthread) |
---|
397 | |
---|
398 | if (NOVA_FOUND) |
---|
399 | target_link_libraries(indi_simulator_ccd ${NOVA_LIBRARIES}) |
---|
400 | endif (NOVA_FOUND) |
---|
401 | |
---|
402 | install(TARGETS indi_simulator_ccd RUNTIME DESTINATION bin ) |
---|
403 | |
---|
404 | endif (CFITSIO_FOUND) |
---|
405 | |
---|
406 | |
---|
407 | ##################################### |
---|
408 | ########## FOCUSER GROUP ############ |
---|
409 | ##################################### |
---|
410 | |
---|
411 | ################################################################################# |
---|
412 | |
---|
413 | ################ Robo Focuser ################ |
---|
414 | |
---|
415 | set(robofocus_SRCS |
---|
416 | ${indimain_SRCS} |
---|
417 | ${CMAKE_SOURCE_DIR}/drivers/focuser/robofocus.cpp |
---|
418 | ) |
---|
419 | |
---|
420 | add_executable(indi_robo_focus ${robofocus_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
421 | |
---|
422 | target_link_libraries(indi_robo_focus indidriver m z) |
---|
423 | |
---|
424 | if (NOVA_FOUND) |
---|
425 | target_link_libraries(indi_robo_focus ${NOVA_LIBRARIES}) |
---|
426 | endif (NOVA_FOUND) |
---|
427 | |
---|
428 | install(TARGETS indi_robo_focus RUNTIME DESTINATION bin ) |
---|
429 | |
---|
430 | ################ Optec TCF-S ################ |
---|
431 | |
---|
432 | set(tcfs_SRCS |
---|
433 | ${indimain_SRCS} |
---|
434 | ${CMAKE_SOURCE_DIR}/drivers/focuser/tcfs.cpp |
---|
435 | ) |
---|
436 | |
---|
437 | add_executable(indi_tcfs_focus ${tcfs_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
438 | |
---|
439 | target_link_libraries(indi_tcfs_focus indidriver m z) |
---|
440 | |
---|
441 | if (NOVA_FOUND) |
---|
442 | target_link_libraries(indi_tcfs_focus ${NOVA_LIBRARIES}) |
---|
443 | endif (NOVA_FOUND) |
---|
444 | |
---|
445 | install(TARGETS indi_tcfs_focus RUNTIME DESTINATION bin ) |
---|
446 | |
---|
447 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_tcfs_symlink.cmake |
---|
448 | "exec_program(${CMAKE_COMMAND} ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_tcfs_focus \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_tcfs3_focus)\n") |
---|
449 | set_target_properties(indi_tcfs_focus PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_tcfs_symlink.cmake) |
---|
450 | |
---|
451 | ################################################################################# |
---|
452 | |
---|
453 | ##################################### |
---|
454 | ######## FILTER WHEEL GROUP ######### |
---|
455 | ##################################### |
---|
456 | |
---|
457 | ########## True Technology Wheel ############ |
---|
458 | set(trutechwheel_SRCS |
---|
459 | ${indimain_SRCS} |
---|
460 | ${CMAKE_SOURCE_DIR}/drivers/filter_wheel/trutech_wheel.c |
---|
461 | ) |
---|
462 | |
---|
463 | add_executable(indi_trutech_wheel ${trutechwheel_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
464 | |
---|
465 | target_link_libraries(indi_trutech_wheel m) |
---|
466 | |
---|
467 | if (NOVA_FOUND) |
---|
468 | target_link_libraries(indi_trutech_wheel ${NOVA_LIBRARIES}) |
---|
469 | endif (NOVA_FOUND) |
---|
470 | |
---|
471 | install(TARGETS indi_trutech_wheel RUNTIME DESTINATION bin ) |
---|
472 | |
---|
473 | ########### Filter Simulator ############## |
---|
474 | set(filtersimulator_SRCS |
---|
475 | ${indimain_SRCS} |
---|
476 | ${CMAKE_SOURCE_DIR}/drivers/filter_wheel/filter_simulator.cpp |
---|
477 | ) |
---|
478 | |
---|
479 | add_executable(indi_simulator_wheel ${filtersimulator_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
480 | |
---|
481 | target_link_libraries(indi_simulator_wheel indidriver ${CFITSIO_LIBRARIES} m z pthread) |
---|
482 | |
---|
483 | if (NOVA_FOUND) |
---|
484 | target_link_libraries(indi_simulator_wheel ${NOVA_LIBRARIES}) |
---|
485 | endif (NOVA_FOUND) |
---|
486 | |
---|
487 | install(TARGETS indi_simulator_wheel RUNTIME DESTINATION bin ) |
---|
488 | |
---|
489 | ################################################################################# |
---|
490 | |
---|
491 | ######################################### |
---|
492 | ########### VIDEO GROUP ############### |
---|
493 | ######################################### |
---|
494 | |
---|
495 | ########### STV ####################### |
---|
496 | if (CFITSIO_FOUND) |
---|
497 | if (NOVA_FOUND) |
---|
498 | |
---|
499 | set(stv_SRCS |
---|
500 | ${indimain_SRCS} |
---|
501 | ${CMAKE_SOURCE_DIR}/drivers/video/stvdriver.c |
---|
502 | ${CMAKE_SOURCE_DIR}/drivers/video/stv.c ) |
---|
503 | |
---|
504 | add_executable(indi_sbig_stv ${stv_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
505 | |
---|
506 | target_link_libraries(indi_sbig_stv z m ${NOVA_LIBRARIES} ${CFITSIO_LIBRARIES}) |
---|
507 | |
---|
508 | install(TARGETS indi_sbig_stv RUNTIME DESTINATION bin ) |
---|
509 | |
---|
510 | endif (NOVA_FOUND) |
---|
511 | endif(CFITSIO_FOUND) |
---|
512 | |
---|
513 | ################################################################################# |
---|
514 | |
---|
515 | ### Meade Lunar Planetary Imager ######## |
---|
516 | if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") |
---|
517 | if (CFITSIO_FOUND) |
---|
518 | |
---|
519 | ADD_DEFINITIONS(-DHAVE_LINUX_VIDEODEV2_H) |
---|
520 | |
---|
521 | set(meade_lpi_SRCS |
---|
522 | ${indimain_SRCS} |
---|
523 | ${CMAKE_SOURCE_DIR}/drivers/video/v4ldriver.cpp |
---|
524 | ${CMAKE_SOURCE_DIR}/drivers/video/indi_lpi.cpp |
---|
525 | ) |
---|
526 | |
---|
527 | add_executable(indi_meade_lpi ${meade_lpi_SRCS} ${libwebcam_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
528 | |
---|
529 | target_link_libraries(indi_meade_lpi z ${CFITSIO_LIBRARIES}) |
---|
530 | |
---|
531 | if (NOVA_FOUND) |
---|
532 | target_link_libraries(indi_meade_lpi ${NOVA_LIBRARIES}) |
---|
533 | endif (NOVA_FOUND) |
---|
534 | |
---|
535 | install(TARGETS indi_meade_lpi RUNTIME DESTINATION bin ) |
---|
536 | |
---|
537 | endif (CFITSIO_FOUND) |
---|
538 | endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") |
---|
539 | |
---|
540 | ################################################################################# |
---|
541 | |
---|
542 | ########### V4L Philips ############## |
---|
543 | if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") |
---|
544 | if (CFITSIO_FOUND) |
---|
545 | |
---|
546 | set(v4lphilips_SRCS |
---|
547 | ${indimain_SRCS} |
---|
548 | ${CMAKE_SOURCE_DIR}/drivers/video/v4ldriver.cpp |
---|
549 | ${CMAKE_SOURCE_DIR}/drivers/video/v4lphilips.cpp |
---|
550 | ${CMAKE_SOURCE_DIR}/drivers/video/indi_philips.cpp |
---|
551 | ) |
---|
552 | |
---|
553 | add_executable(indi_v4l_philips ${v4lphilips_SRCS} ${libwebcam_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
554 | |
---|
555 | target_link_libraries(indi_v4l_philips m z ${CFITSIO_LIBRARIES}) |
---|
556 | |
---|
557 | if (NOVA_FOUND) |
---|
558 | target_link_libraries(indi_v4l_philips ${NOVA_LIBRARIES}) |
---|
559 | endif (NOVA_FOUND) |
---|
560 | |
---|
561 | install(TARGETS indi_v4l_philips RUNTIME DESTINATION bin ) |
---|
562 | |
---|
563 | endif (CFITSIO_FOUND) |
---|
564 | endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") |
---|
565 | |
---|
566 | ################################################################################# |
---|
567 | |
---|
568 | ########### Generic V4L Driver ############### |
---|
569 | if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") |
---|
570 | if (CFITSIO_FOUND) |
---|
571 | |
---|
572 | set(v4ldriver_SRCS |
---|
573 | ${indimain_SRCS} |
---|
574 | ${CMAKE_SOURCE_DIR}/drivers/video/v4ldriver.cpp |
---|
575 | ${CMAKE_SOURCE_DIR}/drivers/video/indi_v4l.cpp |
---|
576 | ) |
---|
577 | |
---|
578 | add_executable(indi_v4l_generic ${v4ldriver_SRCS} ${libwebcam_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
579 | |
---|
580 | target_link_libraries(indi_v4l_generic m z ${CFITSIO_LIBRARIES}) |
---|
581 | |
---|
582 | if (NOVA_FOUND) |
---|
583 | target_link_libraries(indi_v4l_generic ${NOVA_LIBRARIES}) |
---|
584 | endif (NOVA_FOUND) |
---|
585 | |
---|
586 | install(TARGETS indi_v4l_generic RUNTIME DESTINATION bin ) |
---|
587 | |
---|
588 | endif (CFITSIO_FOUND) |
---|
589 | endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") |
---|
590 | |
---|
591 | ################################################################################# |
---|
592 | |
---|
593 | ########### getINDI ############## |
---|
594 | set(getindi_SRCS |
---|
595 | ${CMAKE_SOURCE_DIR}/eventloop.c |
---|
596 | ${CMAKE_SOURCE_DIR}/tools/getINDIproperty.c |
---|
597 | ) |
---|
598 | |
---|
599 | add_executable(indi_getprop ${getindi_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
600 | |
---|
601 | target_link_libraries(indi_getprop m z) |
---|
602 | |
---|
603 | if (NOVA_FOUND) |
---|
604 | target_link_libraries(indi_getprop ${NOVA_LIBRARIES}) |
---|
605 | endif (NOVA_FOUND) |
---|
606 | |
---|
607 | |
---|
608 | install(TARGETS indi_getprop RUNTIME DESTINATION bin ) |
---|
609 | |
---|
610 | ################################################################################# |
---|
611 | |
---|
612 | ########### setINDI ############## |
---|
613 | set(setindi_SRCS |
---|
614 | ${CMAKE_SOURCE_DIR}/eventloop.c |
---|
615 | ${CMAKE_SOURCE_DIR}/tools/setINDIproperty.c |
---|
616 | ) |
---|
617 | |
---|
618 | add_executable(indi_setprop ${setindi_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
619 | |
---|
620 | target_link_libraries(indi_setprop m z) |
---|
621 | |
---|
622 | if (NOVA_FOUND) |
---|
623 | target_link_libraries(indi_setprop ${NOVA_LIBRARIES}) |
---|
624 | endif (NOVA_FOUND) |
---|
625 | |
---|
626 | |
---|
627 | install(TARGETS indi_setprop RUNTIME DESTINATION bin ) |
---|
628 | |
---|
629 | ################################################################################# |
---|
630 | |
---|
631 | ########### evelINDI ############## |
---|
632 | set(evalindi_SRCS |
---|
633 | ${CMAKE_SOURCE_DIR}/eventloop.c |
---|
634 | ${CMAKE_SOURCE_DIR}/tools/compiler.c |
---|
635 | ${CMAKE_SOURCE_DIR}/tools/evalINDI.c |
---|
636 | ) |
---|
637 | |
---|
638 | add_executable(indi_eval ${evalindi_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
639 | |
---|
640 | target_link_libraries(indi_eval m z) |
---|
641 | |
---|
642 | if (NOVA_FOUND) |
---|
643 | target_link_libraries(indi_eval ${NOVA_LIBRARIES}) |
---|
644 | endif (NOVA_FOUND) |
---|
645 | |
---|
646 | |
---|
647 | install(TARGETS indi_eval RUNTIME DESTINATION bin ) |
---|
648 | |
---|
649 | ################################################################################# |
---|
650 | ## Build Examples. Not installation |
---|
651 | ########### Tutorial one ############## |
---|
652 | set(tutorialone_SRCS |
---|
653 | ${indimain_SRCS} |
---|
654 | ${CMAKE_SOURCE_DIR}/examples/tutorial_one.c |
---|
655 | ) |
---|
656 | |
---|
657 | add_executable(tutorial_one ${tutorialone_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
658 | |
---|
659 | target_link_libraries(tutorial_one m) |
---|
660 | |
---|
661 | if (NOVA_FOUND) |
---|
662 | target_link_libraries(tutorial_one ${NOVA_LIBRARIES}) |
---|
663 | endif (NOVA_FOUND) |
---|
664 | |
---|
665 | ########### Tutorial two ############## |
---|
666 | set(tutorialtwo_SRCS |
---|
667 | ${indimain_SRCS} |
---|
668 | ${CMAKE_SOURCE_DIR}/examples/tutorial_two.c |
---|
669 | ) |
---|
670 | |
---|
671 | add_executable(tutorial_two ${tutorialtwo_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
672 | |
---|
673 | target_link_libraries(tutorial_two m) |
---|
674 | |
---|
675 | if (NOVA_FOUND) |
---|
676 | target_link_libraries(tutorial_two ${NOVA_LIBRARIES}) |
---|
677 | endif (NOVA_FOUND) |
---|
678 | |
---|
679 | ########### Tutorial three ############## |
---|
680 | set(tutorialthree_SRCS |
---|
681 | ${indimain_SRCS} |
---|
682 | ${CMAKE_SOURCE_DIR}/examples/tutorial_three.c |
---|
683 | ) |
---|
684 | |
---|
685 | add_executable(tutorial_three ${tutorialthree_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
686 | |
---|
687 | target_link_libraries(tutorial_three m z) |
---|
688 | |
---|
689 | if (NOVA_FOUND) |
---|
690 | target_link_libraries(tutorial_three ${NOVA_LIBRARIES}) |
---|
691 | endif (NOVA_FOUND) |
---|
692 | |
---|
693 | ########### Tutorial four ############## |
---|
694 | if (CFITSIO_FOUND) |
---|
695 | |
---|
696 | set(tutorialfour_SRCS |
---|
697 | ${indimain_SRCS} |
---|
698 | ${CMAKE_SOURCE_DIR}/examples/tutorial_four.cpp |
---|
699 | ) |
---|
700 | |
---|
701 | add_executable(tutorial_four ${tutorialfour_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
702 | |
---|
703 | target_link_libraries(tutorial_four indidriver ${CFITSIO_LIBRARIES} m z pthread) |
---|
704 | |
---|
705 | if (NOVA_FOUND) |
---|
706 | target_link_libraries(tutorial_four ${NOVA_LIBRARIES}) |
---|
707 | endif (NOVA_FOUND) |
---|
708 | |
---|
709 | endif (CFITSIO_FOUND) |
---|
710 | |
---|
711 | ########### Tutorial dome ############## |
---|
712 | set(tutorialdome_SRCS |
---|
713 | ${indimain_SRCS} |
---|
714 | ${CMAKE_SOURCE_DIR}/examples/tutorial_dome.c |
---|
715 | ) |
---|
716 | |
---|
717 | add_executable(tutorial_dome ${tutorialdome_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
718 | |
---|
719 | target_link_libraries(tutorial_dome m) |
---|
720 | |
---|
721 | if (NOVA_FOUND) |
---|
722 | target_link_libraries(tutorial_dome ${NOVA_LIBRARIES}) |
---|
723 | endif (NOVA_FOUND) |
---|
724 | |
---|
725 | ########### Tutorial rain ############## |
---|
726 | set(tutorialrain_SRCS |
---|
727 | ${indimain_SRCS} |
---|
728 | ${CMAKE_SOURCE_DIR}/examples/tutorial_rain.c |
---|
729 | ) |
---|
730 | |
---|
731 | add_executable(tutorial_rain ${tutorialrain_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
732 | |
---|
733 | target_link_libraries(tutorial_rain m) |
---|
734 | |
---|
735 | if (NOVA_FOUND) |
---|
736 | target_link_libraries(tutorial_rain ${NOVA_LIBRARIES}) |
---|
737 | endif (NOVA_FOUND) |
---|
738 | |
---|
739 | |
---|
740 | ########### Client Tutorial ############## |
---|
741 | set(tutorialclient_SRCS |
---|
742 | ${CMAKE_SOURCE_DIR}/examples/tutorial_client.cpp |
---|
743 | ) |
---|
744 | |
---|
745 | add_executable(tutorial_client ${tutorialclient_SRCS} ${liblilxml_SRCS} ${libindicom_SRCS}) |
---|
746 | |
---|
747 | target_link_libraries(tutorial_client indiclient m) |
---|
748 | |
---|
749 | if (NOVA_FOUND) |
---|
750 | target_link_libraries(tutorial_client ${NOVA_LIBRARIES}) |
---|
751 | endif (NOVA_FOUND) |
---|
752 | |
---|
753 | ################################################################################# |
---|
754 | |
---|
755 | install( FILES drivers.xml ${CMAKE_SOURCE_DIR}/drivers/focuser/indi_tcfs_sk.xml DESTINATION ${DATA_INSTALL_DIR}) |
---|
756 | |
---|
757 | install( FILES indiapi.h indidevapi.h base64.h eventloop.h indidriver.h ${CMAKE_SOURCE_DIR}/libs/lilxml.h ${CMAKE_SOURCE_DIR}/libs/indibase/indibase.h |
---|
758 | ${CMAKE_SOURCE_DIR}/libs/indibase/basedriver.h ${CMAKE_SOURCE_DIR}/libs/indibase/defaultdriver.h |
---|
759 | ${CMAKE_SOURCE_DIR}/libs/indibase/indiccd.h ${CMAKE_SOURCE_DIR}/libs/indibase/indifilterwheel.h |
---|
760 | ${CMAKE_SOURCE_DIR}/libs/indibase/indifocuser.h ${CMAKE_SOURCE_DIR}/libs/indibase/inditelescope.h |
---|
761 | ${CMAKE_SOURCE_DIR}/libs/indibase/baseclient.h ${CMAKE_SOURCE_DIR}/libs/indibase/indiguiderinterface.h |
---|
762 | ${CMAKE_SOURCE_DIR}/libs/indibase/indifilterinterface.h |
---|
763 | ${CMAKE_SOURCE_DIR}/libs/indicom.h ${CMAKE_SOURCE_DIR}/libs/indibase/indiusbdevice.h |
---|
764 | DESTINATION ${INCLUDE_INSTALL_DIR}/libindi COMPONENT Devel) |
---|
765 | |
---|
766 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libindi.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libindi.pc @ONLY) |
---|
767 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libindi.pc DESTINATION ${PKGCONFIG_INSTALL_PREFIX}) |
---|