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