source: BAORadio/libindi/libindi/CMakeLists.txt @ 642

Last change on this file since 642 was 642, checked in by frichard, 12 years ago

-Alignement des antennes
-Version 0.0.9 de libindi

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