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