All Projects → berenm → CMakeBuildPackage

berenm / CMakeBuildPackage

Licence: Unlicense license
Automatic project build script with CMake

Programming Languages

CMake
9771 projects

Projects that are alternatives of or similar to CMakeBuildPackage

MeetixOS
An hobby OS written in modern C++20 which aims to be Unix-like. Currently based on EvangelionNG, a GhostOS derived kernel
Stars: ✭ 179 (+842.11%)
Mutual labels:  c11
memalloy
Memory consistency modelling using Alloy
Stars: ✭ 23 (+21.05%)
Mutual labels:  c11
osbuild
Build-Pipelines for Operating System Artifacts
Stars: ✭ 95 (+400%)
Mutual labels:  build-system
leaflet-map-builder
gherardovarando.github.io/leaflet-map-builder/
Stars: ✭ 16 (-15.79%)
Mutual labels:  build-system
Fortran-Tools
Fortran compilers, preprocessors, static analyzers, transpilers, IDEs, build systems, etc.
Stars: ✭ 31 (+63.16%)
Mutual labels:  build-system
ycm
Extra CMake Modules for YARP and friends
Stars: ✭ 42 (+121.05%)
Mutual labels:  build-system
bazel rules pex
Python PEX rules for Bazel
Stars: ✭ 37 (+94.74%)
Mutual labels:  build-system
systemjs-tools
(dev)tools for working with SystemJS
Stars: ✭ 41 (+115.79%)
Mutual labels:  build-system
DigitalKnob
C++/Javascript/Html/CSS, Cross-Platform Solution
Stars: ✭ 20 (+5.26%)
Mutual labels:  build-system
elite
Fegeya Elitebuild, small, powerful build system. Written in Rust.
Stars: ✭ 24 (+26.32%)
Mutual labels:  build-system
boost
🚀 A collection of type-safe cross-platform packages for building robust server-side and client-side systems.
Stars: ✭ 97 (+410.53%)
Mutual labels:  build-system
Build-Scripts
Collection of build scripts useful when testing on downlevel, abandonware and ransomware clients
Stars: ✭ 61 (+221.05%)
Mutual labels:  build-system
cmkr
Modern build system based on CMake and TOML.
Stars: ✭ 211 (+1010.53%)
Mutual labels:  build-system
craftr
The core framework for the Craftr build system.
Stars: ✭ 1 (-94.74%)
Mutual labels:  build-system
b2
B2 makes it easy to build C++ projects, everywhere.
Stars: ✭ 38 (+100%)
Mutual labels:  build-system
android-projects
Android benchmark projects for Bazel and Gradle
Stars: ✭ 29 (+52.63%)
Mutual labels:  build-system
texmlbus
Texmlbus (Tex to XML BUild System) supports the conversion process of documents written in LaTeX to pdf, html, xhtml or jats.
Stars: ✭ 16 (-15.79%)
Mutual labels:  build-system
source
Onion's fork of OpenWRT's source build system. The firmware for the Omega2, Omega2+, and Omega2 Pro is based on the openwrt-18.06 branch.
Stars: ✭ 73 (+284.21%)
Mutual labels:  build-system
vastringify
Type-safe Printf in C
Stars: ✭ 60 (+215.79%)
Mutual labels:  c11
saker.build
A modern build system focusing on fast and incremental builds for all project sizes
Stars: ✭ 51 (+168.42%)
Mutual labels:  build-system

Automated build for modern CMake and modern C/C++

INTRODUCTION

This script assumes a conventional source tree for C++ projects:

  • All sources to be compiled are assumed to be located in an src folder.
  • All public header files to be installed are assumed to be located in an include folder.
  • All source files that contains a main function are assumed to be executables of the same name as the source file.
  • All other sources compiled together to a library of the name of the folder containing them, or the name of the package.
  • All other packages that a package depends on should be located in a packages folder.
  • Prebuilt packages can be provided as an alternative to source packages, assuming the platform and compiler they were built for match the current ones.

BOOTSTRAP

For a new package named foo:

mkdir -p foo
wget -Pfoo https://git.io/CMakeBuildPackage.cmake
wget -Pfoo https://git.io/CMakeLists.txt
cmake -Bfoo/build -Hfoo && cmake --build foo/build

The project is now ready to be committed:

git init foo
echo 'build/' > foo/.gitignore
git -C foo add '*.cmake' 'CMakeLists.txt' '.gitignore'
git -C foo commit -m 'Initial commit'

You can also edit the CMakeLists.txt to set the package name, version and dependencies.

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
include(CMakeBuildPackage)

build_package(NAME foo VERSION 1.0.6
  REQUIRES
    "boo"
    "bar>=1.2.3"
    "baz==3.2.1"
)

UPDATE

Download CMakeBuildPackage.cmake from the same URL as above, and rebuild once before committing the changes:

rm foo/CMakeBuildPackage.cmake
wget -Pfoo https://git.io/CMakeBuildPackage.cmake
cmake -Bfoo/build -Hfoo && cmake --build foo/build

git -C foo add -u 'CMakeBuildPackage.cmake' 'foo-config*.cmake'
git -C foo commit -m 'Update CMakeBuildPackage'

OPTIONS

Some package may offer build-time customization by defining compile time options. Boolean options, as well as multi-value options are supported.

Options are passed the preprocessor as macros with the expected values, and the prebuilt versions of the package will remember the options and their values, and will expose them in the package public interface.

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
include(CMakeBuildPackage)

build_package(NAME foo VERSION 1.0.6
  OPTIONS
    OPTION FOO_ENABLE_EXPERIMENTAL "Enable super experimental feature" OFF
    OPTION FOO_BACKEND             "Backend to compile for"            BAR "BAR;BAZ;BOO"
)

SYSTEM INTEGRATION

Integration with system libraries and third-party libraries that are not using CMakeBuildPackage is possible, but the implementation is still experimental.

An experimental meta-package is available in the packages/system folder, which will be automatically included when available. This meta-package provides the required bridges to make several system libraries available as requirements.

As a starting point, the https://github.com/berenm/cmake-build-package-system repository can be used as a submodule in packages/system to bridge a few libraries of your system into the packaging mechanism.

For example, assuming the system meta-package is correctly located, it should be possible to import the zlib, libpng and some Boost libraries with something like:

build_package(NAME foo VERSION 1.0.6
  REQUIRES
    "system" # to pull the bridges into the search scope
    "zlib"
    "libpng>=1.2.3"
    "boost==1.62.0"
    "boost::filesystem==1.62.0"
    "boost::atomic==1.62.0"
)

LICENSE

This is free and unencumbered software released into the public domain.

See accompanying file UNLICENSE or copy at http://unlicense.org/UNLICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].