CMAKE

# External Projects

## Overview

An external project in a CMake system is a separate, self-contained CMake project that can be turned into a target, which can then be used as a dependency on other targets in your build system.

The ExternalProject module runs it’s commands at build time.

CMAKE_ARGS can be used to provide command-line style arguments to the CMakeLists.txt file in this external project.

You can use this to “pass-in parameters” to the called CMakeLists.txt file by using the -D option to create a cache entry.

cmake
...
CMAKE_ARGS -DMY_VARIABLE=1
...
)



Add CMake-enabled projects to an existing CMake-enabled project can become quite a complex task. The article at https://coderwall.com/p/y3zzbq/use-cmake-enabled-libraries-in-your-cmake-project details an elegant solution.