The process of setting up a superbuild should by now feel familiar. Let us once again look at the necessary steps, starting with the root CMakeLists.txt:
- We declare a C++11 project with a same default build type:
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)project(recipe-05 LANGUAGES CXX)set(CMAKE_CXX_STANDARD 11)set(CMAKE_CXX_EXTENSIONS OFF)set(CMAKE_CXX_STANDARD_REQUIRED ON)if(NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)endif()message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}")
- The EP_BASE directory property is set. This will fix the layout for all subprojects managed by ExternalProject:
set_property(DIRECTORY PROPERTY EP_BASE ${CMAKE_BINARY_DIR}/subprojects) ...