Thursday, July 4, 2013

Cmake most commonly used variables

CMake is the cross-platform, open-source make system. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. Do look at CMake Useful Variables.

Example of the most commonly used variables:
  1. CMAKE_PREFIX_PATH (since CMake 2.6.0)
    This is used when searching for include files, binaries, or libraries using either the FIND_PACKAGE(), FIND_PATH(), FIND_PROGRAM(), or FIND_LIBRARY() commands. For each path in the CMAKE_PREFIX_PATH list, CMake will check "PATH/include" and "PATH" when FIND_PATH() is called, "PATH/bin" and "PATH" when FIND_PROGRAM() is called, and "PATH/lib" and "PATH" when FIND_LIBRARY() is called. See the documentation for FIND_PACKAGE(), FIND_LIBRARY(), FIND_PATH(), and FIND_PROGRAM() for more details.
  2. CMAKE_LIBRARY_PATH
    This is used when searching for libraries e.g. using the FIND_LIBRARY() command. If you have libraries in non-standard locations, it may be useful to set this variable to this directory (e.g. /sw/lib on Mac OS X). If you need several directories, separate them by the platform specific separators (e.g. ":" on UNIX)
  3. CMAKE_INCLUDE_PATH
    This is used when searching for include files e.g. using the FIND_PATH() command. If you have headers in non-standard locations, it may be useful to set this variable to this directory (e.g. /sw/include on Mac OS X). If you need several directories, separate them by the platform specific separators (e.g. ":" on UNIX)

References:
  1.  CMake Useful Variables.



No comments: