Setup with CMake
Note
You only have to choose one of the following variants. We suggest to take the first alternative.
Alternative 1: CMake Package Installation for CMake Projects and Projects without Build System¶
Download the repository and create a configuration.
git clone https://github.com/lyrahgames/pxart.git
mkdir pxart-cmake-build
cd pxart-cmake-build
cmake ../pxart
cmake --build .
ctest --verbose
sudo cmake --build . --target install
sudo cmake --build . --target uninstall
CMakeLists.txt
file, use find_package(pxart)
to find the library and link with the imported target pxart::pxart
by using target_link_libraries
. The following code shows an example. find_package(pxart REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE pxart::pxart)
Alternative 2: CMake Package Export from Build Configuration for CMake Projects¶
Download the repository and create a configuration.
git clone https://github.com/lyrahgames/pxart.git
mkdir pxart-cmake-build
cd pxart-cmake-build
cmake ../pxart
CMakeLists.txt
file, use find_package(pxart)
to find the library and link with the imported target pxart::pxart
by using target_link_libraries
. The following code shows an example. find_package(pxart REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE pxart::pxart)
Last update: January 18, 2021