koderbober / android-cmake

Automatically exported from code.google.com/p/android-cmake
0 stars 0 forks source link

Hello-boost doesn't find the boost installation #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. follow the documentation to compile the boost common-lib
2. set BOOST_ROOT environment variable to the folder in 1) (path\boost_1_45_0)
3. cmake -G"NMake Makefiles" 
-DCMAKE_TOOLCHAIN_FILE=C:\Users\Emerix\Dropbox\msc\androidcmake\toolchain\androi
d.toolchain.cmake .. 

What is the expected output? What do you see instead?
Expected: Makefile.
Result: CMake Error at 
D:/android/CMake/share/cmake-2.8/Modules/FindBoost.cmake:1192 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:12 (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 file
s:
Boost_INCLUDE_DIR (ADVANCED)
   used as include directory in directory C:/Users/Emerix/Dropbox/msc/androidcma
ke/samples/hello-boost

What version of the product are you using? On what operating system?
newest android-cmake on Windows7 Pro x64, Visual Studio 2010 console.

Original issue reported on code.google.com by toriga...@gmail.com on 1 Mar 2013 at 11:21

GoogleCodeExporter commented 8 years ago
Okay so apparently there's an issue with the buildin FindBoost.cmake

The toolchain seems to set some stuff that changed the behaviour of find_path( 
... ) and find_library( ... )

The find_path one can be fixed by passing 
NO_CMAKE_FIND_ROOT_PATH..

basically in the FindBoost.cmake you can replace:
# Look for a standard boost header file.
    find_path(Boost_INCLUDE_DIR
      NAMES         boost/config.hpp
      HINTS         ${_boost_INCLUDE_SEARCH_DIRS}
      PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
      ${_boost_FIND_OPTIONS}
      )
with 
# Look for a standard boost header file.
    find_path(Boost_INCLUDE_DIR
      NAMES         boost/config.hpp
      HINTS         ${_boost_INCLUDE_SEARCH_DIRS}
      PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
      ${_boost_FIND_OPTIONS}
      NO_CMAKE_FIND_ROOT_PATH
      )

That way the include dir gets found again.

However I am still at a loss how to fix the find_library one..

Original comment by toriga...@gmail.com on 1 Mar 2013 at 8:26

GoogleCodeExporter commented 8 years ago
Use find_host_package instead.

Original comment by answeror on 7 Mar 2013 at 10:42

GoogleCodeExporter commented 8 years ago
actually adding NO_CMAKE_FIND_ROOT_PATH works for getting the boost 
installation. You just have to add /boost in the "find includes" part since the 
old versions have their include files there.

Original comment by toriga...@gmail.com on 10 Mar 2013 at 6:10