cmkr, pronounced "cmaker", is A CMakeLists.txt generator from TOML.
cmkr, pronounced "cmaker", is A CMakeLists.txt generator from TOML.
See the [cmkr topic](https://github.com/topics/cmkr) for examples. Feel free to add the `cmkr` topic to your projects if you used cmkr!
## Building
## Building
cmkr requires a C++11 compiler, cmake >= 3.15.
cmkr requires a C++11 compiler, cmake >= 3.15.
```
```
git clone https://github.com/moalyousef/cmkr
git clone https://github.com/moalyousef/cmkr
cd cmkr
cd cmkr
@ -13,7 +16,9 @@ cmake --build bin --parallel
```
```
## Usage
## Usage
cmkr parses cmake.toml files (using toml11 by Toru Niina) at the project directory. A basic hello world format with the minimum required fields:
cmkr parses cmake.toml files (using toml11 by Toru Niina) at the project directory. A basic hello world format with the minimum required fields:
```toml
```toml
[cmake]
[cmake]
minimum = "3.15"
minimum = "3.15"
@ -22,106 +27,15 @@ minimum = "3.15"
name = "app"
name = "app"
version = "0.1.0"
version = "0.1.0"
[[target]]
[target.app]
name = "app"
type = "executable"
type = "executable"
sources = ["src/main.cpp"]
sources = ["src/main.cpp"]
```
```
This project's cmake.toml:
**NOTE**: The documentation is currently a work-in-progress due to breaking changes since `0.1.4`. For examples you can check the [cmkr topic](https://github.com/topics/cmkr).
The cmkr executable can be run from the command-line:
The cmkr executable can be run from the command-line:
```
```
Usage: cmkr [arguments]
Usage: cmkr [arguments]
arguments:
arguments:
@ -133,7 +47,9 @@ arguments:
help Show help.
help Show help.
version Current cmkr version.
version Current cmkr version.
```
```
The build command invokes cmake and the default build-system on your platform (unless a generator is specified), it also accepts extra cmake build arguments:
The build command invokes cmake and the default build-system on your platform (unless a generator is specified), it also accepts extra cmake build arguments:
```
```
cmkr build --config Release
cmkr build --config Release
```
```
@ -141,20 +57,26 @@ cmkr build --config Release
## Binary types
## Binary types
### executable
### executable
Executable binary. Equivalent to [add_executable(name)](https://cmake.org/cmake/help/latest/command/add_executable.html).
Executable binary. Equivalent to [add_executable(name)](https://cmake.org/cmake/help/latest/command/add_executable.html).
### library
### library
Library, can be static or shared depending on the BUILD_SHARED_LIBS variable. Equivalent to [add_library()](https://cmake.org/cmake/help/latest/command/add_library.html).
Library, can be static or shared depending on the BUILD_SHARED_LIBS variable. Equivalent to [add_library()](https://cmake.org/cmake/help/latest/command/add_library.html).
### static
### static
Static library/archive. Equivalent to [add_library(name STATIC)](https://cmake.org/cmake/help/latest/command/add_library.html).
Static library/archive. Equivalent to [add_library(name STATIC)](https://cmake.org/cmake/help/latest/command/add_library.html).
### shared
### shared
Shared/dynamic library. Equivalent to [add_library(name SHARED)](https://cmake.org/cmake/help/latest/command/add_library.html).
Shared/dynamic library. Equivalent to [add_library(name SHARED)](https://cmake.org/cmake/help/latest/command/add_library.html).
### interface
### interface
Header-only library. Equivalent to [add_library(name INTERFACE)](https://cmake.org/cmake/help/latest/command/add_library.html).
Header-only library. Equivalent to [add_library(name INTERFACE)](https://cmake.org/cmake/help/latest/command/add_library.html).