1
0
Fork 0
forked from lthn/blockchain
blockchain/src/api/CMakeLists.txt
Snider df17bf1247 DTOs for block and transaction details, Refactor API server
Replaces RootController and legacy info controller with new InfoController and BlockController, adds DTOs for block and transaction details, and restructures the API server to use modular components. Updates CMakeLists to include new sources and dependencies, and refactors main.cpp to use the new ApiServer entry point. Improves Swagger documentation and endpoint organization for better maintainability and extensibility.
2025-10-10 23:18:02 +01:00

35 lines
1.1 KiB
CMake

if(NOT PROJECT_NAME)
project(lethean-api)
endif()
find_package(oatpp 1.3.0 REQUIRED)
if(oatpp_FOUND)
message(STATUS "Found oatpp version: ${oatpp_VERSION_STRING}")
else()
message(FATAL_ERROR "Could not find oatpp")
endif()
find_package(oatpp-swagger 1.3.0 REQUIRED)
if(oatpp-swagger_FOUND)
message(STATUS "Found oatpp-swagger version: ${oatpp-swagger_VERSION_STRING}")
else()
message(FATAL_ERROR "Could not find oatpp-swagger")
endif()
add_library(lthn_api INTERFACE)
add_library(lthn::api ALIAS lthn_api)
# Add the current directory for API headers and the main src directory for core headers
target_include_directories(lthn_api INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
)
include_directories(${oatpp_INCLUDE_DIRS})
include_directories(${oatpp-swagger_INCLUDE_DIRS})
add_executable(lethean-api main.cpp ApiServer.cpp)
target_link_libraries(lethean-api PRIVATE lthn::api PUBLIC common config oatpp::oatpp oatpp::oatpp-swagger)
add_definitions(-DOATPP_SWAGGER_RES_PATH="${oatpp-swagger_INCLUDE_DIRS}/../bin/oatpp-swagger/res")
#add_subdirectory(tests)