OpenCVForUnity
OpenCVForUnity copied to clipboard
Issues with doing a custom build.
Howdy,
I am trying to do a custom build of the opencv library to enable modules that I am trying to use on UWP HoloLens2 HMD. Per the instructions in the UWP section of the readme pdf file, I git cloned and checked out opencv 4.4.0 branch. I then ran setup_winrt.bat "WS" "10.0" "x64" to get the build failure error saying the followings:
CMake Warning (dev) at modules/videoio/CMakeLists.txt:98 (if): Policy CMP0057 is not set: Support new IN_LIST if() operator. Run "cmake --help-policy CMP0057" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
IN_LIST will be interpreted as an operator when the policy is set to NEW. Since the policy is not set the OLD behavior will be used. This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at modules/videoio/CMakeLists.txt:98 (if): Policy CMP0057 is not set: Support new IN_LIST if() operator. Run "cmake --help-policy CMP0057" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
IN_LIST will be interpreted as an operator when the policy is set to NEW. Since the policy is not set the OLD behavior will be used. This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at modules/videoio/CMakeLists.txt:98 (if): if given arguments:
"msmf" "IN_LIST" "VIDEOIO_PLUGIN_LIST" "OR" "VIDEOIO_PLUGIN_LIST" "STREQUAL" "all"
Unknown arguments specified
-- Configuring incomplete, errors occurred! See also "C:/Users/frontis/opencv/bin/WS/10.0/x64/CMakeFiles/CMakeOutput.log". See also "C:/Users/frontis/opencv/bin/WS/10.0/x64/CMakeFiles/CMakeError.log".
Can I get some pointers as to how to resolve this error?
Thank you,
Jason
Add
if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()
before the 97th line of CMakeLists.txt.
Reference: https://cmake.org/cmake/help/v3.19/policy/CMP0057.html?highlight=cmp0057