CMAKE Android-cmake toolchain

586 views
Skip to first unread message

David Robinson

unread,
Jan 21, 2014, 10:29:51 AM1/21/14
to openb...@googlegroups.com
I'm using the cmake-gui, and trying to get the binaries I need for android using the android-cmake toolchain file,

I kept getting this type of error:
Failed to find "gdi32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE "".
so I pointed the 
Qt5Gui_glu32_LIBRARY to this path on my computer "C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\x86\Gdi32.Lib"
the next time I tried it would have the same error but with glu32, user32, or opengl32
so I would fix that one and then it seemed like the cycle would start over.
Then I modified Qt5GuiConfigExtras.cmake to set CMAKE_CXX_LIBRARY_ARCHITECTURE to this path "C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\x86\Gdi32.Lib" but my problems still did not go away.
Finally I commented out this line "#_qt5gui_find_extra_libs(OPENGL "glu32;opengl32;gdi32;user32" thinking that I would just skip these files all together :)  
but then I got this:   I feel like I'm playing error whack a mole! Has anyone successfully used android-cmake to build openBR, if so I'd like to talk to you!

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindThreads.cmake:166 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
app/br/CMakeLists.txt:2 (find_package)

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ALPHANUM_DIR (ADVANCED)
used as include directory in directory C:/OpenBRProject/openbr
used as include directory in directory C:/OpenBRProject/openbr
used as include directory in directory C:/OpenBRProject/openbr
used as include directory in directory C:/OpenBRProject/openbr
used as include directory in directory C:/OpenBRProject/openbr/openbr
EIGEN3_DIR (ADVANCED)
used as include directory in directory C:/OpenBRProject/openbr/openbr
HTTPPARSER_DIR (ADVANCED)
used as include directory in directory C:/OpenBRProject/openbr/openbr

Josh Klontz

unread,
Jan 21, 2014, 11:01:35 AM1/21/14
to David Robinson, openb...@googlegroups.com
Have you been able to successfully compile OpenCV using this toolchain? If not, I would suggest starting there first.

It looks like you are trying to point it at x86 libraries even though you are building for ARM. Did you point CMake to the x86 version of Qt by accident?

-Josh


--
You received this message because you are subscribed to the Google Groups "Open Source Biometric Recognition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openbr-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Nicolas Thierion

unread,
Jul 11, 2014, 5:16:33 AM7/11/14
to openb...@googlegroups.com
Hi,

You're not alone, I'm facing the same problem. I'm on linux x64, trying to build openBR for android with android.toolchain.cmake. I already installed QT5.1 libs for android, but I have now the same error as yours :

-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ALPHANUM_DIR (ADVANCED)
   used as include directory in directory /home/nicolas/openbr
...
EIGEN3_DIR (ADVANCED)
   used as include directory in directory /home/nicolas/openbr/openbr
...
HTTPPARSER_DIR (ADVANCED)
   used as include directory in directory /home/nicolas/openbr/openbr
...


Did you get it to work? Any hint will be welcome.
Thank you,

Nicolas.
Message has been deleted

Josh Klontz

unread,
Jul 11, 2014, 8:58:54 AM7/11/14
to Nicolas Thierion, openb...@googlegroups.com
Nicholas,

All three of these directories live in openbr/3rdparty. Not sure why they aren't being found automatically. I'd suggest taking a look at openbr/share/openbr/cmake/FindEigen3.cmake etc.

-Josh


--
You received this message because you are subscribed to the Google Groups "Open Source Biometric Recognition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openbr-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian DeRocher

unread,
Jul 11, 2014, 10:47:26 AM7/11/14
to openb...@googlegroups.com
I'll be looking at this on Monday.  Thanks for the heads up.

Brian DeRocher, Lead, Noblis
703.610.1589 www.noblis.org
brian.d...@noblis.org 
Message has been deleted

Nicolas Thierion

unread,
Jul 14, 2014, 4:46:21 AM7/14/14
to openb...@googlegroups.com
Hi, thank you for your answers, and sorry for the double post. I'm new here.
I sucessfully got it compiling for Android. I had to set paths manually to cmake, with this command :

cmake -DCMAKE_TOOLCHAIN_FILE=../
android.toolchain.cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/home/nicolas/Qt/5.1.0/android_armv7/ -D CMAKE_PREFIX_PATH=~/NVPACK/android-ndk-r9d/platforms/android-9/arch-arm/usr/lib/ -DALPHANUM_DIR=../3rdparty/alphanum/ -DEIGEN3_DIR=../3rdparty/eigen-eigen-5097c01bcdc4/ -DHTTPPARSER_DIR=../3rdparty/http-parser-2.1/ -DStasm_DIR=../3rdparty/stasm4.0.0/ -DANDROID_NATIVE_API_LEVEL=android-9 -DANDROID_NDK=/home/nicolas/NVPACK/android-ndk-r9d/ -DTOOL_OS_SUFFIX=-std=c++11 ..

I've had some troubles with RandomLib, I had to hack the cpp to bypass the function "gethostid()" that doesn't exists in NDK' s unistd.h.
Now, the executable "br" runs on my armv7 android device. It still doesn't work because of some linking problems with Qt, but it might not be a hard problem.
Have you some feedback from someone successfully achevieved this?

PS : Sorry for my bad english, this is not my native language.


Le mardi 21 janvier 2014 16:29:51 UTC+1, David Robinson a écrit :

Brian DeRocher

unread,
Aug 18, 2014, 4:09:02 PM8/18/14
to openb...@googlegroups.com
Nicolas,

I have good news and bad news. Good: I have the exact same problem. Bad: I don't know a solution yet. Do you?

Brian
Message has been deleted

Brian DeRocher

unread,
Nov 25, 2014, 9:41:07 AM11/25/14
to openb...@googlegroups.com
I hope this helps.

My compile command looks like this:

export ANDROID_NDK=/home/brian/android-ndk-r9d/

cmake   \
        -DCMAKE_BUILD_TYPE=Debug  \
        -DCMAKE_PREFIX_PATH=/home/brian/lib/Qt5.3.1/5.3/android_armv7/lib/cmake  \
        -DCMAKE_TOOLCHAIN_FILE=/home/brian/lib/android-cmake/android.toolchain.cmake  \
        ../biometrics-openbr \
        $@

The changes i made to openbr are attached.  Some changes are just to prevent compiling warning, like removing unused variables.  I had issues with randomlib.  The important changes are the ones to cmake files.


Brian

Brian DeRocher, Lead, Noblis
703.610.1589 www.noblis.org
brian.d...@noblis.org 

On 11/19/2014 10:53 PM, jtre...@gmail.com wrote:
You ever get this to work David?
--
Reply all
Reply to author
Forward
0 new messages