Commands

build

This will build a package, but it doesn’t install it. This is useful over using raw cmake as it will use the cmake toolchain that was initialized by cget which sets cmake up to easily find the dependencies that have been installed by cget.

<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 cget in the current working directory. This can also be overidden by the CGET_PREFIX environment 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_TESTING cmake variable to true. It will first try to run the check target. If that fails it will call ctest to try to run the tests.

-c, --configure

Configure cmake. This will run either ccmake or cmake-gui so 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.

clean

This will clear the directory used by cget. 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 cget in the current working directory. This can also be overidden by the CGET_PREFIX environment variable.

-v, --verbose

Enable verbose mode.

-y, --yes

Affirm all questions.

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 cget in the current working directory. This can also be overidden by the CGET_PREFIX environment 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.

--cxx COMPILER

Set c++ compiler.

--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.

--shared

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, cget configures a build directory with cmake, and then builds the all target and the install target. So, essentially, cget will run the equivalent of these commands on the package to install it:

mkdir build
cd build
cmake ..
cmake --build .
cmake --build . --target install

However, cget will always create the build directory out of source. It will also setup cmake to point to the correct prefix and install directories.

<package-source>

This specifies the package source (see Package source) that will be installed.

-p, --prefix PATH

Set prefix where packages are installed. This defaults to a directory named cget in the current working directory. This can also be overidden by the CGET_PREFIX environment 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_TESTING cmake variable to true. It will first try to run the check target. If that fails it will call ctest to 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.

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 cget in the current working directory. This can also be overidden by the CGET_PREFIX environment variable.

-v, --verbose

Enable verbose mode.

pkg-config

This will run pkg-config, but will search in the cget 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 cget in the current working directory. This can also be overidden by the CGET_PREFIX environment 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 cget in the current working directory. This can also be overidden by the CGET_PREFIX environment variable.

-v, --verbose

Enable verbose mode.

-y, --yes

Affirm all questions.