The missing tools in CMake:
cmk new: Create a new CMake boilerplate project.cmk run: Builds and runs a specified executable target, getting rid of the build directory and binary path.cmk build: Automatically discovers the project's build directory and invokes the build process from any subdirectory.cmk build-tu: Speeds up iteration by compiling a single source file (translation unit) on its own.
Requirement:
- Only works with CMake projects with
Ninjaas the generator(Ninja Multi-Configis not supported). fzfis required for interactive selection.- The project root discovery only works in a git repository.
Environment Variables:
CMK_DEFAULT_JOBS: The default number of build jobs to use. If not set, it defaults to the number of available CPU cores minus one.
Example of .cmk.toml:
[vars]
DEPS_DIR = "${PROJECT_ROOT}/.deps"
DEPS_INSTALL = "${DEPS_DIR}/install"
[env]
PATH = { prepend = ["${DEPS_INSTALL}/bin"] }
CPATH = { prepend = ["${DEPS_INSTALL}/include"] }
PKG_CONFIG_PATH = { prepend = ["${DEPS_INSTALL}/lib/pkgconfig"] }
LIBRARY_PATH = { prepend = ["${DEPS_INSTALL}/lib"] }
[env.macos]
DYLD_LIBRARY_PATH = { prepend = ["${DEPS_INSTALL}/lib"] }
[env.linux]
LD_LIBRARY_PATH = { prepend = ["${DEPS_INSTALL}/lib", "${DEPS_INSTALL}/lib64"] }
PKG_CONFIG_PATH = { prepend = ["${DEPS_INSTALL}/lib64/pkgconfig"] }
LIBRARY_PATH = { prepend = ["${DEPS_INSTALL}/lib64"] }