NormandErwan / ArucoUnity

Bring augmented reality to Unity by tracking Aruco markers in real time.
https://normanderwan.github.io/ArucoUnity/
BSD 3-Clause "New" or "Revised" License
205 stars 38 forks source link

Build fails on windows #18

Closed FreakTheMighty closed 6 years ago

FreakTheMighty commented 6 years ago

First of all, thanks for this library. I'm very excited to give it a try. I'm trying to build on windows 10 following the direction from here. The first step completes successfully, but it fails on the second step. Below are the commands I've used and the output.

$ cd ArucoUnity\ArucoUnityPlugin\build\opencv
$ cmake -DCMAKE_INSTALL_PREFIX=install/ -G "Visual Studio 15 2017 Win64" ..\..\3rdparty\opencv_contrib
$ cmake --build . --config Release

$ cd ArucoUnity\ArucoUnityPlugin\build
$ cmake -DCMAKE_INSTALL_PREFIX=.. -DOpenCV_DIR=../../build/opencv/install/ - "Visual Studio 15 2017 Win64" ..

Output

-- OpenCV ARCH: x86
-- OpenCV RUNTIME: vc14
-- OpenCV STATIC: OFF
CMake Warning at build/opencv/install/OpenCVConfig.cmake:156 (message):
  Found OpenCV Windows Pack but it has no binaries compatible with your
  configuration.

  You should manually point CMake variable OpenCV_DIR to your build of OpenCV
  library.
Call Stack (most recent call first):
  CMakeLists.txt:31 (find_package)

CMake Error at CMakeLists.txt:31 (find_package):
  Found package configuration file:

    ArucoUnity/ArucoUnityPlugin/build/opencv/install/OpenCVConfig.cmake

  but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
  NOT FOUND.

-- Configuring incomplete, errors occurred!
See also "/ArucoUnity/ArucoUnityPlugin/build/CMakeFiles/CMakeOutput.log".
NormandErwan commented 6 years ago

Thanks for your issue. Sorry for my late reply!

For what I understand, CMake is complaining during the ArucoUnityPlugin build. It says that the OpenCV you provide has a x86 (32 bits) architecture. However it needs a x64 version.

I think CMake has found an OpenCV version on your hard-drive which is not the one you compiled. The -DOpenCV_DIR option should point on a wrong path.

I'm going to retry a build on my side to verify that.

NormandErwan commented 6 years ago

I moved the ArucoUnityPlugin to a dedicated repository and set-up automatic build both for Linux (with Travis) and Windows (with AppVeyor). You can download the plugin on releases.

I also updated the documentation. It should be better now if you want to build the plugin by yourself.

FreakTheMighty commented 6 years ago

@NormandErwan thanks for the update. I ended up using python binding + sockets which worked for my purpose. If I have an opportunity to do this sort of thing again I'll report back my results. Thank you for your help.