官术网_书友最值得收藏!

How to generate projects for Xcode

Several solutions in the last chapter utilize the libcurl library. For SSL support, this library needs to be linked with the OpenSSL library. Do the following to install OpenSSL:

  1. Download the library from https://www.openssl.org/.
  2. Unzip the archive and, in a terminal, go to its root directory.
  3. Build and install the library with the following commands (executed in this order):

    ./Configure darwin64-x86_64-cc shared enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macos-x86_64

    make depend

    sudo make install

Until std::optional and the filesystem library will be available with Xcode's Clang, you need to use Boost. Do the following to install and build the Boost libraries:

  1. Install Homebrew from https://brew.sh/.
  2. Run the following command to download and install Boost automatically.

    brew install boost
  3. After installation, the Boost library will be available at /usr/local/Cellar/boost/1.65.0.

In order to generate projects for Xcode from the sources you have to:

  1. Open a terminal and go to the build directory in the source code root directory.
  2. Execute the following CMake command:

    cmake -G Xcode .. -DOPENSSL_ROOT_DIR=/usr/local/bin -DOPENSSL_INCLUDE_DIR=/usr/local/include/ -DBUILD_TESTING=OFF -DBUILD_CURL_EXE=OFF -DUSE_MANUAL=OFF -DBOOST_FILESYSTEM=ON -DBOOST_OPTIONAL=ON -DBOOST_INCLUDE_DIR=/usr/local/Cellar/boost/1.65.0 -DBOOST_LIB_DIR=/usr/local/Cellar/boost/1.65.0/lib
  3. After completion, the Xcode project can be found at build/cppchallenger.xcodeproj.
主站蜘蛛池模板: 江阴市| 旬阳县| 宿迁市| 岫岩| 准格尔旗| 全南县| 定陶县| 冕宁县| 博白县| 周口市| 老河口市| 秭归县| 新田县| 邓州市| 通河县| 廊坊市| 承德市| 海晏县| 介休市| 盐津县| 蓝山县| 泾源县| 资兴市| 寿阳县| 沁阳市| 九寨沟县| 洪洞县| 隆昌县| 来安县| 景宁| 永定县| 甘泉县| 建阳市| 平定县| 浦江县| 汕尾市| 宝鸡市| 故城县| 沁源县| 莱西市| 沐川县|