简体   繁体   中英

Can't cmake cpp-netlib with Boost framework made with boost.sh script

I am trying to compile cpp-netlib with cmake.

My config: OS X 10.9.1 Mavericks + Xcode 5.0.2 cpp-netlib 0.11.0 cmake 2.8.12.2 Boost 1.55.0

Because I am trying to make the whole thing work with OS X and iOS 7, I've made a Boost framework by using the following script: https://github.com/mgrebenets/boost-xcode5-iosx

I did a clean install with no c++11 as in example: "$ ./boost.sh clean -v 1.55.0"

This produced two "boost.framework" directories one for OS X, the second one for iOS. I have successfully added the OS X Boost framework to my Xcode project in "Build Phases > Link Binary With Libraries" and tested the boost::regex example from Boost documentation which worked fine on my Mac.

However, when I started cmaking the cpp-netlib, I ran into problems. When I try to run this:

$ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ../cpp-netlib-0.11.0-final/

It produces the following output:

-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at /Applications/CMake 2.8-12.app/Contents/share/cmake-    2.8/Modules/FindBoost.cmake:1111 (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:40 (find_package)


-- Found OpenSSL: /usr/lib/libssl.dylib;/usr/lib/libcrypto.dylib (found version "0.9.8y") 
-- 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 at CMakeLists.txt:107 (export):
  export given target "cppnetlib-client-connections" which is not built by
  this project.


-- Configuring incomplete, errors occurred!
See also "/Users/lime/Downloads/cpp-netlib-build/CMakeFiles/CMakeOutput.log".

I have tried setting the BOOST_ROOT environmental variable to "path_to_framework/boost.framework/" and "path_to_framework/boost.framework/Versions/A/" I've also tried setting BOOST_INCLUDEDIR to "path_to_framework/boost.framework/Versions/A/Headers/" directly to the headers directory.

Unfortunately I am still getting the same errors every time...

Can anyone please help me setup cpp-netlib for use with iOS 7? My head is currently overwhelmed by all the compilation/requirements/libraries/etc in c++. I come from a web programming background and used PHP, JavaScript, quite a lot MS PowerShell (yeah, i know... =) ), as well as a bit of Java in the past, but C/C++ is new to me...please be gentle with a newbie =)

Thanks, Simon

您需要在cmake调用中添加-DBOOST_ROOT=/path/to/your/boost

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM