diff options
author | Dmitrii Kuznetsov <torgeek@users.noreply.github.com> | 2021-02-22 18:36:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-22 18:36:35 +0300 |
commit | bc8bd2646f068cfb402850f7c0f9b1dbfe81e5a0 (patch) | |
tree | 89213fd6afbf9cc9303c1c2fa08dafc840a9d99d /cmake.html.markdown | |
parent | 363d5281f1e3d5bee6339b5316405b0a4b592c49 (diff) | |
parent | 110511a10110f96b20f107c078f7d5ef4c01b109 (diff) |
Merge pull request #1 from adambard/master
Merge from original adambard
Diffstat (limited to 'cmake.html.markdown')
-rw-r--r-- | cmake.html.markdown | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/cmake.html.markdown b/cmake.html.markdown index 45cf0585..9ea68a42 100644 --- a/cmake.html.markdown +++ b/cmake.html.markdown @@ -1,35 +1,36 @@ --- -language: cmake +category: tool +tool: cmake contributors: - ["Bruno Alano", "https://github.com/brunoalano"] filename: CMake --- -CMake is a cross-platform, open-source build system. This tool will allow you -to test, compile and create packages of your source code. +CMake is a cross-platform, open-source build system. This tool allows you to test, +compile, and create packages of your source code. -The problem that CMake tries to solve is the problem of Makefiles and -Autoconfigure on cross-platforms (different make interpreters have different -command) and the ease-of-use on linking 3rd party libraries. +The problem that CMake tries to solve is the problem of Makefiles and +Autoconfigure on cross-platforms (different make interpreters have different +commands) and the ease-of-use on linking 3rd party libraries. -CMake is an extensible, open-source system that manages the build process in -an operating system and compiler-independent manner. Unlike many -cross-platform systems, CMake is designed to be used in conjunction with the +CMake is an extensible, open-source system that manages the build process in +an operating system and compiler-agnostic 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 +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 # In CMake, this is a comment -# To run our code, we will use these steps: +# To run our code, please perform the following commands: # - mkdir build && cd build # - cmake .. # - make # -# With those steps, we will follow the best pratice to compile into a subdir -# and the second line will request to CMake to generate a new OS-dependant +# With those steps, we will follow the best practice to compile into a subdir +# and the second line will request to CMake to generate a new OS-dependent # Makefile. Finally, run the native Make command. #------------------------------------------------------------------------------ @@ -44,22 +45,22 @@ cmake_minimum_required (VERSION 2.8) # Raises a FATAL_ERROR if version < 2.8 cmake_minimum_required (VERSION 2.8 FATAL_ERROR) -# We setup the name for our project. After we do that, this will change some -# directories naming convention generated by CMake. We can send the LANG of -# code as second param +# We define the name of our project, and this changes some directories +# naming convention generated by CMake. We can send the LANG of code +# as the second param project (learncmake C) # Set the project source dir (just convention) set( LEARN_CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} ) set( LEARN_CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ) -# It's useful to setup the current version of our code in the build system +# It's useful to set up the current version of our code in the build system # using a `semver` style set (LEARN_CMAKE_VERSION_MAJOR 1) set (LEARN_CMAKE_VERSION_MINOR 0) set (LEARN_CMAKE_VERSION_PATCH 0) -# Send the variables (version number) to source code header +# Send the variables (version number) to the source code header configure_file ( "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in" "${PROJECT_BINARY_DIR}/TutorialConfig.h" @@ -126,14 +127,14 @@ if(FALSE AND (FALSE OR TRUE)) message("Don't display!") endif() -# Set a normal, cache, or environment variable to a given value. -# If the PARENT_SCOPE option is given the variable will be set in the scope +# Set a regular, cache, or environment variable to a given value. +# If the PARENT_SCOPE option is given, the variable will be set in the scope # above the current scope. # `set(<variable> <value>... [PARENT_SCOPE])` -# How to reference variables inside quoted and unquoted arguments -# A variable reference is replaced by the value of the variable, or by the -# empty string if the variable is not set +# How to reference variables inside quoted and unquoted arguments? +# A variable reference is replaced by either the variable value or by the +# empty string if the variable is not set. ${variable_name} # Lists @@ -171,6 +172,7 @@ endif() ### More Resources -+ [cmake tutorial](https://cmake.org/cmake-tutorial/) -+ [cmake documentation](https://cmake.org/documentation/) -+ [mastering cmake](http://amzn.com/1930934319/) ++ [CMake tutorial](https://cmake.org/cmake-tutorial/) ++ [CMake documentation](https://cmake.org/documentation/) ++ [Mastering CMake](http://amzn.com/1930934319/) ++ [An Introduction to Modern CMake](https://cliutils.gitlab.io/modern-cmake/) |