Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
A
Algorithms Library Toolkit Core
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 42
    • Issues 42
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Registry
    • Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Algorithms Library Toolkit
  • Algorithms Library Toolkit Core
  • Wiki
  • cmake generator

cmake generator

Last edited by Tomáš Pecka Nov 18, 2018
Page history

CMake Generator Documentation

CMake/generator.py is a generator script for ALib CMakeLists.txt

Usage

  • -w --write: Write files (false by default)
  • -m --main: Generate main CMakeLists.txt
  • -p --packages: Specify packages to build. For multiple packages, use -p multiple times
  • --no-deps: Don't generate dependencies of specified packages. By default, if only some projects are to be built, we compute their dependencies and build them.
  • -show-deps: Only show dependencies of packages selected by -p. Dont generate.
  • -v --version: Show ALIB version

Example

  • Generate whole project (dry run): ./CMake/generator.py -m
  • Generate whole project: ./CMake/generator.py -mw
  • Generate only projects alib2std and alib2measure and main CMakeLists: ./CMake/generator.py -mw -p alib2algo -p alib2measure --no-deps
  • Generate only project alib2cli, its dependencies and main CMakeLists: ./CMake/generator.py -mw -p alib2cli

How it works

The generator scans source directory of alib. It looks for file called project.conf (configurable) inside any subdirectory. If found, then this subdirectory is a subproject of alib project.

Documentation of conf files

generate.conf

Generator configuration file consists of these sections:

First section is Versioning. Keys:

  • major: major version of ALIB
  • minor: minor
  • patch: patch
  • together they form the version of ALIB, eg. 1.0.1

Second section is General. Keys:

  • ProjectConfFile: specifies name of project configuration file
  • PathToSources: Path to ALIB sources root dir, relative to the position of generate.py

Further sections are prefixed with CMake:.

Section CMake:Sources. Keys:

  • ExcludeSources: File extensions which are excluded from project compilation files.
  • InstallSources: File extensions which are included into include sources of project. Can be also 'EMPTY', which means that we want to include files with no extensions like vector
  • SourcesDir: Path to the project sources. Relative to project root.
  • TestSourcesDir: Path to the sources of test binary. Relative to project root.

Section CMake:Deps:{dep}. Keys:

  • include: what should be specified inside target_include_directories.
  • link: what should be specified inside target_link_libraries

project.conf

Project configuration file consists of these sections:

First section is General. Keys:

  • category. Acceptable values are defined in generate.conf in the section CMake:Categories. If value is missing or invalid, it is an error.

Second section is Dependencies. Keys:

  • project: List of other ALIB projects that should be regarded as a dependency for this project. CMake is linking these projects.
  • system: List of dependencies outside ALIB project. Elements of this list are configured in section CMake:Deps:{key} either in this project configuration file or in generate.conf.

Section CMake: For every key:value pair, we generate (SET key value) to CMakeLists.txt of this project.

Another sections with name CMake:Deps:{key} are the same as in project.conf. If the section is configured here, it has higher priority than the same section in generate.conf.

Clone repository
  • archive_branches
  • cmake generator
  • codestyle
  • Home
More Pages

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.