tldr/pages/common/cmake.md

22 lines
736 B
Markdown
Raw Normal View History

2016-11-30 21:23:28 +00:00
# cmake
> Cross-platform build, testing and packaging automation system.
> CMake uses its own shell-like syntax and generates recipes for many build systems.
2020-11-16 18:53:30 +00:00
> More information: <https://cmake.org/cmake/help/latest/manual/cmake.1.html>.
2016-11-30 21:23:28 +00:00
- Generate a build recipe in the current directory with `CMakeLists.txt` from a project directory:
2016-11-30 21:23:28 +00:00
`cmake {{path/to/project_directory}}`
2016-11-30 21:23:28 +00:00
- Build artifacts with the generated recipe in `build_directory`:
2016-11-30 21:23:28 +00:00
`cmake --build {{path/to/build_directory}}`
2021-01-18 17:02:53 +00:00
- Install the build artifacts into /usr/local/ striping debugging symbols:
2021-01-18 17:02:53 +00:00
`cmake --install {{path/to/build_directory}} --strip --prefix /usr/local/`
- Run a custom build target:
`cmake --build {{path/to/build_dir/}} --target {{target_name}}`