1 / 24

Cmake Primer

Cmake Primer. What is CMake ?. Cross-platform , open-source build system Family of tools for building , testing , and packaging software CMake is used to control the software compilation process using platform and compiler independent configuration files

Download Presentation

Cmake Primer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cmake Primer

  2. What is CMake? • Cross-platform, open-source build system • Family of tools for building, testing, and packaging software • CMake is used to control the software compilation process using platform and compiler independent configuration files • CMake generates nativemakefiles or solution files • First implemented in 2000 • Current release: 3.6.3 • Website: https://cmake.org/

  3. Using CMake • Command line:cmake [<options>] (<path-to-source> | <path-to-existing-build>)configures a build system for the specified cmake project dircmake [(-D<var>=<value>)...] -P <cmake-script-file>executes a cmake script filecmake --build <dir> [<options>] [-- <build-tool-options>...]executes the build process through a generic interfacecmake -E <command> [<options>...] gives you cross platform commands

  4. Using CMake • cmake-gui

  5. Using CMake • ccmake

  6. The CMake build process • Consists of two stages: • Create standard (platform-specific) build files from the configuration files • Use the platform native build tools for the actual building • Creating the build files • always prefer out-of-source builds • if using cmake-gui, select the generator (for Chrono, make sure to use 64-bit) • [iterate] set options → configure • generate

  7. Chrono CMake configuration Using cmake-gui on Windows

  8. Specify source and build locations

  9. Select generator

  10. Set configuration options

  11. Set new configuration options

  12. Iterate until all dependencies are resolved

  13. Generate native build files (VS solution file)

  14. Generated solution file

  15. Build project

  16. Chrono CMake configuration Using ccmake on Linux

  17. Prepare out-of-source build

  18. Initial configuration

  19. Default settings

  20. Set options

  21. Iterate

  22. Generate native build files (Unix makefiles)

  23. Generated makefile

  24. Build project % make

More Related