CMake-lib provides consistent setting for built environment. It simplifies and maintains built option, libraries and executables.
- CMLIB library installed
The library is not mainly intended for extending CMake functionality.
It's set of wrappers and helpers which enables easily use of existing CMake features.
Each CMake project has one main target - the target for which the project is created, compiled, ...
For example we have CMake project for building chrome browser.
Browser is represented by one executable called chrome
. That executable
must have own target in CMake project.
By that target other project properties are referenced - installer name, application name, documentation etc. We call this type of target as 'main target' (the 'object' for which we create the CMake project)
In the library the 'main target' is represented by MAIN_TARGET variable/parameter for macros/functions
Let GIT_URI be a GIT URI of this repository.
FIND_PACKAGE(CMLIB COMPONENTS CMDEF)
CMake-lib sets and maintains build/link flags and global wide definitions
Component workflow
- reset CMake default build flags by
CMDEF_CLEANUP
- set default build and link options by
CMDEF_COMPILE_OPTIONS
,CMDEF_LINK_OPTIONS
- set compile definitions by
CMDEF_COMPIE_DEFINITIONS
examples can be found at example directory
Each entry in list represents one feature for CMake.
Most of functions are just wrappers which enclosures base feature of CMake.
Detailed documentation for each function can be found at appropriate module.
- CMDEF_ADD_LIBRARY.cmake
- CMDEF_ADD_EXECUTABLE.cmake
- CMDEF_BUILD_TYPE.cmake
- CMDEF_COMPILE_DEFINITION.cmake
- CMDEF_COMPILE_OPTION.cmake
- CMDEF_ENV.cmake
- CMDEF_INSTALL.cmake
- CMDEF_LINK_OPTION.cmake
- CMDEF_PACKAGE.cmake
Configuration variables detailed desc. for the library is located at doc/CacheVariables.md
- We use Uppercase for all keywords and global variables
- Each helper function must begin with '_'