Piles use CMake as a build system. Several CMake scripts are provided in pile-cmake repository to make the job of the developer as simple as possible. Here is a complete list:
Computes an output path CMake style. A relative path to PROJECT_SOURCE_DIR is computed using pileRelativePath, then it is appended to PROJECT_BINARY_DIR.
Computes a relative path. Both reference ans input must be either unix like (/usr/bin) or Windows like (C:/Windows). Mixing them is undefined.
If the paths are the same . is returned
Depending on the use style for this pile, may add the library to the target using target_link_libraries or it may create a dependency to the copy headers target.
Shows a debug message on behalf of the pile. These messages can be enabled or disabled on a per-pile basis using PILE_DEBUG_MSG variable (PILE is the name of the pile upper-cased).
To disable all messages generated by this macro set PILE_SUPPORT_DEBUG to OFF (PILE in this case is the actual word PILE).
The macros in pile-cmake repository use this macro to report debug events.
Includes a pile .cmake file but does not initialize the pile.
Path can be provided as optional arguments. If path is provided it can be absolute or relative to CMAKE_SOURCE_DIR. If path is not provided then ${CMAKE_SOURCE_DIR}/name and ${CMAKE_SOURCE_DIR}/name-src are tried.
Defines following variables:
By using this function the top level CMake file does not have to alter CMAKE_MODULE_PATH itself.
Creates a target to copy files. If base_path is provided then the path structure is going to be preserved, otherwise all files are going to be copied in same directory.
Creates a target that copies the headers from a pile to build directory. Name of the new target is copy_pile_headers. The files are copied to ${CMAKE_BINARY_DIR}/build/include It is assumed that PILE_HEADERS and PILE_PATH are defined.
Internally the macro simply calls pileCreateCopyTarget
Set dependencies for a pile. The list can be empty. Basically the macro creates a variable PILE_DEPENDENCIES and, if debugging is enabled, informs the user about them.
Set the category for a pile.
The list can be empty; if there are more than one items in the list they are interpreted to be components of a path.
A pile has a single category and multiple tags. All the components of the category list are added as tags. pileSetCategory("p1" "a;b;c") is thus interpreted like a/b/c/p1 by a tool looking to store the piles or categorize.
The macro defines or changes PILE_CATEGORY and PILE_TAGS variables.
Set the tags for a pile.
The list can be empty; the macro defines or changes PILE_TAGS variables.
Set the version for a pile.
The list should contain major, minor and patch components. The macro defines or changes PILE_MAJOR_VERSION, PILE_MINOR_VERSION, PILE_PATCH_VERSION, PILE_VERSION_STRING, PILE_DEBUG and PILE_RELEASE.
Set the use mode.
The list should contain major, minor and patch components. The macro defines or changes PILE_STATIC, PILE_PILE, PILE_SHARED with the one being selected set to ON and the others to OFF.
Set common properties.
This is just a wrapper around the other macros: pileSetDependencies, pileSetCategory, pileSetTags, pileSetVersion, pileSetMode.
Configures the file for a pile.
The input file is pile-config.h.in an the output is pile-config.h.
Set the list of sources.