Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated info on what is need to build with cmake #60

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,42 @@ auto swaggerController = oatpp::swagger::Controller::createShared(<list-of-endpo
swaggerController->addEndpointsToRouter(router);
```

3) cmake :

Add the following lines to your CMakeLists.txt project file
```

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()

include_directories(${oatpp_INCLUDE_DIRS})
include_directories(${oatpp-swagger_INCLUDE_DIRS})

set(SWAGGER_ROOT_PATH "/swagger" CACHE STRING "Default root path to the Swagger")
set(SWAGGER_UI_PATH "/ui" CACHE STRING "Default path suffix to the Swagger UI")

add_compile_definitions(
SWAGGER_ROOT_PATH="${SWAGGER_ROOT_PATH}"
SWAGGER_UI_PATH="${SWAGGER_UI_PATH}"
-DOATPP_SWAGGER_RES_PATH="${OATPP_BASE_DIR}/bin/oatpp-swagger/res"
)

target_link_libraries (project PUBLIC

PUBLIC oatpp::oatpp
PUBLIC oatpp::oatpp-swagger
)
```

**Done!**