diff --git a/CMakeLists.txt b/CMakeLists.txt index bd5aa8f..20ee555 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,11 @@ if (ROBOT_FARM_BUILD_ALL OR ROBOT_FARM_BUILD_OATPP) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/OatppExternalProject.cmake) endif () +option(ROBOT_FARM_BUILD_OATPP_WEBSOCKET "Build oatpp websocket" OFF) +if (ROBOT_FARM_BUILD_ALL OR ROBOT_FARM_BUILD_OATPP_WEBSOCKET) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/OatppWebSocketExternalProject.cmake) +endif () + option(ROBOT_FARM_BUILD_OGRE "Build OGRE" OFF) if (ROBOT_FARM_BUILD_ALL OR ROBOT_FARM_BUILD_OGRE) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/OgreExternalProject.cmake) diff --git a/cmake/OatppWebSocketExternalProject.cmake b/cmake/OatppWebSocketExternalProject.cmake new file mode 100644 index 0000000..9c95aad --- /dev/null +++ b/cmake/OatppWebSocketExternalProject.cmake @@ -0,0 +1,24 @@ +#[[ CMake guard. ]] +if(TARGET OatppWebsocketExternalProject) + return() +endif() + +include(ExternalProject) +include(${CMAKE_CURRENT_LIST_DIR}/OatppExternalProject.cmake) + +set(ROBOT_FARM_OATPP_WEBSOCKET_URL + "https://github.com/oatpp/oatpp-websocket/archive/1.0.0.zip" + CACHE STRING + "URL of the oatpp-websocket source archive") + +externalproject_add(OatppWebsocketExternalProject + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/oatpp-websocket + URL ${ROBOT_FARM_OATPP_WEBSOCKET_URL} + DOWNLOAD_NO_PROGRESS ON + CMAKE_ARGS + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_PREFIX_PATH:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DBUILD_SHARED_LIBS:BOOL=ON) + +add_dependencies(OatppWebsocketExternalProject OatppExternalProject)