Installation
POET is header-only, consumable directly from source or as an installed CMake package.
Local CMake project
add_subdirectory(extern/poet)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE poet::poet)
Installed package
Install:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
cmake --install build --prefix /custom/prefix
Consume:
find_package(poet CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE poet::poet)
FetchContent
include(FetchContent)
FetchContent_Declare(
poet
GIT_REPOSITORY https://github.com/flatironinstitute/poet.git
GIT_TAG main
)
FetchContent_MakeAvailable(poet)
target_link_libraries(my_app PRIVATE poet::poet)
Non-CMake builds
Generate the version header once (include/poet/version.hpp is not tracked in
git), then add include/ to the compiler include path:
cmake -P cmake/GenerateVersion.cmake
Include <poet/poet.hpp>.