Commits (3)
...@@ -16,3 +16,5 @@ EtsiServerGen/* ...@@ -16,3 +16,5 @@ EtsiServerGen/*
!EtsiServerGen/CMakeLists.txt !EtsiServerGen/CMakeLists.txt
!EtsiServerGen/.openapi-generator-ignore !EtsiServerGen/.openapi-generator-ignore
!EtsiServerGen/patches !EtsiServerGen/patches
!EtsiServerGen/conanfile.txt
EtsiServerImpl/CMakeUserPresets.json
\ No newline at end of file
...@@ -23,3 +23,5 @@ ...@@ -23,3 +23,5 @@
#!docs/README.md #!docs/README.md
CMakeLists.txt CMakeLists.txt
patches
conanfile.txt
project(RestbedGen) #
# ARF - Augmented Reality Framework (ETSI ISG ARF)
cmake_minimum_required(VERSION 3.22) #
# Copyright 2024 ETSI
set(TARGET_NAME org.openapitools.server.apiStubs) #
set(RESTBED_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/external/restbed/source) # Licensed under the Apache License, Version 2.0 (the "License");
set(RESTBED_LIB ${CMAKE_CURRENT_LIST_DIR}/external/restbed/build/librestbed.a) # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
find_package(Boost 1.45.0 REQUIRED COMPONENTS system filesystem regex) #
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Last change: May 2024
#
cmake_minimum_required(VERSION 3.23)
project(worldStorageRestBedcppServer VERSION 2.1.0)
set(TARGET_NAME worldStorageRestBedcppServer)
find_package(Boost REQUIRED)
find_package(restbed REQUIRED)
# Get generated filenames # Get generated filenames
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/.openapi-generator/FILES" GENERATED_SOURCES) file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/.openapi-generator/FILES" GENERATED_SOURCES)
...@@ -38,7 +56,6 @@ include_directories( ...@@ -38,7 +56,6 @@ include_directories(
add_library(${TARGET_NAME} SHARED) add_library(${TARGET_NAME} SHARED)
target_sources(${TARGET_NAME} target_sources(${TARGET_NAME}
PRIVATE PRIVATE
${GENERATED_SOURCES}) ${GENERATED_SOURCES})
...@@ -46,29 +63,16 @@ target_sources(${TARGET_NAME} ...@@ -46,29 +63,16 @@ target_sources(${TARGET_NAME}
target_include_directories(${TARGET_NAME} target_include_directories(${TARGET_NAME}
PUBLIC PUBLIC
${GENERATED_SOURCES_INCLUDE_DIRS} ${GENERATED_SOURCES_INCLUDE_DIRS}
${RESTBED_INCLUDE_DIR}
) )
include_directories(${RESTBED_INCLUDE_DIR})
link_directories( ${RESTBED_INCLUDE_DIR})
target_link_libraries(${TARGET_NAME} target_link_libraries(${TARGET_NAME}
PUBLIC PUBLIC
${RESTBED_LIB} boost::boost
ssl restbed::restbed
crypto
Boost::system
Boost::filesystem
Boost::regex
-lpthread -lpthread
) )
install(FILES ${HDRS} DESTINATION include/${TARGET_NAME})
install(FILES ${HDRS} DESTINATION include) install(TARGETS ${TARGET_NAME} DESTINATION lib)
install(DIRECTORY ${RESTBED_INCLUDE_DIR}/corvusoft DESTINATION include)
#install(TARGETS ${PROJECT_NAME} DESTINATION /usr/lib)
[requires]
boost/1.78.0
restbed/4.8
[generators]
CMakeDeps
CMakeToolchain
[layout]
[options]
# #
# ARF - Augmented Reality Framework (ETSI ISG ARF) # ARF - Augmented Reality Framework (ETSI ISG ARF)
# #
# Copyright 2022 ETSI # Copyright 2024 ETSI
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -15,27 +15,30 @@ ...@@ -15,27 +15,30 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# Last change: June 2022 # Last change: May 2024
# #
cmake_minimum_required(VERSION 3.2)
project(HackPistacheServ VERSION 0.1.0) cmake_minimum_required(VERSION 3.23)
project(RestBedImpl VERSION 2.1.0)
set(TARGET_NAME RestbedImpl)
find_package(Boost REQUIRED)
find_package(restbed REQUIRED)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pg -g3" ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pg -g3" )
file(GLOB SRCS file(GLOB SRCS
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
) )
find_package(PkgConfig) add_executable(${TARGET_NAME} ${SRCS})
pkg_check_modules(PISTACHE REQUIRED libpistache)
find_package(Boost 1.71 REQUIRED)
find_library(PISTACHEGEN libPistacheGen.a)
message(STATUS ${PISTACHEGEN})
add_executable(HackPistacheServ ${SRCS})
include_directories(src) include_directories(src)
target_link_libraries(HackPistacheServ ${PISTACHEGEN} pistache Boost::boost) target_link_libraries(${TARGET_NAME} boost::boost restbed::restbed)
# WORLD STORAGE CPP SERVER (PISTACHE) # WORLD STORAGE CPP SERVER (RESTBED)
## Description ## Description
This folder contains the source files for a basic implementation of the library you just created This folder contains the source files for a basic implementation of the library you just created
## Requirements ## Requirements
- Boost - Ubuntu 22.04
- Pistache - CMake > 2.22
- a cpp compiler - conan V2
## Code usage ## Code usage
Once you are in this directory, to build and execute the server, use the following commands: Once you are in this directory, to build and execute the server, use the following commands:
mkdir -p build conan install . --build=missing
cd build cd build
cmake .. cmake .. --preset conan-release
make make
./HackPistacheServ ./RestbedImpl
[requires]
boost/1.78.0
restbed/4.8
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
\ No newline at end of file
*This repository is part of the outcomes of the Specialist Task Force 620 focusing on the authoring of a World Representation as part of the ETSI ISG Augmented Reality Framework architecture (https://www.etsi.org/deliver/etsi_gs/ARF/001_099/003/01.01.01_60/gs_ARF003v010101p.pdf).* *This repository is part of the outcomes of the Specialist Task Force 620 and 669 focusing on the authoring and use of a World Representation as part of the ETSI ISG Augmented Reality Framework architecture (https://www.etsi.org/deliver/etsi_gs/ARF/001_099/003/01.01.01_60/gs_ARF003v010101p.pdf).*
*The set of the World Representation authoring components includes:* *The set of the World Representation components includes:*
*• The C++ and C# source code for servers and clients generated from OpenAPI available here (https://forge.etsi.org/rep/arf/arf005)* *• The C++ and C# source code for servers and clients generated from OpenAPI available here (https://forge.etsi.org/rep/arf/arf005)*
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
--- ---
# WORLD STORAGE CPP SERVER (PISTACHE) # WORLD STORAGE CPP SERVER (RestBed)
## Description ## Description
This repo contains a pistache server library generation pipeline compliant to the World Storage API. This repo contains a restbed server library generation pipeline compliant to the World Storage API.
It also contains a sample using that library, it's a basic implementation allowing the user to perform all CRUD operations on the Trackable models. It also contains a sample using that library, it's a basic implementation allowing the user to perform all CRUD operations on the Trackable models.
## Repo Content ## Repo Content
...@@ -29,13 +29,30 @@ It also contains a sample using that library, it's a basic implementation allowi ...@@ -29,13 +29,30 @@ It also contains a sample using that library, it's a basic implementation allowi
## Requirements ## Requirements
- A Linux based machine - Ubuntu 22.04
- CMake - CMake > 2.22
- conan V2
- npm - npm
## Install or update cmake
To install the last version of Cmake, we recommend to follow the instruction detailed on the following link (Using APT Repositories): https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line
## Install conan v2
npm install
npm run installConan
## Code Generation ## Code Generation
To generate the code and the DLLs use the following commands: To generate the code and the DLLs use the following commands:
npm install npm install (if not already done)
npm run generate && npm run dependencies && npm run build npm run generate && npm run build
You will find the header files in:
/usr/local/include/worldStorageRestBedcppServer/
and the library file in:
/usr/local/lib/libworldStorageRestBedcppServer.so
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
"Last change: June 2022" "Last change: June 2022"
], ],
"name": "worldstorageserver", "name": "worldstorageserver",
"version": "0.0.1", "version": "2.1.0",
"description": "ISG ARF World Storage Cpp Server", "description": "ISG ARF World Storage Cpp Server",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"generate": "cd EtsiServerGen && sudo java -jar /usr/local/lib/node_modules/@openapitools/openapi-generator-cli/versions/6.6.0.jar generate -i ../openapi/API/worldstorage/worldstorageopenapi.yaml --skip-validate-spec -g cpp-restbed-server -o . && cd patches && sudo ./applyPatches.sh", "generate": "cd EtsiServerGen && java -jar /usr/local/lib/node_modules/@openapitools/openapi-generator-cli/versions/6.6.0.jar generate -i ../openapi/API/worldstorage/worldstorageopenapi.yaml --skip-validate-spec -g cpp-restbed-server -o . && cd patches && ./applyPatches.sh",
"dependencies": "sudo apt update && sudo apt-get install libboost-all-dev && cd EtsiServerGen && mkdir external && cd external && git clone --recursive https://github.com/corvusoft/restbed.git && mkdir restbed/build && cd restbed/build && cmake -DBUILD_SSL=NO -DBUILD_TESTS=NO -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true .. && make install", "installConan": "pip install conan",
"build": "cd EtsiServerGen && sudo mkdir -p build && cd build && sudo cmake .. && sudo make && sudo make install" "build": "cd EtsiServerGen && conan install . --build=missing -of build && cd build && cmake .. --preset conan-release && cmake --build . && sudo make install"
}, },
"devDependencies": { "devDependencies": {
......