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. This will also install the dependencies in a dev-requirements.txt
file if available, otherwise it will install any dependencies in the requirements.txt
.
-
<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 theCGET_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 thecheck
target. If that fails it will callctest
to try to run the tests.
-
-c
,
--configure
¶
Configure cmake. This will run either
ccmake
orcmake-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.
-
--debug
¶
Build the debug version of the package.
-
--release
¶
Build the release version of the package.
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 theCGET_PREFIX
environment 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
cget
in the current working directory. This can also be overidden by theCGET_PREFIX
environment 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
cget
in the current working directory. This can also be overidden by theCGET_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.
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 -DCMAKE_TOOLCHAIN_FILE=$CGET_PREFIX/cget/cget.cmake -DCMAKE_INSTALL_PREFIX=$CGET_PREFIX ..
cmake --build .
cmake --build . --target install
However, cget
will always create the build directory out of source. The cget.cmake
is a toolchain file that is setup by cget
, 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
cget
will default to using therequirements.txt
file or thedev-requirements.txt
file if available. That iscget install
is equivalent tocget install -f requirements.txt
orcget install -f dev-requirements.txt
.
-
-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 theCGET_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 thecheck
target. If that fails it will callctest
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.
-
--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
cget
in the current working directory. This can also be overidden by theCGET_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 theCGET_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 theCGET_PREFIX
environment 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
install
command can be used to relink the package.