master | |||||
development | |||||
Current |
Run the following commands in a directory appropriate for temporarily saving source code and build configurations.
git clone https://github.com/onqtam/doctest.git
cd doctest
mkdir build
cd build
cmake ..
cmake --build .
sudo cmake --build . --target install
Run the following commands in the source directory.
mkdir build
cd build
cmake ..
cmake --build .
In the directory build
, that was created for building the actual binaries, run the following command.
ctest --verbose
In the directory build
, that was created for building the actual binaries, run the following command to install the compiled libraries together with the CMake package.
Make sure that you have the permissions to install system libraries.
Otherwise change the CMake installation prefix or use sudo
.
cmake --build . --target install
In the directory build
, that was created for building and installing the actual binaries, run the following command to uninstall the compiled libraries.
Make sure that you have the permissions to remove system libraries.
cmake --build . --target uninstall
In the directory build
, that was created for building the actual binaries, run the following commands.
./main
One can find the installed package by the following command.
find_package(hash_map CONFIG REQUIRED)
For linking against it, one has to use the namespace stroupo
.
target_link_libraries(${TARGET_NAME} PRIVATE/PUBLIC/INTERFACE stroupo::hash_map)
Note that the installation of the library is not required to find and use the CMake package. After building the source code of the project CMake exports a local package configuration which refers to the current build directory. As long as this build directory exists the commands written above can be used to find the library.