Skip to content

Commit

Permalink
Make libraw support build optional
Browse files Browse the repository at this point in the history
Build in by default if libraw is found, but make it optional for builds
were it's not needed, like smtk2ssrf or subsurface-downloader.

Signed-off-by: Salvador Cuñat <[email protected]>
  • Loading branch information
salvadorcunat authored and mikeller committed Sep 30, 2024
1 parent 821f3fc commit f81cf77
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ option(NO_USERMANUAL "don't include a viewer for the user manual" OFF)
#Options regarding enabling parts of subsurface
option(BTSUPPORT "enable support for QtBluetooth" ON)
option(FTDISUPPORT "enable support for libftdi based serial" OFF)
option(LIBRAW_SUPPORT "enable support for LibRaw images" ON)

# Options regarding What should we build on subsurface
option(MAKE_TESTS "Make the tests" ON)
Expand Down Expand Up @@ -169,10 +170,6 @@ if(NOT ANDROID)
pkg_config_library(LIBRAW libraw )
endif()

if(LIBRAW_FOUND)
add_definitions(-DLIBRAW_SUPPORT)
endif()

include_directories(.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}
Expand Down Expand Up @@ -300,6 +297,7 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DownloaderExecutable")
set(SUBSURFACE_TARGET subsurface-downloader)
endif()
set(BTSUPPORT ON)
set(LIBRAW_SUPPORT OFF)
add_definitions(-DSUBSURFACE_DOWNLOADER)
message(STATUS "building the embedded Subsurface-downloader app")
endif()
Expand Down Expand Up @@ -363,6 +361,14 @@ if(BTSUPPORT)
add_definitions(-DBLE_SUPPORT)
endif()

if (LIBRAW_SUPPORT)
if(LIBRAW_FOUND)
add_definitions(-DLIBRAW_SUPPORT)
endif()
else()
message(STATUS "building without built-in libraw support")
endif()

if(ANDROID)
# when building for Android, the toolchain file requires all cmake modules
# to be inside the CMAKE_FIND_ROOT_PATH - which prevents cmake from finding
Expand Down
1 change: 1 addition & 0 deletions scripts/smtk2ssrf-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ cmake -DBTSUPPORT=OFF \
-DNO_DOCS=ON \
-DNO_PRINTING=ON \
-DNO_USERMANUAL=ON \
-DLIBRAW_SUPPORT=OFF \
-DSUBSURFACE_TARGET_EXECUTABLE=DesktopExecutable \
build
cd build || aborting "Couldn't cd into $SSRF_PATH/build directory"
Expand Down
2 changes: 0 additions & 2 deletions smtk-import/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ pkg_config_library(GLIB2 glib-2.0 REQUIRED)
pkg_config_library(LIBGIT2 libgit2 REQUIRED)
pkg_config_library(LIBMDB libmdb REQUIRED)
pkg_config_library(LIBDC libdivecomputer REQUIRED)
pkg_config_library(LIBFTDI libftdi1 QUIET)
pkg_config_library(LIBRAW libraw)

find_package(Qt5 REQUIRED COMPONENTS Core
Concurrent
Expand Down

0 comments on commit f81cf77

Please sign in to comment.