November 24, 2020

CMake 3.18.5 & 3.19.0 releases: managing the build process of software

3 min read

CMake is an extensible, open-source system that manages the build process in an operating system and in a compiler-independent manner. Unlike many cross-platform systems, CMake is designed to be used in conjunction with the native build environment. Simple configuration files placed in each source directory (called CMakeLists.txt files) are used to generate standard build files (e.g., makefiles on Unix and projects/workspaces in Windows MSVC) which are used in the usual way. CMake can generate a native build environment that will compile source code, create libraries, generate wrappers and build executables in arbitrary combinations. CMake supports in-place and out-of-place builds, and can therefore support multiple builds from a single source tree. CMake also supports static and dynamic library builds. Another nice feature of CMake is that it generates a cache file that is designed to be used with a graphical editor. For example, when CMake runs, it locates files, libraries, and executables, and may encounter optional build directives. This information is gathered into the cache, which may be changed by the user prior to the generation of the native build files.




  • “cmake(1)” and “cmake-gui(1)” now recognize “CMakePresets.json” and
    “CMakeUserPresets.json” files (see “cmake-presets(7)”).
  • The “Xcode” generator now uses the Xcode “new build system” when
    generating for Xcode 12.0 or higher. See the
    “CMAKE_XCODE_BUILD_SYSTEM” variable. One may use “-T buildsystem=1”
    to switch to the legacy build system.
  • The Visual Studio Generators for VS 2015 and above gained support
    for the Visual Studio Tools for Android. One may now set
    “CMAKE_SYSTEM_NAME” to “Android” to generate “.vcxproj” files for
    the Android tools.
  • CMake learned to support “ISPC” as a first-class language that can
    be enabled via the “project()” and “enable_language()” commands.
    “ISPC” is currently supported by the Makefile Generators and the
    “Ninja” generator on Linux, macOS, and Windows using the Intel ISPC
  • “CUDA” language support for Clang now supports separable compilation
  • The “CMake GUI” now has an environment variable editor.
  • The “cmake_path()” command was added for operations on filesystem
  • The “file(GENERATE)” command gained a new “TARGET” keyword to
    support resolving target-dependent generator expressions.
  • The “CMAKE_OPTIMIZE_DEPENDENCIES” variable was added to initialize
    the new “OPTIMIZE_DEPENDENCIES” target property and avoid
    unnecessarily building dependencies for a static library.
  • The “CheckCompilerFlag” module has been added to generalize
    “CheckCCompilerFlag” and “CheckCXXCompilerFlag” to more languages.
    It also supports the “CUDA” and “ISPC” languages.
  • The “CheckSourceCompiles” module has been added to generalize
    “CheckCSourceCompiles” and “CheckCXXSourceCompiles” to more
    languages. It also supports the “CUDA” and “ISPC” languages.
  • The “CheckSourceRuns” module has been added to generalize
    “CheckCSourceRuns” and “CheckCXXSourceRuns” to more languages. It
    also supports the “CUDA” language.
  • The “FindCUDAToolkit” module gained support for finding CUDA
    toolkits that do not contain “nvcc”, as well as for finding
    scattered toolkit installations when cross-compiling.
  • Interface Libraries may now have source files added via
    “add_library()” or “target_sources()”. Those with sources will be
    generated as part of the build system.
  • Compatibility with versions of CMake older than 2.8.12 is now
    deprecated and will be removed from a future version. Calls to
    “cmake_minimum_required()” or “cmake_policy()” that set the policy
    version to an older value now issue a deprecation diagnostic.


Brad King (5):
clang-format: Fix include block order in ctest.cxx and cpack.cxx
cmConsoleBuf: Factor out cout/cerr console buffer management
FindRuby: Restore compatibility variable RUBY_VENDORLIB_DIR
Xcode: Extract CMAKE__COMPILER from compiler id with multiple archs
CMake 3.18.5

Johnny Jazeix (1):
cmake: Fix ‘-E cat’ command for binary files on Windows

Kyle Edwards (1):
Ninja Multi-Config: Don’t try to calculate dependencies for “all”

Raul Tambre (1):
VS: Don’t compute CUDA options unless necessary