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,--prefixPATH¶ Set prefix where packages are installed. This defaults to a directory named
cgetin the current working directory. This can also be overidden by theCGET_PREFIXenvironment variable.
-
-v,--verbose¶ Enable verbose mode.
-
-B,--build-pathPATH¶ 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,--defineVAR=VALUE¶ Extra configuration variables to pass to CMake
-
-T,--targetTARGET¶ Cmake target to build.
-
-y,--yes¶ Affirm all questions.
-
-G,--generatorGENERATOR¶ 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,--prefixPATH¶ Set prefix where packages are installed. This defaults to a directory named
cgetin the current working directory. This can also be overidden by theCGET_PREFIXenvironment 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,--prefixPATH¶ Set prefix where packages are installed. This defaults to a directory named
cgetin the current working directory. This can also be overidden by theCGET_PREFIXenvironment variable.
-
-v,--verbose¶ Enable verbose mode.
-
-B,--build-pathPATH¶ Set the path for the build directory to use when building the package.
-
-t,--toolchainFILE¶ Set cmake toolchain file to use.
-
--cxxCOMPILER¶ Set c++ compiler.
-
--cxxflagsFLAGS¶ Set additional c++ flags.
-
--ldflagsFLAGS¶ Set additional linker flags.
-
--stdTEXT¶ Set C++ standard if available.
-
-D,--defineVAR=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.
-
-p,--prefixPATH¶ Set prefix where packages are installed. This defaults to a directory named
cgetin the current working directory. This can also be overidden by theCGET_PREFIXenvironment variable.
-
-v,--verbose¶ Enable verbose mode.
-
-B,--build-pathPATH¶ 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,--fileFILE¶ Install packages listed in the file.
-
-D,--defineVAR=VALUE¶ Extra configuration variables to pass to CMake.
-
-G,--generatorGENERATOR¶ 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,--prefixPATH¶ Set prefix where packages are installed. This defaults to a directory named
cgetin the current working directory. This can also be overidden by theCGET_PREFIXenvironment 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,--prefixPATH¶ Set prefix where packages are installed. This defaults to a directory named
cgetin the current working directory. This can also be overidden by theCGET_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,--prefixPATH¶ Set prefix where packages are installed. This defaults to a directory named
cgetin the current working directory. This can also be overidden by theCGET_PREFIXenvironment variable.
-
-v,--verbose¶ Enable verbose mode.
-
-y,--yes¶ Affirm all questions.