Skip to content

Commit

Permalink
Add a script to build on debian bullseye (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
krupkat authored Dec 29, 2023
1 parent 092acbe commit b25edd0
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
61 changes: 61 additions & 0 deletions misc/build/build-bullseye.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
export BUILD_TYPE='Release'
export SDL_VERSION='release-2.28.5'
# export OPENCV_VERSION='4.8.1'
export CATCH_VERSION='v3.4.0'
export SPDLOG_VERSION='v1.12.0'
export EXIV2_VERSION='v0.28.0'
# export GENERATOR='Ninja Multi-Config'

git submodule update --init

# sudo apt-get update
# sudo apt-get install -y libopencv-dev libgtk-3-dev build-essential
# pip install cmake

git clone https://github.com/catchorg/Catch2.git catch --depth 1 --branch $CATCH_VERSION
cd catch
cmake -B build \
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_TESTING=OFF
cmake --build build --target install -j $(nproc)
cd ..

git clone https://github.com/Exiv2/exiv2.git --depth 1 --branch $EXIV2_VERSION
cd exiv2
cmake -B build \
-DCMAKE_INSTALL_PREFIX=install \
`cat ../misc/build/exiv2-minimal-flags.txt`
cmake --build build --target install -j $(nproc)
cd ..

git clone https://github.com/gabime/spdlog.git --depth 1 --branch $SPDLOG_VERSION
cd spdlog
cmake -B build \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=build/install
cmake --build build --target install -j $(nproc)
cd ..

git clone https://github.com/libsdl-org/SDL.git --depth 1 --branch $SDL_VERSION
cd SDL
cmake -B build \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=install
cmake --build build --target install -j $(nproc)
cd ..

cmake -B build \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=install \
-DBUILD_TESTING=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCatch2_DIR=../catch/install/lib/cmake/Catch2 \
-Dexiv2_DIR=exiv2/install/lib/cmake/exiv2 \
-Dspdlog_DIR=`pwd`/spdlog/build/install/lib/cmake/spdlog \
-DSDL2_DIR=SDL/install/lib/cmake/SDL2

cmake --build build -j $(nproc) --target install
cd build
ctest --output-on-failure
cd ..
5 changes: 4 additions & 1 deletion xpano/gui/panels/sidebar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,10 @@ cv::Mat DrawMatches(const algorithm::Match& match,
const auto single_point_color = cv::Scalar::all(-1);
const auto matches_mask = std::vector<char>();
cv::drawMatches(img1.GetPreview(), img1.GetKeypoints(), img2.GetPreview(),
img2.GetKeypoints(), match.matches, out, match_thickness,
img2.GetKeypoints(), match.matches, out,
#if XPANO_OPENCV_HAS_NEW_DRAW_MATCHES_API
match_thickness,
#endif
match_color, single_point_color, matches_mask,
cv::DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS);
return out;
Expand Down
3 changes: 3 additions & 0 deletions xpano/utils/opencv.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#define XPANO_OPENCV_HAS_JPEG_SUBSAMPLING_SUPPORT \
(CV_VERSION_MAJOR >= 4 && CV_VERSION_MINOR >= 7)

#define XPANO_OPENCV_HAS_NEW_DRAW_MATCHES_API \
(CV_VERSION_MAJOR >= 4 && CV_VERSION_MINOR >= 5 && CV_VERSION_REVISION >= 3)

namespace xpano::utils::opencv {

constexpr bool HasJpegSubsamplingSupport() {
Expand Down

0 comments on commit b25edd0

Please sign in to comment.