forked from indilib/indi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
2112 lines (1646 loc) · 84.6 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
cmake_minimum_required(VERSION 3.0)
PROJECT(libindi C CXX)
# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules/")
include(GNUInstallDirs)
include(FeatureSummary)
if(ANDROID OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
set(ANDROID ON)
add_definitions(-DANDROID)
endif()
include(CMakeCommon)
# Clang Format support
IF (UNIX OR APPLE)
SET(FORMAT_CODE OFF CACHE BOOL "Enable Clang Format")
IF (FORMAT_CODE MATCHES ON)
FILE(GLOB_RECURSE ALL_SOURCE_FILES *.c *.cpp *.h)
FOREACH(SOURCE_FILE ${ALL_SOURCE_FILES})
STRING(FIND ${SOURCE_FILE} ${CMAKE_SOURCE_DIR} DIR_FOUND)
IF (NOT ${DIR_FOUND} EQUAL 0)
LIST(REMOVE_ITEM ALL_SOURCE_FILES ${SOURCE_FILE})
ENDIF ()
ENDFOREACH ()
FIND_PROGRAM(CLANGFORMAT_EXE NAMES clang-format-5.0)
IF (CLANGFORMAT_EXE)
ADD_CUSTOM_TARGET(clang-format COMMAND ${CLANGFORMAT_EXE} -style=file -i ${ALL_SOURCE_FILES})
ENDIF ()
ENDIF ()
ENDIF ()
##################################### INDI version ################################################
# N.B. DO NOT Forget to update version also in indiapi.h
# Proper way is to use indiversion.h.cmake file but this would break make existing applications so let us stick to the old proven way
set(INDI_SOVERSION "1")
set(CMAKE_INDI_VERSION_MAJOR 1)
set(CMAKE_INDI_VERSION_MINOR 9)
set(CMAKE_INDI_VERSION_RELEASE 3)
set(CMAKE_INDI_VERSION_STRING "${CMAKE_INDI_VERSION_MAJOR}.${CMAKE_INDI_VERSION_MINOR}.${CMAKE_INDI_VERSION_RELEASE}")
set(INDI_VERSION ${CMAKE_INDI_VERSION_MAJOR}.${CMAKE_INDI_VERSION_MINOR}.${CMAKE_INDI_VERSION_RELEASE})
execute_process(
COMMAND git describe --tags
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE GIT_TAG_RESULT
)
if (NOT ${GIT_TAG_RESULT} EQUAL 0)
set(GIT_TAG "${CMAKE_INDI_VERSION_STRING}-tgz")
endif()
add_definitions(-DGIT_TAG_STRING=\"${GIT_TAG}\")
######################################## Paths ###################################################
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/indi/")
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
IF(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
ENDIF(APPLE)
################################## Install Directories ###########################################
## the following are directories where stuff will be installed to
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/")
set(PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
set(UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")
set(PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
##################################### Build Options ##############################################
# Select which components to build and what options to apply
OPTION (INDI_BUILD_SERVER "Build INDI Server" ON)
OPTION (INDI_BUILD_DRIVERS "Build INDI Drivers, Tools, and Examples" ON)
OPTION (INDI_BUILD_CLIENT "Build INDI POSIX Client" ON)
OPTION (INDI_BUILD_QT5_CLIENT "Build INDI Qt5 Client" OFF)
OPTION (INDI_BUILD_UNITTESTS "Build INDI tests" OFF)
OPTION (INDI_BUILD_WEBSOCKET "Build INDI with Websocket support" OFF)
OPTION (INDI_FAST_BLOB "Build INDI with Fast BLOB support" ON)
OPTION (INDI_CALCULATE_MINMAX "Calculate and store image minimum and maximum values in FITS header" OFF)
###################################################################################################
######################################### Fast Blob #############################################
###################################################################################################
IF (INDI_FAST_BLOB)
# Append ENCLEN attribute to outgoing BLOB elements to enable fast parsing by clients
add_definitions(-DWITH_ENCLEN)
ENDIF(INDI_FAST_BLOB)
###################################################################################################
###################################### Calculate Min/Max #########################################
###################################################################################################
IF (INDI_CALCULATE_MINMAX)
# Calculate Min/Max values to store them in FITS header
add_definitions(-DWITH_MINMAX)
ENDIF(INDI_CALCULATE_MINMAX)
###################################################################################################
##################################### Components ################################################
###################################################################################################
set_package_properties(Nova PROPERTIES DESCRIPTION "A general purpose, double precision, Celestial Mechanics, Astrometry and Astrodynamics library" URL "http://libnova.sourceforge.net" TYPE REQUIRED PURPOSE "Provides INDI with astrodynamics library.")
set_package_properties(CFITSIO PROPERTIES DESCRIPTION "A library for reading and writing data files in FITS (Flexible Image Transport System) data format" URL "http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html" TYPE REQUIRED PURPOSE "Provides INDI with FITS I/O support.")
####################################################################################################
#
# Component : INDI Server
# Dependencies: pthreads
# Supported OS: Linux, BSD, MacOS, Cygwin
#
#################################################################################################
if (INDI_BUILD_SERVER)
if (WIN32 OR ANDROID)
message(WARNING "INDI Server is only supported under Linux, BSD, MacOS, and Cygwin while current system is " ${CMAKE_SYSTEM_NAME})
else()
# 1. Dependencies
find_package(Threads REQUIRED)
# 2. Includes
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
# 3. Build
SET(indiserver_SRC
${CMAKE_CURRENT_SOURCE_DIR}/indiserver.c
${CMAKE_CURRENT_SOURCE_DIR}/fq.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/lilxml.c)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indiserver indiserver_SRC 10 c)
ENDIF ()
add_executable(indiserver ${indiserver_SRC})
target_link_libraries(indiserver ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS indiserver RUNTIME DESTINATION bin)
endif (WIN32 OR ANDROID)
endif (INDI_BUILD_SERVER)
#################################################################################################
#
# Component : INDI Client
# Dependencies: zlib, cfitsio
# Supported OS: Linux, BSD, MacOS, Windows, Cygwin
# N.B. Windows support pending migration of networking code
#################################################################################################
if (INDI_BUILD_CLIENT AND NOT ANDROID)
# 1. Dependencies
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(CFITSIO REQUIRED)
# 2. Includes
include_directories( ${CMAKE_CURRENT_BINARY_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/timer)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/thread)
include_directories( ${ZLIB_INCLUDE_DIR})
include_directories( ${CFITSIO_INCLUDE_DIR})
# 3. Build
SET(indiclient_C_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/lilxml.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/userio.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/indiuserio.c
${CMAKE_CURRENT_SOURCE_DIR}/base64.c)
SET(indiclient_CXX_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/libastro.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/basedevice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/baseclient.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indiproperty.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indiproperties.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertybasic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertytext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertynumber.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyswitch.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertylight.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyblob.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyview_client.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indistandardproperty.cpp)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indiclient_c indiclient_C_SRC 10 c)
ENABLE_UNITY_BUILD(indiclient_cxx indiclient_CXX_SRC 10 cpp)
ENDIF ()
SET(indiclient_C_SRC ${indiclient_C_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/libs/indicom.c)
add_library(indiclient STATIC ${indiclient_C_SRC} ${indiclient_CXX_SRC})
if (NOT CYGWIN AND NOT WIN32)
set_target_properties(indiclient PROPERTIES COMPILE_FLAGS "-fPIC")
endif (NOT CYGWIN AND NOT WIN32)
target_link_libraries(indiclient ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS indiclient ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/baseclient.h DESTINATION ${INCLUDE_INSTALL_DIR}/libindi COMPONENT Devel)
endif (INDI_BUILD_CLIENT AND NOT ANDROID)
#################################################################################################
#
# Component : INDI Qt5 Client
# Dependencies: Qt5Network, zlib, cfitsio, Qt5Core
# Supported OS: Linux, BSD, MacOS, Cygwin, Windows, Android
#
#################################################################################################
if (INDI_BUILD_QT5_CLIENT)
set(QT_ANDROID "" CACHE path "Qt Android path")
# Tell CMake to run moc when necessary:
set(CMAKE_AUTOMOC ON)
# 1. Dependencies
if (ANDROID)
set(Qt5Core_DIR "${QT_ANDROID}/lib/cmake/Qt5Core")
include(${QT_ANDROID}/lib/cmake/Qt5/Qt5Config.cmake)
include(${QT_ANDROID}/lib/cmake/Qt5Core/Qt5CoreConfig.cmake)
include(${QT_ANDROID}/lib/cmake/Qt5Network/Qt5NetworkConfig.cmake)
if (NOT CFITSIO_DIR)
message(FATAL_ERROR CFITSIO_DIR must be set)
else ()
set(CFITSIO_INCLUDE_DIR ${CFITSIO_DIR})
set(CFITSIO_LIBRARIES ${CFITSIO_DIR}/libcfitsio.a)
endif ()
else ()
find_package(Qt5Network REQUIRED)
find_package(ZLIB REQUIRED)
find_package(CFITSIO REQUIRED)
endif ()
# 2. Includes
include_directories( ${CMAKE_CURRENT_BINARY_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase)
include_directories( ${CFITSIO_INCLUDE_DIR})
# 3. Build
message(STATUS "Building INDI Client with Qt5 support")
SET(indiclientqt_C_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/lilxml.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/userio.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/indiuserio.c
${CMAKE_CURRENT_SOURCE_DIR}/base64.c)
SET(indiclientqt_CXX_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/libastro.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/basedevice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/baseclientqt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indiproperty.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indiproperties.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertybasic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertytext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertynumber.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyswitch.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertylight.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyblob.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyview_client.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indistandardproperty.cpp)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indiclientqt_c indiclientqt_C_SRC 10 c)
ENABLE_UNITY_BUILD(indiclientqt_cxx indiclientqt_CXX_SRC 10 cpp)
ENDIF ()
SET(indiclientqt_C_SRC ${indiclientqt_C_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/libs/indicom.c)
add_library(indiclientqt STATIC ${indiclientqt_C_SRC} ${indiclientqt_CXX_SRC})
if (NOT CYGWIN AND NOT WIN32)
set_target_properties(indiclientqt PROPERTIES COMPILE_FLAGS "-fPIC")
endif(NOT CYGWIN AND NOT WIN32)
target_link_libraries(indiclientqt Qt5::Network)
if (WIN32 OR ANDROID)
install(TARGETS indiclientqt ARCHIVE DESTINATION lib)
else(WIN32 OR ANDROID)
install(TARGETS indiclientqt ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif(WIN32 OR ANDROID)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/baseclientqt.h DESTINATION ${INCLUDE_INSTALL_DIR}/libindi COMPONENT Devel)
endif (INDI_BUILD_QT5_CLIENT)
####################################################################################################
#
# Component : Websocket
# Dependencies: libwebsocketpp, libboost, asio
# Supported OS: Linux, BSD, MacOS, Cygwin
#
#################################################################################################
if (INDI_BUILD_WEBSOCKET)
find_package(websocketpp REQUIRED)
find_package(Boost COMPONENTS system thread)
include_directories (${Boost_INCLUDE_DIRS})
add_definitions(-DHAVE_WEBSOCKET)
SET(HAVE_WEBSOCKET 1)
endif (INDI_BUILD_WEBSOCKET)
#################################################################################################
#
# Component : INDI Drivers, Tools, and Examples
# Dependencies: pthreads, usb1, zLib, cfitsio, nova, curl, jpeg (Linux Only)
# Supported OS: Linux, BSD, MacOS, Cygwin
# N.B. Webcam drivers only supported under Linux (Video4Linux2). Joystick support only under Linux
#
#################################################################################################
if (INDI_BUILD_DRIVERS)
if (WIN32 OR ANDROID)
message(WARNING "INDI drivers are only supported under Linux, BSD, MacOS, and Cygwin while current system is " ${CMAKE_SYSTEM_NAME})
else(WIN32 OR ANDROID)
# 1. Dependencies
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(CFITSIO REQUIRED)
find_package(Nova REQUIRED)
find_package(USB1 REQUIRED)
find_package(CURL REQUIRED)
find_package(GSL REQUIRED)
find_package(JPEG REQUIRED)
# Math Library
FIND_LIBRARY(M_LIB m)
# 2. Includes
include_directories( ${CMAKE_CURRENT_BINARY_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/stream)
include_directories( ${CFITSIO_INCLUDE_DIR})
include_directories( ${NOVA_INCLUDE_DIR})
include_directories( ${USB1_INCLUDE_DIRS})
include_directories( ${GSL_INCLUDE_DIRS})
include_directories( ${JPEG_INCLUDE_DIR})
IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/webcam)
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-usb.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-usb.h)
###################################################################################################
######################################## Sources ################################################
###################################################################################################
IF (APPLE)
SET(hidapi_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/hid_mac.c)
ELSEIF (WIN32)
SET(hidapi_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/hid_win.c)
ELSE ()
SET(hidapi_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/hid_libusb.c)
ENDIF()
IF (UNIX)
find_package(OggTheora)
IF (OGGTHEORA_FOUND)
INCLUDE_DIRECTORIES(${THEORA_INCLUDE_DIRS})
SET(HAVE_THEORA 1)
SET (theorarecorder_CXX_SRC ${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/recorder/theorarecorder.cpp)
ENDIF(OGGTHEORA_FOUND)
SET(libstream_CXX_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/streammanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/fpsmeter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/gammalut16.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/recorder/recorderinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/recorder/recordermanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/recorder/serrecorder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/encoder/encodermanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/encoder/encoderinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/encoder/rawencoder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/encoder/mjpegencoder.cpp
${theorarecorder_CXX_SRC}
)
SET(libstream_C_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/jpegutils.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/ccvt_c2.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/stream/ccvt_misc.c)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(libstream libstream_C_SRC 10 c)
ENABLE_UNITY_BUILD(libstream libstream_CXX_SRC 10 cpp)
ENDIF ()
IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
SET(libwebcam_C_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/webcam/v4l2_colorspace.c)
SET(libwebcam_CXX_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/webcam/v4l2_base.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/webcam/v4l2_decode/v4l2_decode.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/webcam/v4l2_decode/v4l2_builtin_decoder.cpp
)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(libwebcam libwebcam_C_SRC 10 c)
ENABLE_UNITY_BUILD(libwebcam libwebcam_CXX_SRC 10 cpp)
ENDIF (UNITY_BUILD)
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
ENDIF(UNIX)
SET(libdsp_C_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/file.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/buffer.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/convert.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/fft.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/filters.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/signals.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/convolution.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/stats.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp/stream.c
)
set(fpack_C_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/fpack/fpack.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/fpack/fpackutil.c
)
SET(indidriver_C_SRC
${CMAKE_CURRENT_SOURCE_DIR}/indidriver.c
${CMAKE_CURRENT_SOURCE_DIR}/indidrivermain.c
${CMAKE_CURRENT_SOURCE_DIR}/eventloop.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/lilxml.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/userio.c
${CMAKE_CURRENT_SOURCE_DIR}/libs/indiuserio.c
${CMAKE_CURRENT_SOURCE_DIR}/base64.c
)
SET(indidriver_CXX_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/libastro.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/basedevice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/defaultdevice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indiproperty.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indiproperties.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertybasic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertytext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertynumber.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyswitch.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertylight.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyblob.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/property/indipropertyview_driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/timer/inditimer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/timer/indielapsedtimer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/thread/indisinglethreadpool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indiutility.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indiccd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indiccdchip.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indisensorinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indicorrelator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indidetector.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indispectrograph.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indireceiver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/inditelescope.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indifilterwheel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indifocuserinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indiweatherinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indifocuser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indirotator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indiusbdevice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indiguiderinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indifilterinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indirotatorinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indidome.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indigps.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indiweather.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indidustcapinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indilightboxinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indilogger.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indicontroller.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indistandardproperty.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/connectionplugins/connectioninterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/connectionplugins/connectionserial.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/connectionplugins/connectiontcp.cpp
#${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/connectionplugins/ttybase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/dsp/manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/dsp/dspinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/dsp/transforms.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/dsp/convolution.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/pid/pid.cpp
)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(indidriver_c indidriver_C_SRC libdsp_C_SRC fpack_C_SRC 10 c)
ENABLE_UNITY_BUILD(indidriver_cxx indidriver_CXX_SRC 10 cpp)
ENDIF ()
SET(indidriver_C_SRC
${indidriver_C_SRC}
${libdsp_C_SRC}
${fpack_C_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/libs/indicom.c)
##################################################
########## INDI Default Driver Library ###########
##################################################
if (CYGWIN)
## For Cygwin we only build static library
add_definitions(-U__STRICT_ANSI__)
find_package(FFTW3 REQUIRED)
find_package(Iconv REQUIRED)
add_library(indidriver STATIC ${indidriver_C_SRC} ${indidriver_CXX_SRC} ${libstream_C_SRC} ${libstream_CXX_SRC} ${hidapi_SRCS} ${libdsp_C_SRC} ${fpack_C_SRC})
target_compile_definitions(indidriver PRIVATE "-DHAVE_LIBNOVA")
set_target_properties(indidriver PROPERTIES VERSION ${CMAKE_INDI_VERSION_STRING} SOVERSION ${INDI_SOVERSION} OUTPUT_NAME indidriver)
target_link_libraries(indidriver ${ICONV_LIBRARIES} ${USB1_LIBRARIES} ${NOVA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CFITSIO_LIBRARIES} ${M_LIB} ${ZLIB_LIBRARY} ${JPEG_LIBRARY} ${FFTW3_LIBRARIES})
IF (OGGTHEORA_FOUND)
target_link_libraries(indidriver ${OGGTHEORA_LIBRARIES} ${THEORA_LIBRARIES})
ENDIF()
IF (HAVE_WEBSOCKET)
target_link_libraries(indidriver ${Boost_LIBRARIES})
ENDIF()
install(TARGETS indidriver ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
## Static indidriver Library
find_package(FFTW3 REQUIRED)
add_library(indidriverstatic STATIC ${indidriver_C_SRC} ${indidriver_CXX_SRC} ${libstream_C_SRC} ${libstream_CXX_SRC} ${libwebcam_C_SRC} ${libwebcam_CXX_SRC} ${hidapi_SRCS} ${libdsp_C_SRC} ${fpack_C_SRC})
set_target_properties(indidriverstatic PROPERTIES COMPILE_FLAGS "-fPIC")
target_compile_definitions(indidriverstatic PRIVATE "-DHAVE_LIBNOVA")
set_target_properties(indidriverstatic PROPERTIES VERSION ${CMAKE_INDI_VERSION_STRING} SOVERSION ${INDI_SOVERSION} OUTPUT_NAME indidriver)
target_link_libraries(indidriverstatic ${USB1_LIBRARIES} ${NOVA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CFITSIO_LIBRARIES} ${M_LIB} ${ZLIB_LIBRARY} ${JPEG_LIBRARY} ${FFTW3_LIBRARIES})
IF (OGGTHEORA_FOUND)
target_link_libraries(indidriverstatic ${OGGTHEORA_LIBRARIES} ${THEORA_LIBRARIES})
ENDIF()
IF (HAVE_WEBSOCKET)
target_link_libraries(indidriverstatic ${Boost_LIBRARIES})
ENDIF()
install(TARGETS indidriverstatic ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
## Dynamic indidriver Library
find_package(FFTW3 REQUIRED)
add_library(indidriver SHARED ${indidriver_C_SRC} ${indidriver_CXX_SRC} ${libstream_C_SRC} ${libstream_CXX_SRC} ${libwebcam_C_SRC} ${libwebcam_CXX_SRC} ${hidapi_SRCS} ${libdsp_C_SRC} ${fpack_C_SRC})
set_target_properties(indidriver PROPERTIES COMPILE_FLAGS "-fPIC")
target_compile_definitions(indidriver PRIVATE "-DHAVE_LIBNOVA")
set_target_properties(indidriver PROPERTIES VERSION ${CMAKE_INDI_VERSION_STRING} SOVERSION ${INDI_SOVERSION} OUTPUT_NAME indidriver)
target_link_libraries(indidriver ${ICONV_LIBRARIES} ${USB1_LIBRARIES} ${NOVA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CFITSIO_LIBRARIES} ${M_LIB} ${ZLIB_LIBRARY} ${JPEG_LIBRARY} ${FFTW3_LIBRARIES})
IF (OGGTHEORA_FOUND)
target_link_libraries(indidriver ${OGGTHEORA_LIBRARIES} ${THEORA_LIBRARIES})
ENDIF()
IF (HAVE_WEBSOCKET)
target_link_libraries(indidriver ${Boost_LIBRARIES})
ENDIF()
#IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# target_link_libraries(indidriver -lpthread)
#ENDIF ()
install(TARGETS indidriver LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
set(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lindidriver -lindiAlignmentDriver")
endif(CYGWIN)
IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
# FreeBSD needs to find the correct GNU iconv library.
find_package(Iconv REQUIRED)
# The indidriver library is defined earlier in the file before the
# find has been run. Add an explicit link to avoid runtime errors.
target_link_libraries(indidriver ${ICONV_LIBRARIES})
ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
##################################################
########### INDI Alignment Subsystem #############
##################################################
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/alignment)
#####################################
######## AGENT GROUP ################
#####################################
########### Imager ##############
set(imager_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/drivers/agent/agent_imager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/agent/group.cpp
)
add_executable(indi_imager_agent ${imager_SRCS})
target_link_libraries(indi_imager_agent indidriver indiclient)
install(TARGETS indi_imager_agent RUNTIME DESTINATION bin)
#################################################################################
#####################################
########## TELESCOPE GROUP ##########
#####################################
####################################################################################################
#
# Component : LX200 Library
# Dependencies: pthreads
# Supported OS: Linux, BSD, MacOS, Cygwin
#
#################################################################################################
SET(lx200library_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200telescope.cpp
)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(lx200library lx200library_SRCS 10 cpp)
ENDIF ()
add_library(indilx200 SHARED ${lx200library_SRCS})
if (NOT CYGWIN AND NOT WIN32)
set_target_properties(indilx200 PROPERTIES COMPILE_FLAGS "-fPIC")
endif (NOT CYGWIN AND NOT WIN32)
target_compile_definitions(indilx200 PRIVATE "-DHAVE_LIBNOVA")
set_target_properties(indilx200 PROPERTIES VERSION ${CMAKE_INDI_VERSION_STRING} SOVERSION ${INDI_SOVERSION} OUTPUT_NAME indilx200)
install(TARGETS indilx200 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200telescope.h
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200driver.h
DESTINATION ${INCLUDE_INSTALL_DIR}/libindi/mounts COMPONENT Devel)
#################################################################################
########### LX200 Basic #############
SET(lx200basic_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200basic.cpp)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(lx200basic lx200basic_SRC 10 cpp)
ENDIF ()
add_executable(indi_lx200basic ${lx200basic_SRC})
target_link_libraries(indi_lx200basic indidriver)
install(TARGETS indi_lx200basic RUNTIME DESTINATION bin)
#################################################################################
########### LX200 TeenAstro #############
SET(lx200_TeenAstro_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200_TeenAstro.cpp)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(lx200_TeenAstro lx200_TeenAstro_SRC 10 cpp)
ENDIF ()
add_executable(indi_lx200_TeenAstro ${lx200_TeenAstro_SRC})
target_link_libraries(indi_lx200_TeenAstro indidriver)
install(TARGETS indi_lx200_TeenAstro RUNTIME DESTINATION bin)
#################################################################################
########### LX200 Generic ###########
SET(lx200generic_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200autostar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200_16.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200gps.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200generic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200telescope.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200classic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200apdriver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200gemini.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200zeq25.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200gotonova.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200pulsar2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200ap_experimentaldriver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200ap_experimental.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200ap.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200ap_gtocp2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200fs2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200ss2000pc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200_OnStep.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200_10micron.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/ioptronHC8406.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/eq500x.cpp)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(lx200generic lx200generic_SRCS 10 cpp)
ENDIF ()
add_executable(indi_lx200generic ${lx200generic_SRCS})
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
target_compile_definitions(indi_lx200generic PRIVATE -D_XOPEN_SOURCE=700)
ELSE()
target_compile_definitions(indi_lx200generic PRIVATE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200809L)
ENDIF()
target_link_libraries(indi_lx200generic indidriver)
install(TARGETS indi_lx200generic RUNTIME DESTINATION bin )
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_lx200generic_symlink.cmake
"exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200classic)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200autostar)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200_16)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200gps)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200ap_experimental)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200ap_gtocp2)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200ap)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200gemini)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200zeq25)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200gotonova)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200pulsar2)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200fs2)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200ss2000pc)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200_OnStep)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_lx200_10micron)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_ioptronHC8406)\n
exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink indi_lx200generic \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_eq500x_telescope)\n
")
set_target_properties(indi_lx200generic PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_lx200generic_symlink.cmake)
#################################################################################
########### Celestron GPS ############
SET(celestrongps_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/celestrondriver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/celestrongps.cpp)
add_executable(indi_celestron_gps ${celestrongps_SRC})
target_link_libraries(indi_celestron_gps indidriver)
install(TARGETS indi_celestron_gps RUNTIME DESTINATION bin)
#################################################################################
########### Rainbow Mount driver ##########
SET(rainbow_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/rainbow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/lx200driver.cpp
)
add_executable(indi_rainbow_telescope ${rainbow_SRC})
target_link_libraries(indi_rainbow_telescope indidriver)
install(TARGETS indi_rainbow_telescope RUNTIME DESTINATION bin)
########### HOBYM / TitanTCS for CRUX Mount ##########
SET(crux_mount_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/crux_mount.cpp
)
add_executable(indi_crux_mount ${crux_mount_SRC})
target_link_libraries(indi_crux_mount indidriver)
install(TARGETS indi_crux_mount RUNTIME DESTINATION bin)
#################################################################################
########### Takahashi Temma ##########
SET(temma_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/temmadriver.cpp )
add_executable(indi_temma_telescope ${temma_SRC})
target_link_libraries(indi_temma_telescope indidriver AlignmentDriver)
install(TARGETS indi_temma_telescope RUNTIME DESTINATION bin)
#################################################################################
########### Paramount ##########
SET(paramount_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/paramount.cpp)
add_executable(indi_paramount_telescope ${paramount_SRC})
target_link_libraries(indi_paramount_telescope indidriver)
install(TARGETS indi_paramount_telescope RUNTIME DESTINATION bin)
########### Astrotrac ##########
SET(astrotrac_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/astrotrac.cpp)
add_executable(indi_astrotrac_telescope ${astrotrac_SRC})
target_link_libraries(indi_astrotrac_telescope indidriver AlignmentDriver)
install(TARGETS indi_astrotrac_telescope RUNTIME DESTINATION bin)
#################################################################################
########### Syncscan ###############
SET(synscan_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/synscandriver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/synscanmount.cpp)
add_executable(indi_synscan_telescope ${synscan_SRC})
target_link_libraries(indi_synscan_telescope indidriver AlignmentDriver)
install(TARGETS indi_synscan_telescope RUNTIME DESTINATION bin)
########### Syncscan Legacy ###############
SET(synscanlegacy_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/synscandriverlegacy.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/synscanmountlegacy.cpp)
add_executable(indi_synscanlegacy_telescope ${synscanlegacy_SRC})
target_link_libraries(indi_synscanlegacy_telescope indidriver AlignmentDriver)
install(TARGETS indi_synscanlegacy_telescope RUNTIME DESTINATION bin)
########### Sky Commander ###############
SET(skycommander_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/skycommander.cpp)
add_executable(indi_skycommander_telescope ${skycommander_SRC})
target_link_libraries(indi_skycommander_telescope indidriver)
install(TARGETS indi_skycommander_telescope RUNTIME DESTINATION bin)
########### Generic Digital Setting Circle ###############
SET(dsc_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/dsc.cpp)
add_executable(indi_dsc_telescope ${dsc_SRC})
target_link_libraries(indi_dsc_telescope indidriver AlignmentDriver)
install(TARGETS indi_dsc_telescope RUNTIME DESTINATION bin)
########### IEQ Pro Legacy #############
SET(ieqlegacy_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/ieqprolegacydriver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/ieqprolegacy.cpp)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(ieqlegacy ieqlegacy_SRC 10 cpp)
ENDIF ()
add_executable(indi_ieqlegacy_telescope ${ieqlegacy_SRC})
target_link_libraries(indi_ieqlegacy_telescope indidriver)
install(TARGETS indi_ieqlegacy_telescope RUNTIME DESTINATION bin)
########### IEQ Pro #############
SET(ieq_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/ieqdriverbase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/ieqpro.cpp)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(ieq ieq_SRC 10 cpp)
ENDIF ()
add_executable(indi_ieq_telescope ${ieq_SRC})
target_link_libraries(indi_ieq_telescope indidriver)
install(TARGETS indi_ieq_telescope RUNTIME DESTINATION bin)
########### IOptronV3 / CEM120 #############
SET(ioptronv3_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/ioptronv3driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/ioptronv3.cpp)
IF (UNITY_BUILD)
ENABLE_UNITY_BUILD(ioptronv3 ioptronv3_SRC 10 cpp)
ENDIF ()
add_executable(indi_ioptronv3_telescope ${ioptronv3_SRC})
target_link_libraries(indi_ioptronv3_telescope indidriver)
install(TARGETS indi_ioptronv3_telescope RUNTIME DESTINATION bin)
########### Explore Scientific PMC8 #############
SET(pmc8_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/pmc8driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/pmc8.cpp)
add_executable(indi_pmc8_telescope ${pmc8_SRC})
target_link_libraries(indi_pmc8_telescope indidriver)
install(TARGETS indi_pmc8_telescope RUNTIME DESTINATION bin)
########### Telescope Simulator ##############
SET(telescopesimulator_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/telescope_simulator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/scopesim_helper.cpp)
add_executable(indi_simulator_telescope ${telescopesimulator_SRC})
target_link_libraries(indi_simulator_telescope indidriver)
install(TARGETS indi_simulator_telescope RUNTIME DESTINATION bin)
########### Telescope Scripting Gateway ##############
SET(telescopescript_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/telescope/telescope_script.cpp)
add_executable(indi_script_telescope ${telescopescript_SRC})
target_link_libraries(indi_script_telescope indidriver)
install(TARGETS indi_script_telescope RUNTIME DESTINATION bin)
########### CCD Simulator ##############
SET(ccdsimulator_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/ccd/ccd_simulator.cpp)
add_executable(indi_simulator_ccd ${ccdsimulator_SRC})
target_link_libraries(indi_simulator_ccd indidriver)
install(TARGETS indi_simulator_ccd RUNTIME DESTINATION bin)
########### Guide Simulator ##############
SET(guidesimulator_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/ccd/guide_simulator.cpp)
add_executable(indi_simulator_guide ${guidesimulator_SRC})
target_link_libraries(indi_simulator_guide indidriver)
install(TARGETS indi_simulator_guide RUNTIME DESTINATION bin)
#####################################
########## FOCUSER GROUP ############
#####################################
#################################################################################
################ Focuser Simulator ################
SET(focussimulator_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/focus_simulator.cpp)
add_executable(indi_simulator_focus ${focussimulator_SRC})
target_link_libraries(indi_simulator_focus indidriver)
install(TARGETS indi_simulator_focus RUNTIME DESTINATION bin)
################ Robo Focuser ################
SET(robofocus_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/robofocus.cpp)
add_executable(indi_robo_focus ${robofocus_SRC})
target_link_libraries(indi_robo_focus indidriver)
install(TARGETS indi_robo_focus RUNTIME DESTINATION bin)
################ Robo Focuser ################
SET(fcusb_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/fcusb.cpp)
add_executable(indi_fcusb_focus ${fcusb_SRC})
target_link_libraries(indi_fcusb_focus indidriver)
install(TARGETS indi_fcusb_focus RUNTIME DESTINATION bin)
################ Rigelsys NFocus Focuser ################
SET(nfocus_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/nfocus.cpp)
add_executable(indi_nfocus ${nfocus_SRC})
target_link_libraries(indi_nfocus indidriver)
install(TARGETS indi_nfocus RUNTIME DESTINATION bin)
################ Rigelsys NStep Focuser ################
SET(nstep_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/nstep.cpp)
add_executable(indi_nstep_focus ${nstep_SRC})
target_link_libraries(indi_nstep_focus indidriver)
install(TARGETS indi_nstep_focus RUNTIME DESTINATION bin)
################ PlaneWave EFA ################
SET(efa_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/planewave_efa.cpp)
add_executable(indi_efa_focus ${efa_SRC})
target_link_libraries(indi_efa_focus indidriver)
install(TARGETS indi_efa_focus RUNTIME DESTINATION bin)
################ Celestron SCT Focuser ################
SET(celestronsct_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/celestronauxpacket.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/celestron.cpp)
add_executable(indi_celestron_sct_focus ${celestronsct_SRC})
target_link_libraries(indi_celestron_sct_focus indidriver)
install(TARGETS indi_celestron_sct_focus RUNTIME DESTINATION bin)
################ AAF2 Focuser ################
SET(aaf2_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/aaf2.cpp)
add_executable(indi_aaf2_focus ${aaf2_SRC})
target_link_libraries(indi_aaf2_focus indidriver)
install(TARGETS indi_aaf2_focus RUNTIME DESTINATION bin)
################ AAF2 Focuser ################
SET(rbfocus_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/rbfocus.cpp)
add_executable(indi_rbfocus_focus ${rbfocus_SRC})
target_link_libraries(indi_rbfocus_focus indidriver)
install(TARGETS indi_rbfocus_focus RUNTIME DESTINATION bin)
################ Moonlite Focuser ################
SET(moonlite_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/focuser/moonlite.cpp)
add_executable(indi_moonlite_focus ${moonlite_SRC})
target_link_libraries(indi_moonlite_focus indidriver)
install(TARGETS indi_moonlite_focus RUNTIME DESTINATION bin)
################ Moonlite DRO Dual Focuser ################
SET(moonlitedro_SRC