Matthew Woehlke a8345d65f3 ExternalProject: Add SOURCE_SUBDIR option
Add a new SOURCE_SUBDIR option to ExternalProject_Add that allows
specifying the location of the CMakeLists.txt to use as the project root
relative to the SOURCE_DIR.

This is helpful for projects that have unusual layouts, or projects that
provide both a superbuild and project-only build depending on which
CMakeLists.txt is used.

Fixes: #15118
2016-08-16 13:18:18 -04:00

11 lines
278 B
CMake

cmake_minimum_required(VERSION 3.6)
project(ExternalProjectSourceSubdir NONE)
include(ExternalProject)
ExternalProject_Add(Example
SOURCE_SUBDIR subdir
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Example
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Example
INSTALL_COMMAND ""
)