Skip to content

Commit

Permalink
Option to use system provided httplib
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Verga <[email protected]>
  • Loading branch information
mattiaverga committed Oct 2, 2023
1 parent 6f156b4 commit 9fcc5bd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ OPTION(INDI_BUILD_SHARED "Build shared library" ON)
OPTION(INDI_BUILD_STATIC "Build static library" ON)
OPTION(INDI_BUILD_XISF "Build XISF support" ON)

# System provided or bundled libs
OPTION(INDI_SYSTEM_HTTPLIB "Use system provided httplib" OFF)

if(UNIX AND NOT APPLE)
OPTION(INDI_SHARED_MEMORY "Build INDI with support for UNIX protocol with shared memory" ON)
else()
Expand Down Expand Up @@ -165,6 +168,20 @@ install(FILES
COMPONENT Devel
)

# ##################################################################################################
# #################################### bundled libs ##############################################
# ##################################################################################################
if(INDI_SYSTEM_HTTPLIB)
find_package(httplib REQUIRED)
include_directories(${HTTPLIB_INCLUDE_DIR})
set(SYSTEM_HTTPLIB 1)
message(STATUS "Using system provided httplib version ${HTTPLIB_VERSION}")
else()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/httplib)
set(SYSTEM_HTTPLIB 0)
message(STATUS "Using bundled httplib")
endif(INDI_SYSTEM_HTTPLIB)

# ###################################################################################################
#
# Component : INDI Core
Expand Down Expand Up @@ -381,11 +398,16 @@ endif()
if(INDI_BUILD_DRIVERS OR INDI_BUILD_CLIENT OR INDI_BUILD_QT5_CLIENT)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/libs/json.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/httplib.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/inicpp.h
${CMAKE_CURRENT_BINARY_DIR}/indiversion.h
DESTINATION ${INCLUDE_INSTALL_DIR}/libindi COMPONENT Devel
)
if(NOT SYSTEM_HTTPLIB)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/libs/httplib/httplib.h
DESTINATION ${INCLUDE_INSTALL_DIR}/libindi COMPONENT Devel
)
endif(NOT SYSTEM_HTTPLIB)
endif(INDI_BUILD_DRIVERS OR INDI_BUILD_CLIENT OR INDI_BUILD_QT5_CLIENT)

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Expand Down
2 changes: 1 addition & 1 deletion drivers/telescope/planewave_mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "planewave_mount.h"

#include "indicom.h"
#include "httplib.h"
#include <httplib.h>
#include "connectionplugins/connectiontcp.h"
#include <libnova/sidereal_time.h>
#include <libnova/transform.h>
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 9fcc5bd

Please sign in to comment.