Commands¶
build¶
- <package-source>¶
This specifies the package source (see Package source) that will be built.
- -p, --prefix PATH¶
Set prefix where packages are installed. This defaults to a directory named
carbinin the current working directory. This can also be overridden by theCARBIN_PREFIXenvironment variable.
- -v, --verbose¶
Enable verbose mode.
- -B, --build-path PATH¶
Set the path for the build directory to use when building the package.
- -t, --test¶
Test package after building. This will set the
BUILD_TESTINGcmake variable to true. It will first try to run thechecktarget. If that fails it will callctestto try to run the tests.
- -c, --configure¶
Configure cmake. This will run either
ccmakeorcmake-guiso the cmake variables can be set.
- -C, --clean¶
Remove build directory.
- -P, --path¶
Show path to build directory.
- -D, --define VAR=VALUE¶
Extra configuration variables to pass to CMake
- -T, --target TARGET¶
Cmake target to build.
- -y, --yes¶
Affirm all questions.
- -G, --generator GENERATOR¶
Set the generator for CMake to use.
- --debug¶
Build the debug version of the package.
- --release¶
Build the release version of the package.
clean¶
This will clear the directory used by carbin. This will remove all packages that have been installed, and any toolchain settings.
- -p, --prefix PATH¶
Set prefix where packages are installed. This defaults to a directory named
carbinin the current working directory. This can also be overridden by theCARBIN_PREFIXenvironment variable.
- -v, --verbose¶
Enable verbose mode.
- -y, --yes¶
Affirm all questions.
ignore¶
This will ignore a package, so if an install command or a dependency requests the package it will be treated as already installed. This is useful to ignore a dependency that may already be installed by the system.
- <package-name>¶
This is the name of the package that will be ignored.
- -p, --prefix PATH¶
Set prefix where packages are installed. This defaults to a directory named
carbinin the current working directory. This can also be overridden by theCARBIN_PREFIXenvironment variable.
- -v, --verbose¶
Enable verbose mode.
init¶
This will initialize the cmake toolchain. By default, the install command will initialize a cmake toolchain if one doesn’t exists. This allows setting different variable, such as setting C++ compiler or standard version.
- -p, --prefix PATH¶
Set prefix where packages are installed. This defaults to a directory named
carbinin the current working directory. This can also be overridden by theCARBIN_PREFIXenvironment variable.
- -v, --verbose¶
Enable verbose mode.
- -B, --build-path PATH¶
Set the path for the build directory to use when building the package.
- -t, --toolchain FILE¶
Set cmake toolchain file to use.
- --cc COMPILER¶
Set c compiler.
- --cxx COMPILER¶
Set c++ compiler.
- --cflags FLAGS¶
Set additional c flags.
- --cxxflags FLAGS¶
Set additional c++ flags.
- --ldflags FLAGS¶
Set additional linker flags.
- --std TEXT¶
Set C++ standard if available.
- -D, --define VAR=VALUE¶
Extra configuration variables to pass to CMake.
Set toolchain to build shared libraries by default.
- --static¶
Set toolchain to build static libraries by default.
install¶
A package can be installed using the install command. When a package is installed, carbin configures a build directory with cmake, and then builds the all target and the install target. So, essentially, carbin will run the equivalent of these commands on the package to install it:
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$CARBIN_PREFIX/carbin/carbin.cmake -DCMAKE_INSTALL_PREFIX=$CARBIN_PREFIX ..
cmake --build .
cmake --build . --target install
However, carbin will always create the build directory out of source. The carbin.cmake is a toolchain file that is setup by carbin, so that cmake can find the installed packages. Other setting can be added about the toolchain as well(see init).
- <package-source>¶
This specifies the package source (see Package source) that will be installed. If no package source is provided then
carbinwill default to using thecarbin_deps.txtfile or thedev-carbin_deps.txtfile if available. That iscarbin installis equivalent tocarbin install -f carbin_deps.txtorcarbin install -f dev-carbin_deps.txt.
- -p, --prefix PATH¶
Set prefix where packages are installed. This defaults to a directory named
carbinin the current working directory. This can also be overridden by theCARBIN_PREFIXenvironment variable.
- -v, --verbose¶
Enable verbose mode.
- -B, --build-path PATH¶
Set the path for the build directory to use when building the package.
- -U, --update¶
Update package. This will rebuild the package even its already installed and replace it with the newly built package.
- -t, --test¶
Test package before installing. This will set the
BUILD_TESTINGcmake variable to true. It will first try to run thechecktarget. If that fails it will callctestto try to run the tests.
- --test-all¶
Test all packages including its dependencies before installing by running ctest or check target.
- -f, --file FILE¶
Install packages listed in the file.
- -D, --define VAR=VALUE¶
Extra configuration variables to pass to CMake.
- -G, --generator GENERATOR¶
Set the generator for CMake to use.
- -X, --cmake¶
This specifies an alternative cmake file to be used to build the library. This is useful for packages that don’t have a cmake file.
- --debug¶
Install the debug version of the package.
- --release¶
Install the release version of the package.
list¶
This will list all packages that have been installed.
- -p, --prefix PATH¶
Set prefix where packages are installed. This defaults to a directory named
carbinin the current working directory. This can also be overridden by theCARBIN_PREFIXenvironment variable.
- -v, --verbose¶
Enable verbose mode.
pkg-config¶
This will run pkg-config, but will search in the carbin directory for pkg-config files. This useful for finding dependencies when not using cmake.
- -p, --prefix PATH¶
Set prefix where packages are installed. This defaults to a directory named
carbinin the current working directory. This can also be overridden by theCARBIN_PREFIXenvironment variable.
- -v, --verbose¶
Enable verbose mode.
remove¶
This will remove a package. If other packages depends on the package to be removed, those packages will be removed as well.
- <package-name>¶
This is the name of the package to be removed.
- -p, --prefix PATH¶
Set prefix where packages are installed. This defaults to a directory named
carbinin the current working directory. This can also be overridden by theCARBIN_PREFIXenvironment variable.
- -v, --verbose¶
Enable verbose mode.
- -y, --yes¶
Affirm all questions.
- -A, --all¶
Select all packages installed.
- -U, --unlink¶
Unlink the package but don’t remove it. The
installcommand can be used to relink the package.