Let us first look at CMakeLists.txt in the root folder:
- We declare a C++11 project, with a minimum required CMake version:
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)project(recipe-01 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 for the current and any underlying directories. This will be discussed shortly:
set_property(DIRECTORY PROPERTY EP_BASE ${CMAKE_BINARY_DIR}/subprojects)
- We include the ExternalProject.cmake standard module. This module provides the ExternalProject_Add function:
include(ExternalProject)
- The source code for our "Hello, World" example is added as an external project by invoking the ExternalProject_Add ...