Mastering CMake

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

CMake is the premier cross-platform build system for complex software systems. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice. CMake is both sophisticated and easy to use: it is possible to support complex environments requiring system configuration, compiler feature detection, pre-processor generation, code generation, and template instantiation using simple platform and compiler independent configuration files. CMake supports testing and is integrated with the DART regression testing system. CMake is used by many large and complex systems including VTK, The Visualization Toolkit, and ITK, The Insight Segmentation and Registration Toolkit.

Author(s): Ken Martin; Bill Hoffman
Publisher: Kitware
Year: 2010

Language: English
Commentary: converted from http://libgen.io/book/index.php?md5=E9100B0B4F9826635471985A71BC8154
Pages: 454
Tags: CMake;Programming;Software;

1. WHY CMAKE?
...1.1 The History of CMake
...1.2 Why Not Use Autoconf?
...1.3 Why Not Use JAM, qmake, SCons, or ANT?
...1.4 Why Not Script It Yourself?
...1.5 On What Platforms Does CMake Run?
2. GETTING STARTED
...2.1 Getting and Installing CMake on Your Computer
......UNIX and Mac Binary Installations
......Windows Binary Installation
...2.2 Building CMake Yourself
...2.3 Basic CMake Usage and Syntax
...2.4 Hello World for CMake
...2.5 How to Run CMake?
......Running CMake’s Qt Interface
......Running the ccmake Curses Interface
......Running CMake from the Command Line
......Specifying the Compiler to CMake
......Dependency Analysis
...2.6 Editing CMakeLists Files
...2.7 Setting Initial Values for CMake
...2.8 Building Your Project
3. KEY CONCEPTS
...3.1 Main Structures
...3.2 Targets
...3.3 Source Files
...3.4 Directories, Generators, Tests, and Properties
...3.5 Variables and Cache Entries
...3.6 Build Configurations
4. WRITING CMAKELISTS FILES
...4.1 CMake Syntax
...4.2 Basic Commands
...4.3 Flow Control
...4.4 Regular Expressions
...4.5 Checking Versions of CMake
...4.6 Using Modules
......Using CMake with SWIG
......Using CMake with Qt
......Using CMake with FLTK
...4.7 Policies
......Updating a Project For a New Version of CMake
...4.8 Linking Libraries
......Specifying Optimized or Debug Libraries with a Target
...4.9 Shared Libraries and Loadable Modules
...4.10 Shared Library Versioning
...4.11 Installing Files
......Installing Prerequisite Shared Libraries
...4.12 Advanced Commands
5. SYSTEM INSPECTION
...5.1 Using Header Files and Libraries
...5.2 System Properties
...5.3 Finding Packages
...5.4 Built-in Find Modules
...5.5 How to Pass Parameters to a Compilation?
...5.6 How to Configure a Header File
...5.7 Creating CMake Package Configuration Files
6. CUSTOM COMMANDS AND TARGETS
...6.1 Portable Custom Commands
...6.2 Using add_custom_command on a Target
......How to Copy an Executable Once it is Built?
...6.3 Using add_custom_command to Generate a File
......Using an Executable to Build a Source File
...6.4 Adding a Custom Target
...6.5 Specifying Dependencies and Outputs
...6.6 When There Isn’t One Rule For One Output
......A Single Command Producing Multiple Outputs
......Having One Output That Can Be Generated By Different Commands
7. CONVERTING EXISTING SYSTEMS TO CMAKE
...7.1 Source Code Directory Structures
...7.2 Build Directories
...7.3 Useful CMake Commands When Converting Projects
...7.4 Converting UNIX Makefiles
...7.5 Converting Autoconf Based Projects
...7.6 Converting Windows Based Workspaces
8. CROSS COMPILING WITH CMAKE
...8.1 Toolchain Files
......Finding External Libraries, Programs and Other Files
...8.2 System Inspection
......Using Compile Checks
...8.3 Running Executables Built in the Project
...8.4 Cross Compiling Hello World
...8.5 Cross Compiling for a Microcontroller
...8.6 Cross Compiling an Existing Project
...8.7 Cross Compiling a Complex Project - VTK
...8.8 Some Tips and Tricks
9. PACKAGING WITH CPACK
...9.1 CPack Basics
......Simple Example
......What Happens When CPack.cmake Is Included?
......Adding Custom CPack Options
......Options Added by CPack
...9.2 CPack Source Packages
...9.3 CPack Installer Commands
...9.4 CPack for Windows Installer NSIS
......CPack Variables Used by CMake for NSIS
......Creating Windows Short Cuts in the Start Menu
......A dvanced NSIS CPack Options
......Setting File Extension Associations With NSIS
......Installing Microsoft Run Time Libraries
......CPack Component Install Support
...9.5 CPack for Cygwin Setup
...9.6 CPack for Mac OS X PackageMaker
...9.7 CPack for Mac OS X Drag and Drop
...9.8 CPack for Mac OS X XI1 Applications
...9.9 CPack for Debian Packages
...9.10 CPack for RPM
...9.11 CPack Files
10. AUTOMATION & TESTING WITH CMAKE
...10.1 Testing with CMake, CTest, and CDash
...10.2 How Does CMake Facilitate Testing?
...10.3 Additional Test Properties
...10.4 Testing Using CTest
...10.5 Using CTest to Drive Complex Tests
...10.6 Handling a Large Number of Tests
...10.7 Producing Test Dashboards
......Adding CDash Dashboard Support to a Project
......Client Setup
...10.8 Customizing Dashboards for a Project
......Dashboard Submissions Settings
......Filtering Errors and Warnings
......Adding Notes to a Dashboard
...10.9 Setting up Automated Dashboard Clients
......Settings for Continuous Dashboards
......Variables Available in CTest Scripts
...10.10 Advanced CTest Scripting
......Limitations of Traditional CTest Scripting
......Extended CTest Scripting
...10.11 Setting up a Dashboard Server
......CDash Server
......Advanced Server Management
......Build Groups
......Email
......Sites
......Graphs
......Adding Notes to a Build
......Logging
......Test Timing
......Mobile Support
......Backing up CDash
......Upgrading CDash
......CDash Maintenance
...10.12 Subprojects
......Using ctestjsubmit with PARTS and FILES
......Splitting Your Project into Multiple Subprojects
11. PORTING CMAKE TO NEW PLATFORMS AND LANGUAGES
...11.1 The Determine System Process
...11.2 The Enable Language Process
...11.3 Porting to a New Platform
...11.4 Adding a New Language
...11.5 Rule Variable Listing
......General Tag Variables
......Language Specific Information
...11.6 Compiler and Platform Examples
......Como Compiler
......Borland Compiler
...11.7 Extending CMake
......Creating a Loaded Command
......Using a Loaded Command
12. TUTORIALS
...12.1 A Basic Starting Point (Step 1)
......Adding a Version Number and Configured Header File
...12.2 Adding a Library (Step 2)
...12.3 Installing and Testing (Step 3)
...12.4 Adding System Introspection (Step 4)
...12.5 Adding a Generated File and Generator (Step 5)
...12.6 Building an Installer (Step 6)
...12.7 Adding Support for a Dashboard (Step 7)
APPENDIX A - VARIABLES
...Variables That Change Behavior
...Variables That Describe the System
...Variables for Languages
...Variables That Control the Build
...Variables That Provide Information
APPENDIX B - COMMAND LINE REFERENCE
...CMake Command Line Options
...CMake Generators
...CTest Command Line Options
...CPack Command Line Options
...CPack Generators
APPENDIX C - LISTFILE COMMANDS
...Current Commands
...Compatibility Commands
APPENDIX D - SELECTED MODULES
...CMake Modules
APPENDIX E - PROPERTIES
...Properties of Global Scope
...Properties on Directories
...Properties on Targets
...Properties on Tests
...Properties on Source Files
...Properties on Cache Entries
APPENDIX F - CMAKE POLICIES
INDEX