Core C++ functionality used by other kaycxx libraries and apps.
- C++23 compiler and standard library
#include <kaycxx/core/scope.hpp>
int main() {
auto cleanup = kaycxx::core::scope_exit{[]() noexcept {
// Scope destruction
}};
}CMake users consume the installed package with:
find_package(kaycxx-core 1.0.0 CONFIG REQUIRED)
target_link_libraries(my-target PRIVATE kaycxx::core)Non-CMake users can use pkg-config:
c++ $(pkg-config --cflags kaycxx-core) -c main.cpp
c++ main.o $(pkg-config --libs kaycxx-core)cmake -B build
cmake --build buildA shared library is built by default. For a static build:
cmake -B build -D BUILD_SHARED_LIBS=OFF
cmake --build buildcmake --install build --prefix /tmp/rootIf no prefix is specified, CMake installs to /usr/local by default on Unix systems.
Run all tests:
cmake --build build --target testGenerate API documentation with Doxygen:
cmake --build build --target apidocThe generated HTML documentation is written to build/apidoc/html/index.html.