From 518e002cb345dae64c539448b8dc7bbc64d732e1 Mon Sep 17 00:00:00 2001 From: snider Date: Thu, 16 Oct 2025 12:24:19 +0100 Subject: [PATCH] adds swagger assets + OpenAPI spec to {pkg}/share/lthn_api/res/* + {pkg}/share/lthn_api/oas-3.0.0.json --- src/api/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt index 63750b62..e0c0f54a 100644 --- a/src/api/CMakeLists.txt +++ b/src/api/CMakeLists.txt @@ -31,7 +31,15 @@ target_link_libraries(lthn_api PUBLIC oatpp::oatpp-swagger ) -target_compile_definitions(lthn_api PUBLIC -DOATPP_SWAGGER_RES_PATH="${oatpp-swagger_INCLUDE_DIRS}/../bin/oatpp-swagger/res") +# Define path to swagger resources for the installed package. +# This assumes the executable is in 'bin' and resources are in 'share/lthn_api'. +target_compile_definitions(lthn_api PUBLIC -DOATPP_SWAGGER_RES_PATH="../share/lthn_api/res") + +# Install swagger resources to a conventional location. +install(DIRECTORY ${oatpp-swagger_INCLUDE_DIRS}/../bin/oatpp-swagger/res DESTINATION share/lthn_api) + +# Install OpenAPI spec for SDK generation +install(FILES ${CMAKE_SOURCE_DIR}/utils/sdk/spec/oas-3.0.0.json DESTINATION share/lthn_api) #add_executable(lethean-api main.cpp)