Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flycv] new port flycv 1.2 #31986

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions ports/flycv/int64_and_install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 097f8e3..86eec04 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,18 +79,18 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

configure_file(
"${PROJECT_SOURCE_DIR}/include/flycv_namespace.h.in"
- "${CMAKE_INSTALL_PREFIX}/flycv/include/flycv_namespace.h")
+ "${CMAKE_INSTALL_PREFIX}/include/flycv_namespace.h")

configure_file(
"${PROJECT_SOURCE_DIR}/include/version.h.in"
- "${CMAKE_INSTALL_PREFIX}/flycv/include/version.h")
+ "${CMAKE_INSTALL_PREFIX}/include/flycv_version.h")

# add modules
add_subdirectory(modules)

configure_file(
"${PROJECT_SOURCE_DIR}/include/flycv.h.in"
- "${CMAKE_INSTALL_PREFIX}/flycv/include/flycv.h")
+ "${CMAKE_INSTALL_PREFIX}/include/flycv.h")

# ============================ Unit Test ==================================
# Add gtest
diff --git a/cmake/FCVFindDependencies.cmake b/cmake/FCVFindDependencies.cmake
index ca85c85..d91c1bb 100755
--- a/cmake/FCVFindDependencies.cmake
+++ b/cmake/FCVFindDependencies.cmake
@@ -5,15 +5,16 @@ if(BUILD_FCV_MEDIA_IO)
if(WITH_FCV_IMGCODECS)
# Build with jpeg
if(WITH_LIB_JPEG_TURBO)
- include(external/libjpeg-turbo)
+ find_package(libjpeg-turbo CONFIG REQUIRED)
+ list(APPEND FCV_LINK_DEPS libjpeg-turbo::turbojpeg)
add_definitions(-DWITH_LIB_JPEG_TURBO)
endif(WITH_LIB_JPEG_TURBO)

# Build with libpng.
if(WITH_LIB_PNG)
- include(external/libpng)
- include(external/zlib)
- add_dependencies(libpng zlib)
+ find_package(PNG REQUIRED)
+ list(APPEND FCV_LINK_DEPS PNG::PNG)
+ include_directories(${PNG_PNG_INCLUDE_DIR})
add_definitions(-DWITH_LIB_PNG)
endif(WITH_LIB_PNG)
endif(WITH_FCV_IMGCODECS)
diff --git a/cmake/platform/windows/windows.cmake b/cmake/platform/windows/windows.cmake
index 04d487a..2bcd83c 100755
--- a/cmake/platform/windows/windows.cmake
+++ b/cmake/platform/windows/windows.cmake
@@ -1,6 +1,4 @@
add_compile_options(/W4)
-set(CMAKE_CXX_FLAGS_RELEASE /MD)
-set(CMAKE_CXX_FLAGS_DEBUG /MDd)
set(CMAKE_CXX_STANDARD 11)

if(CMAKE_BUILD_TYPE STREQUAL Release)
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index ee9b14f..9a944d3 100755
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -4,7 +4,7 @@ endif()

include_directories(
${PROJECT_SOURCE_DIR}
- ${CMAKE_INSTALL_PREFIX}/flycv/include
+ ${CMAKE_INSTALL_PREFIX}/include
)

get_subdir_list(FCV_ALL_MODULE_LIST ${CMAKE_CURRENT_SOURCE_DIR})
@@ -110,24 +110,16 @@ foreach(each_interface ${FCV_UNIVERSE_INTERFACES})
install(FILES
${CMAKE_SOURCE_DIR}/${each_interface}
DESTINATION
- ${CMAKE_INSTALL_PREFIX}/flycv/include/${OUTPUT_INTERFACE_PATH}
+ ${CMAKE_INSTALL_PREFIX}/include/${OUTPUT_INTERFACE_PATH}
)
endforeach()

install(TARGETS ${FCV_TARGET_NAME}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/flycv/${FCV_INSTALL_LIB_NAME})
+ RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+ LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
+)

if(BUILD_SHARED_LIBS AND (BUILD_TEST OR BUILD_BENCHMARK))
install(TARGETS ${FCV_TARGET_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
endif()
-
-foreach(item ${FCV_EXPORT_LIBS})
- string(REGEX MATCH "\/" BLACKSLASH ${item})
- if ("${BLACKSLASH}" STREQUAL "")
- install(TARGETS ${item}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/flycv/${FCV_INSTALL_LIB_NAME})
- else()
- install(FILES ${item}
- DESTINATION ${CMAKE_INSTALL_PREFIX}/flycv/${FCV_INSTALL_LIB_NAME})
- endif()
-endforeach()
diff --git a/modules/img_transform/resize/src/resize_avx.cpp b/modules/img_transform/resize/src/resize_avx.cpp
index c9c8260..f167dde 100755
--- a/modules/img_transform/resize/src/resize_avx.cpp
+++ b/modules/img_transform/resize/src/resize_avx.cpp
@@ -13,6 +13,7 @@
// limitations under the License.

#include "modules/img_transform/resize/include/resize_avx.h"
+typedef int64_t __int64_t;

#include <cmath>
#include <immintrin.h>
diff --git a/modules/media_io/imgcodecs/src/imgcodecs_png.cpp b/modules/media_io/imgcodecs/src/imgcodecs_png.cpp
index 7214b49..458107c 100755
--- a/modules/media_io/imgcodecs/src/imgcodecs_png.cpp
+++ b/modules/media_io/imgcodecs/src/imgcodecs_png.cpp
@@ -15,7 +15,7 @@
#include "modules/media_io/imgcodecs/include/imgcodecs_png.h"

#ifdef WITH_LIB_PNG
-#include "third_party/libpng/png.h"
+#include "png.h"
#endif

G_FCV_NAMESPACE1_BEGIN(g_fcv_ns)
25 changes: 25 additions & 0 deletions ports/flycv/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO PaddlePaddle/FlyCV
REF "release/v1.2.0"
SHA512 6f40f00f54a3d10da3f49a3c070e6cc8319c3d429d3fe4651e3ca1c55973d9610b64e05a5dec5a33dd8e6c7c293117a1d1b85e2833e07faebfd591f8fed3da14
HEAD_REF develop
PATCHES
int64_and_install.patch
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TEST=OFF
-DWITH_LIB_PNG=ON
-DWITH_LIB_JPEG_TURBO=ON
-DBUILD_C=ON
)

vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
20 changes: 20 additions & 0 deletions ports/flycv/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "flycv",
"version": "1.2.0",
"description": "A high-performance library for processing computer visual tasks.",
"homepage": "https://github.com/PaddlePaddle/FlyCV",
"license": "Apache-2.0",
"supports": "!uwp",
"dependencies": [
"libjpeg-turbo",
"libpng",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2552,6 +2552,10 @@
"baseline": "2.3.2",
"port-version": 2
},
"flycv": {
"baseline": "1.2.0",
"port-version": 0
},
"fmem": {
"baseline": "c-libs-2ccee3d2fb",
"port-version": 3
Expand Down
9 changes: 9 additions & 0 deletions versions/f-/flycv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "366dd8ab70fc8a3bb40176eb0008edcd25784352",
"version": "1.2.0",
"port-version": 0
}
]
}