Skip to content

Commit 4b98fff

Browse files
kaarrotlgritz
authored andcommitted
build: BUILD_MISSING_DEPS - fix minor configuration options (#4493)
Address a few small issues encountered during CMake configuration step and during build using Makefile `BUILD_MISSING_DEPS` option enabled. - Mismatch between expected libraw versions specified in `build_libraw.bash` 0.21.3 and `externalpackages.cmake` 0.20.0 - OpenEXR link error in libutil tests - Update top level Makefile to accept `BUILD_MISSING_DEPS` as string instead of bool. Pass the string option down to CMake Verified build completes with no errors: `BUILD_MISSING_DEPS=all make` Signed-off-by: kuba <kuba456@gmail.com>
1 parent bc8e42d commit 4b98fff

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ ifneq (${CLANG_FORMAT_EXCLUDES},)
202202
MY_CMAKE_FLAGS += -DCLANG_FORMAT_EXCLUDES:STRING=${CLANG_FORMAT_EXCLUDES}
203203
endif
204204

205-
ifneq (${BUILD_MISSING_DEPS},)
206-
MY_CMAKE_FLAGS += -DBUILD_MISSING_DEPS:BOOL=${BUILD_MISSING_DEPS}
207-
endif
208-
209-
210205
#$(info MY_CMAKE_FLAGS = ${MY_CMAKE_FLAGS})
211206
#$(info MY_MAKE_FLAGS = ${MY_MAKE_FLAGS})
212207

@@ -395,7 +390,6 @@ help:
395390
@echo " 0, sse2, sse3, ssse3, sse4.1, sse4.2, f16c,"
396391
@echo " avx, avx2, avx512f)"
397392
@echo " TEX_BATCH_SIZE=16 Override TextureSystem SIMD batch size"
398-
@echo " BUILD_MISSING_DEPS=1 Try to download/build missing dependencies"
399393
@echo " make test, extra options:"
400394
@echo " TEST=regex Run only tests matching the regex"
401395
@echo ""

src/cmake/dependency_utils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ macro (checked_find_package pkgname)
426426
# ${pkgname}_REFIND_ARGS : additional arguments to pass to find_package
427427
if (${pkgname}_REFIND)
428428
message (STATUS "Refinding ${pkgname} with ${pkgname}_ROOT=${${pkgname}_ROOT}")
429-
find_package (${pkgname} ${_pkg_UNPARSED_ARGUMENTS} ${${pkgname}_REFIND_ARGS})
429+
find_package (${pkgname} ${${pkgname}_REFIND_VERSION} REQUIRED ${_pkg_UNPARSED_ARGUMENTS} ${${pkgname}_REFIND_ARGS})
430430
unset (${pkgname}_REFIND)
431431
endif()
432432
# It's all downhill from here: if we found the package, follow the

src/raw.imageio/rawinput.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,11 @@ RawInput::open_raw(bool unpack, const std::string& name,
453453
// Output 16 bit images
454454
m_processor->imgdata.params.output_bps = 16;
455455

456+
#if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 21, 0)
456457
// Exposing max_raw_memory_mb setting. Default max is 2048.
457458
m_processor->imgdata.rawparams.max_raw_memory_mb
458459
= config.get_int_attribute("raw:max_raw_memory_mb", 2048);
459-
460+
#endif
460461

461462
// Disable exposure correction (unless config "raw:auto_bright" == 1)
462463
m_processor->imgdata.params.no_auto_bright
@@ -715,15 +716,26 @@ RawInput::open_raw(bool unpack, const std::string& name,
715716
crop_top = p->get_int_indexed(1);
716717
crop_width = p->get_int_indexed(2);
717718
crop_height = p->get_int_indexed(3);
718-
} else if (m_processor->imgdata.sizes.raw_inset_crops[0].cwidth != 0) {
719+
}
720+
#if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 21, 0)
721+
else if (m_processor->imgdata.sizes.raw_inset_crops[0].cwidth != 0) {
719722
crop_left = m_processor->imgdata.sizes.raw_inset_crops[0].cleft;
720723
crop_top = m_processor->imgdata.sizes.raw_inset_crops[0].ctop;
721724
crop_width = m_processor->imgdata.sizes.raw_inset_crops[0].cwidth;
722725
crop_height = m_processor->imgdata.sizes.raw_inset_crops[0].cheight;
723726
left_margin = m_processor->imgdata.sizes.left_margin;
724727
top_margin = m_processor->imgdata.sizes.top_margin;
725728
}
726-
729+
#else
730+
else if (m_processor->imgdata.sizes.raw_inset_crop.cwidth != 0) {
731+
crop_left = m_processor->imgdata.sizes.raw_inset_crop.cleft;
732+
crop_top = m_processor->imgdata.sizes.raw_inset_crop.ctop;
733+
crop_width = m_processor->imgdata.sizes.raw_inset_crop.cwidth;
734+
crop_height = m_processor->imgdata.sizes.raw_inset_crop.cheight;
735+
left_margin = m_processor->imgdata.sizes.left_margin;
736+
top_margin = m_processor->imgdata.sizes.top_margin;
737+
}
738+
#endif
727739
if (crop_width > 0 && crop_height > 0) {
728740
ushort image_width = m_processor->imgdata.sizes.width;
729741
ushort image_height = m_processor->imgdata.sizes.height;

0 commit comments

Comments
 (0)