CppML can be installed in two ways. You can install it using cmake as an INTERFACE
library, or you can embed it in your project (e.g. via git submodules
or direct-copy).
NOTE: as CppML is a header only library, you can also simply copy the include/
directory to the path of your project.
CppML is available as a CMake INTERFACE
library. To install using cmake, clone the repository and execute the following commands from within the cloned folder.
git clone https://github.com/ZigaSajovic/CppML; cd CppML
mkdir build && cd build
cmake ..
make install
Consider running the build/install command with setting the install prefix, if you do not want to install CppML system wide
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/CppML-install
To use the installed library in your project, named my_project
, add the following two lines to your CMakeLists.txt
.
find_package(CppML REQUIRED)
target_link_libraries(my_project CppML::CppML)
You can embed the entire CppML source tree into your project's source tree (e.g. via git submodules
, or copying the CppML directory to the root of your project).
To use the installed library in your project, named my_project
, add the following two lines to your CMakeLists.txt
.
add_subdirectory(CppML)
target_link_libraries(my_project CppML::CppML)