Skip to content

Commit

Permalink
[quirc, opencv4] Use a cmake package for quirc and devendor quirc fro…
Browse files Browse the repository at this point in the history
…m opencv4.
  • Loading branch information
BillyONeal authored and strega-nil committed Jan 21, 2021
1 parent 68a7495 commit d683d97
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 13 deletions.
26 changes: 26 additions & 0 deletions ports/opencv4/0011-devendor-quirc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 16c0ede..78532d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -763,7 +763,7 @@ if(WITH_OPENVX)
endif()

if(WITH_QUIRC)
- add_subdirectory(3rdparty/quirc)
+ find_package(quirc CONFIG REQUIRED)
set(HAVE_QUIRC TRUE)
endif()
# ----------------------------------------------------------------------------
diff --git a/modules/objdetect/CMakeLists.txt b/modules/objdetect/CMakeLists.txt
index 414e578..4f26d75 100644
--- a/modules/objdetect/CMakeLists.txt
+++ b/modules/objdetect/CMakeLists.txt
@@ -2,7 +2,5 @@ set(the_description "Object Detection")
ocv_define_module(objdetect opencv_core opencv_imgproc opencv_calib3d WRAP java python js)

if(HAVE_QUIRC)
- get_property(QUIRC_INCLUDE GLOBAL PROPERTY QUIRC_INCLUDE_DIR)
- ocv_include_directories(${QUIRC_INCLUDE})
- ocv_target_link_libraries(${the_module} quirc)
+ ocv_target_link_libraries(${the_module} quirc::quirc)
endif()
4 changes: 2 additions & 2 deletions ports/opencv4/CONTROL
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Source: opencv4
Version: 4.3.0
Port-Version: 5
Build-Depends: zlib
Port-Version: 6
Build-Depends: zlib, quirc
Homepage: https://github.com/opencv/opencv
Description: computer vision library
Default-Features: dnn, jpeg, png, tiff, webp
Expand Down
3 changes: 2 additions & 1 deletion ports/opencv4/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ vcpkg_from_github(
0006-jpeg2000_getref.patch
0008-fix-vtk9.patch
0009-fix-uwp.patch
0010-fix-interface_link_libraries.patch # Remove this patch when the next update
0010-fix-interface_link_libraries.patch # Remove this patch when the next update\
0011-devendor-quirc.patch
)

file(REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake")
Expand Down
28 changes: 19 additions & 9 deletions ports/quirc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.19)

project(quirc C)

add_library(quirc
lib/decode.c
lib/identify.c
lib/quirc.c
lib/version_db.c
lib/decode.c
lib/identify.c
lib/quirc.c
lib/version_db.c
lib/quirc.h
)

target_include_directories(quirc INTERFACE $<INSTALL_INTERFACE:include>)

install(TARGETS quirc
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
EXPORT quirc-targets
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)

install(FILES lib/quirc.h DESTINATION include)

install(FILES ${PROJECT_SOURCE_DIR}/lib/quirc.h DESTINATION include)
install(EXPORT quirc-targets
FILE quirc-config.cmake
NAMESPACE quirc::
DESTINATION share/quirc
)
2 changes: 1 addition & 1 deletion ports/quirc/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: quirc
Version: 1.1
Port-Version: 1
Port-Version: 2
Description: quirc is one of the C library available for scanning QR Codes
2 changes: 2 additions & 0 deletions ports/quirc/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ vcpkg_install_cmake()

vcpkg_copy_pdbs()

vcpkg_fixup_cmake_targets()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/quirc/copyright)

0 comments on commit d683d97

Please sign in to comment.