We will begin with the root CMakeLists.txt:
- We declare a C++11 project as usual:
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)project(recipe-02 LANGUAGES CXX)set(CMAKE_CXX_STANDARD 11)set(CMAKE_CXX_EXTENSIONS OFF)set(CMAKE_CXX_STANDARD_REQUIRED ON)
- We set the EP_BASE directory property:
set_property(DIRECTORY PROPERTY EP_BASE ${CMAKE_BINARY_DIR}/subprojects)
- We set the STAGED_INSTALL_PREFIX variable. This directory will be used to install the dependencies within our build tree:
set(STAGED_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/stage)message(STATUS "${PROJECT_NAME} staged install: ${STAGED_INSTALL_PREFIX}")
- Our project needs the filesystem and system components of the Boost libraries. We declare a list variable to hold this ...