我正在尝试使用cmake编译cpp-netlib.
我的配置:OS X 10.9.1 Mavericks + Xcode 5.0.2 cpp-netlib 0.11.0 cmake 2.8.12.2 Boost 1.55.0
因为我试图让整个事情与OS X和iOS 7一起工作,所以我使用以下脚本创建了一个Boost框架:https: //github.com/mgrebenets/boost-xcode5-iosx
我做了一个没有c ++ 11的干净安装,例如:"$ ./boost.sh clean -v 1.55.0"
这产生了两个"boost.framework"目录,一个用于OS X,第二个用于iOS.我已经在"Build Phases> Link Binary With Libraries"中成功地将OS X Boost框架添加到我的Xcode项目中,并测试了Boost文档中的boost :: regex示例,该文档在我的Mac上运行良好.
但是,当我开始制作cpp-netlib时,我遇到了问题.当我尝试运行时:
$ cmake -DCMAKE_BUILD_TYPE = Debug -DCMAKE_C_COMPILER = gcc -DCMAKE_CXX_COMPILER = g ++ ../cpp-netlib-0.11.0-final/
它产生以下输出:
-- 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".
我已经尝试将BOOST_ROOT环境变量设置为"path_to_framework/boost.framework /"和"path_to_framework/boost.framework/Versions/A /"我也尝试将BOOST_INCLUDEDIR设置为"path_to_framework/boost.framework/Versions/A/Headers /"直接到headers目录.
不幸的是,我每次都会遇到同样的错误......
任何人都可以帮我设置cpp-netlib用于iOS 7吗?我的脑袋目前被c ++中的所有编译/需求/库/等所淹没.我来自网络编程背景并使用PHP,JavaScript,相当多的MS PowerShell(是的,我知道... =)),以及过去的一些Java,但C/C++对我来说是新的. ..请与新手一起温柔=)
谢谢,西蒙