You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building opencv4 for android, the compilation and "cmake install" steps succeed.
However, after this, vcpkg will complain that "The folder /include is empty or not present".
This seems to be due to the fact that opencv emits a non standard include folder hierarchy: see below.
set(VCPKG_TARGET_ARCHITECTURE arm)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CMAKE_SYSTEM_NAME Android)
set(ANDROID_NDK_HOME $ENV{ANDROID_NDK_HOME})
if ("${ANDROID_NDK_HOME}"MATCHES"^$")
message(FATAL_ERROR
"Please set an env variable ANDROID_NDK_HOME pointing to your ndk-bundle folder. For example: export ANDROID_NDK_HOME=/home/your-account/Android/Sdk/ndk-bundle")
endif()
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake)
set(ANDROID_ABI armeabi-v7a)
# ANDROID_ABI can be : "armeabi-v7a" , "armeabi-v7a with NEON", "arm64-v8a", "x86" or "x86_64"
-- Installing: .../vcpkg/packages/opencv4_android-armeabi-v7a/share/opencv4/copyright
-- Performing post-build validation
The folder /include is empty or not present. This indicates the library was not correctly installed.
The following files are placed in
.../vcpkg/packages/opencv4_android-armeabi-v7a:
.../vcpkg/packages/opencv4_android-armeabi-v7a/README.android
Files cannot be present in those directories.
The following files are placed in
.../vcpkg/packages/opencv4_android-armeabi-v7a/debug:
.../vcpkg/packages/opencv4_android-armeabi-v7a/debug/README.android
Files cannot be present in those directories.
Found 3 error(s). Please correct the portfile:
../vcpkg/ports/opencv4/portfile.cmake
-- Performing post-build validation done
Error: Building package opencv4:android-armeabi-v7a failed with: POST_BUILD_CHECKS_FAILED
-Cut and past the appropriate build messages from the console output.
-Please attach any additional failure logs mentioned in the console output.
But I do not know if it makes sense: all it does is reorganize the package folder content after opencv installation. vcpkg seems to be happy after this and the installation succeeds.
Does my patch make sense ?
Remark: with my patch, there is a naming issue (which might be unrelated): the advice given by vcpkg for use in cmake list reads:
find_package(abi-armeabi-v7a CONFIG REQUIRED)
instead of
find_package(opencv4 CONFIG REQUIRED)
./vcpkg install "opencv4[core]:android-armeabi-v7a"
Computing installation plan...
The following packages will be built and installed:
opencv4[core]:android-armeabi-v7a
Starting package 1/1: opencv4:android-armeabi-v7a
Building package opencv4[core]:android-armeabi-v7a...
-- Using cached /home/pascal/dvp/vcpkg/downloads/opencv-opencv-4.1.1.tar.gz
-- Using source at /home/pascal/dvp/vcpkg/buildtrees/opencv4/src/4.1.1-fb9e10326a
-- Configuring android-armeabi-v7a-dbg
-- Configuring android-armeabi-v7a-rel
-- Building android-armeabi-v7a-dbg
-- Building android-armeabi-v7a-rel
-- Installing: /home/pascal/dvp/vcpkg/packages/opencv4_android-armeabi-v7a/share/opencv4/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package opencv4[core]:android-armeabi-v7a... done
Installing package opencv4[core]:android-armeabi-v7a...
Installing package opencv4[core]:android-armeabi-v7a... done
Elapsed timefor package opencv4:android-armeabi-v7a: 17.27 s
Total elapsed time: 17.27 s
The package opencv4:android-armeabi-v7a provides CMake targets:
find_package(abi-armeabi-v7a CONFIG REQUIRED)
# Note: 9 target(s) were omitted.
target_link_libraries(main PRIVATE opencv_ml opencv_core opencv_flann opencv_photo)
When building opencv4 for android, the compilation and "cmake install" steps succeed.
However, after this, vcpkg will complain that "The folder /include is empty or not present".
This seems to be due to the fact that opencv emits a non standard include folder hierarchy: see below.
Host Environment
To Reproduce
(I submitted this PR a few minutes ago)
triplets/android-armeabi-v7a.cmake
Download and install the android ndk-bundle
Set an env var to the ndk-bundle folder
Failure logs
-Cut and past the appropriate build messages from the console output.
-Please attach any additional failure logs mentioned in the console output.
Additional context
Please note that this issue can only be reproduced after applying a patch on protobuf package for android
The text was updated successfully, but these errors were encountered: