Skip to content

[opencv3] Update to 3.4.8#9761

Closed
JackBoosY wants to merge 6 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/8641
Closed

[opencv3] Update to 3.4.8#9761
JackBoosY wants to merge 6 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/8641

Conversation

@JackBoosY
Copy link
Contributor

Update opencv3 to 3.4.8.

Related: #8641.

+ set(OPENCV_DLLVERSION "")
set(OPENCV_DEBUG_POSTFIX d)
- ocv_update(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
+ ocv_update(OPENCV_DLLVERSION "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variables that are defined using ocv_update can be modified setting them through vcpkg_configure_cmake instead of patching them in the source code

Copy link
Contributor Author

@JackBoosY JackBoosY Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SOURCE/cmake/OpenCVVersion.cmake:

SET(OPENCV_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/modules/core/include/opencv2/core/version.hpp")
file(STRINGS "${OPENCV_VERSION_FILE}" OPENCV_VERSION_PARTS REGEX "#define CV_VERSION_[A-Z]+[ ]+" )

string(REGEX REPLACE ".+CV_VERSION_MAJOR[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MAJOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_MINOR[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MINOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_REVISION[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_PATCH "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_STATUS[ ]+\"([^\"]*)\".*" "\\1" OPENCV_VERSION_STATUS "${OPENCV_VERSION_PARTS}")

We cannot pass OPENCV_VERSION MAJOR into vcpkg_configure_cmake because it will be overwritten here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I don't understand. I was telling you to pass value from the port file because it is much easier to maintain, instead of patching source code. Those variables became managed through ocv_update exactly because we were patching them (they were not supposed to be modified by users in the beginning), in order to ease our work here :)

Copy link
Contributor

@cenit cenit Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass OPENCV_DLLVERSION="" from the portfile :)

opencl:x64-uwp=fail
opencolorio:x64-linux=ignore
opencsg:x64-uwp=fail
opencv3:arm64-windows = skip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are skipped because they conflict with opencv/opencv4.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to use CI to test opencv3 you have to skip opencv4, but I am not sure that you would trigger an automatic removal in the installed folder in this way... So I fear that it's impossible to test opencv3 in CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If CI cannot test these features, I worry that this PR will last a long time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once this PR is done, I will revert these changes.

@JackBoosY
Copy link
Contributor Author

@Neumann-A When I build opencv3[qt], I found error message:

CMake Error at F:/vcpkg/installed/x86-windows/debug/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:15 (message):
  The imported target "Qt5::Widgets" references the file

     "F:/vcpkg/installed/x86-windows/debug/tools/qt5/uic.exe"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "F:/vcpkg/installed/x86-windows/debug/lib/cmake/Qt5Widgets/Qt5WidgetsConfigExtras.cmake"

  but not all the files it references.

I cannot find uic.exe in path F:/vcpkg/installed/x86-windows/debug/tools.
So should this issue be a qt5 bug?

@Neumann-A
Copy link
Contributor

Neumann-A commented Jan 21, 2020

@JackBoosY

F:/vcpkg/installed/x86-windows/debug/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:15 (message):

This file should not exist at all. Delete the cmake folder in debug/lib

And I don't understand why it even exists since qt5-base has the line:
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) # TODO: check if important debug information for cmake is lost

@JackBoosY
Copy link
Contributor Author

@Neumann-A I guess my installed/x86-windows is not clean.

@JackBoosY
Copy link
Contributor Author

JackBoosY commented Jan 21, 2020

@cenit
I found that opencv3 installs dynamic libraries in ${OpenCV_ARCH}/${OpenCV_RUNTIME} by default. Should we continue to use this setting?
It caused some problems in OpenCVModules-debug.cmake.

Nope, I found it was added in this release.

@JackBoosY
Copy link
Contributor Author

It looks like we only have problems with static builds.

@cenit
Copy link
Contributor

cenit commented Jan 22, 2020

Together with @alalek we helped reviewing the #8557 which might contain the answer for your problem (and also the same comments about using portfile instead of patches for "ocv_update- managed" variables 😅)

@JackBoosY
Copy link
Contributor Author

Same as before, instead of patching the source, pass the proper OPENCV_BIN_INSTALL_PATH from the port file

I hope it works. Because when I try to pass -DOPENCV_INSTALL_BINARIES_PREFIX=""to vcpkg_configure_cmake, the configuration process reports errors.

@cenit
Copy link
Contributor

cenit commented Jan 22, 2020

you have to pass them with the proper quotation sintax. The opencv4 port should contain an example :)

@Neumann-A
Copy link
Contributor

with the proper quotation syntax

and proper escaping syntax if you want to pass a list of elements (7 or 9 backslashes needed for passing a list)..... all due to cmake_parse_arguments using the ARGN version. Would like to see a change to cmake_parse_arguments(PARSE_ARGV

@JackBoosY
Copy link
Contributor Author

Since Opencv3 is updated to 3.4.10, I think this PR is no longer available.

@JackBoosY JackBoosY closed this Aug 19, 2020
@JackBoosY JackBoosY deleted the dev/jack/8641 branch August 19, 2020 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants