CMake Build System

  1. Projects, Targets, and Properties
    1. Defining a Project
      1. The project Command
        1. Setting Project Name
          1. Setting Project Version
            1. Project Description
            2. Project Versioning
              1. Semantic Versioning
                1. Version Variables
                  1. Version File Generation
                  2. Supported Languages
                    1. Enabling C
                      1. Enabling C++
                        1. Enabling Fortran
                          1. Enabling CUDA
                            1. Enabling Assembly
                              1. Custom Languages
                            2. Working with Targets
                              1. Executable Targets
                                1. add_executable Command
                                  1. Adding Source Files
                                    1. Setting Output Name
                                      1. WIN32 Executables
                                        1. MACOSX_BUNDLE Executables
                                        2. Library Targets
                                          1. add_library Command
                                            1. Static Libraries
                                              1. Shared Libraries
                                                1. Module Libraries
                                                  1. Object Libraries
                                                    1. Interface Libraries
                                                    2. Custom Targets
                                                      1. add_custom_target Command
                                                        1. Defining Custom Build Steps
                                                          1. Dependencies for Custom Targets
                                                          2. Alias Targets
                                                            1. Creating Target Aliases
                                                              1. Use Cases for Aliases
                                                            2. Managing Target Properties
                                                              1. Property System Overview
                                                                1. Property Types
                                                                  1. Property Inheritance
                                                                  2. Setting Properties
                                                                    1. set_property Command
                                                                      1. set_target_properties Command
                                                                        1. Setting Multiple Properties
                                                                        2. Getting Properties
                                                                          1. get_property Command
                                                                            1. get_target_property Command
                                                                            2. Common Target Properties
                                                                              1. SOURCES Property
                                                                                1. INCLUDE_DIRECTORIES Property
                                                                                  1. COMPILE_DEFINITIONS Property
                                                                                    1. COMPILE_OPTIONS Property
                                                                                      1. OUTPUT_NAME Property
                                                                                        1. POSITION_INDEPENDENT_CODE Property
                                                                                          1. ARCHIVE_OUTPUT_DIRECTORY Property
                                                                                            1. LIBRARY_OUTPUT_DIRECTORY Property
                                                                                              1. RUNTIME_OUTPUT_DIRECTORY Property
                                                                                                1. VERSION and SOVERSION Properties
                                                                                              2. Modern CMake: Target-Centric Approach
                                                                                                1. target_sources Command
                                                                                                  1. Adding Source Files to Targets
                                                                                                    1. Visibility Specifiers
                                                                                                    2. target_include_directories Command
                                                                                                      1. Specifying Include Paths
                                                                                                        1. System Include Directories
                                                                                                        2. target_compile_definitions Command
                                                                                                          1. Defining Preprocessor Macros
                                                                                                            1. Conditional Definitions
                                                                                                            2. target_compile_options Command
                                                                                                              1. Adding Compiler Flags
                                                                                                                1. Language-Specific Options
                                                                                                                2. target_compile_features Command
                                                                                                                  1. Specifying Language Features
                                                                                                                    1. Feature Requirements
                                                                                                                    2. Propagation of Usage Requirements
                                                                                                                      1. PRIVATE Visibility
                                                                                                                        1. PUBLIC Visibility
                                                                                                                          1. INTERFACE Visibility
                                                                                                                            1. Interface Libraries