2020-09-09 15:19:03 +03:00
2020-09-09 15:19:03 +03:00
2020-09-09 02:58:59 +03:00
2020-09-09 02:59:09 +03:00
2020-09-09 08:01:28 +03:00
2020-09-09 02:58:59 +03:00
2020-09-09 15:04:00 +03:00
2020-09-09 10:37:02 +03:00
2020-09-09 08:09:23 +03:00
2020-09-09 15:10:23 +03:00

cmkr

A CMakeLists.txt generator from TOML. Still WIP.

Building

cmkr requires a C++17 compiler and git. It depends on toml11 by ToruNiina, which is added as a git submodule.

git clone https://github.com/moalyousef/cmkr
cd cmkr
git submodule update --init --recursive
cmake -S. -Bbin
cmake --build bin

Usage

cmkr parses cmake.toml files (using toml11) at the project directory. A basic hello world format with the minimum required fields:

[cmake]
minimum_required = "3.0"

[project]
name = "cmkr"
version = "0.1.0"

[[bin]]
name = "cmkr"
type = "exe"
sources = ["src/main.cpp"]

Currently supported fields:

[cmake] # required
minimum_required = "3.0" # required
# cpp_flags = [] # optional
# c_flags = [] # optional
# linker_flags = [] # optional
# subdirs = [] # optional

[project] # required
name = "cmkr" # required
version = "0.1.0" # required

[dependencies] # optional, runs find_package, use "*" to ignore version
boost = "1.74.0" # optional

[[bin]] # required
name = "cmkr" # required
type = "exe" # required (exe || shared || static)
sources = ["src/main.cpp", "src/args.cpp", "src/gen.cpp"] # required
include_directories = ["vendor"] # optional
compile_features = ["cxx_std_17"] # optional
# link_libraries = [] # optional 

The cmkr executable can be run from the command-line:

Usage: cmkr [arguments]
arguments:
    init     [exe|shared|static]    Starts a new project in the same directory.
    gen                             Generates CMakeLists.txt file.
    build    [cmake args...]        Run cmake and build.
    help                            Show help.
    version                         Current cmkr version.

The build command invokes cmake and the default build-system on your platform, it also accepts extra cmake arguments:

cmkr build -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain -DCMAKE_BUILD_TYPE=Release 

Roadmap

  • Support more fields.
  • Support conditional cmake args somehow!
S
Description
Automated archival mirror of github.com/build-cpp/cmkr
Readme MIT 1.1 MiB
Languages
C++ 85.3%
CMake 14.4%
Objective-C 0.2%
C 0.1%