CMake notes

Setting 'cache entries'

Cache entries are set using -D upon invocation of CMake.
Cache entries are not environment variables.
 
Finding packages

One question which arises over and over with cmake is how to find packages. Unfortunately, given the flexibility afforded by CMake, there is not a catch all answer to this, instead, refer to the package documentation.

The following commands are used to retrieve docs for a given package:
  • cmake --help-module-list # find a dedicated cmake module to handle a given package. 
  • cmake --help-module FindFoo # read help about the FindFoo module.
Sometimes the documentation will point at helpful cache entries; for example, the boost package doc refers Boost_DEBUG, a function that will print out the search paths used to find boost libraries.

Reference:  find_package

No comments:

Post a Comment