Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Checkout OSI
uses: actions/checkout@v4
with:
submodules: true
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
Expand Down
7 changes: 3 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "examples/open-simulation-interface"]
path = examples/open-simulation-interface
url = https://github.com/OpenSimulationInterface/open-simulation-interface.git
branch = master
[submodule "examples/osi-cpp"]
path = examples/osi-cpp
url = https://github.com/PMSFIT/osi-cpp.git
11 changes: 6 additions & 5 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project("OSMPExamples")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Modules/")

# Set a default build type if none was specified
Expand Down Expand Up @@ -29,11 +30,11 @@ set(OSMP_VERSION_PATCH ${CMAKE_MATCH_1})

set(OSMPVERSION "${OSMP_VERSION_MAJOR}.${OSMP_VERSION_MINOR}.${OSMP_VERSION_PATCH}" CACHE STRING "OSMP Version String")

add_subdirectory( open-simulation-interface )
add_subdirectory( osi-cpp )

get_directory_property(OSI_VERSION_MAJOR DIRECTORY open-simulation-interface DEFINITION VERSION_MAJOR)
get_directory_property(OSI_VERSION_MINOR DIRECTORY open-simulation-interface DEFINITION VERSION_MINOR)
get_directory_property(OSI_VERSION_PATCH DIRECTORY open-simulation-interface DEFINITION VERSION_PATCH)
get_directory_property(OSI_VERSION_MAJOR DIRECTORY osi-cpp DEFINITION VERSION_MAJOR)
get_directory_property(OSI_VERSION_MINOR DIRECTORY osi-cpp DEFINITION VERSION_MINOR)
get_directory_property(OSI_VERSION_PATCH DIRECTORY osi-cpp DEFINITION VERSION_PATCH)
set(OSIVERSION "${OSI_VERSION_MAJOR}.${OSI_VERSION_MINOR}.${OSI_VERSION_PATCH}")

include_directories( includes )
Expand Down
19 changes: 19 additions & 0 deletions examples/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": 3,
"configurePresets": [
{
"name": "vcpkg",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
},
{
"name": "vcpkg-windows",
"inherits": "vcpkg",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
}
}
]
}
2 changes: 1 addition & 1 deletion examples/OSMPCNetworkProxy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(OSMPCNetworkProxy)

set(PUBLIC_LOGGING OFF CACHE BOOL "Enable logging via FMI logger")
Expand Down
4 changes: 2 additions & 2 deletions examples/OSMPDummySensor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(OSMPDummySensor)

set(CMAKE_CXX_STANDARD 11)
Expand All @@ -23,7 +23,7 @@ string(MD5 FMUGUID modelDescription.in.xml)
configure_file(modelDescription.in.xml modelDescription.xml @ONLY)
configure_file(OSMPDummySensorConfig.in.h OSMPDummySensorConfig.h)

find_package(Protobuf 2.6.1 REQUIRED)
find_package(Protobuf REQUIRED)
add_library(OSMPDummySensor SHARED OSMPDummySensor.cpp)
set_target_properties(OSMPDummySensor PROPERTIES PREFIX "")
target_compile_definitions(OSMPDummySensor PRIVATE "FMU_SHARED_OBJECT")
Expand Down
4 changes: 2 additions & 2 deletions examples/OSMPDummySource/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(OSMPDummySource)

set(CMAKE_CXX_STANDARD 11)
Expand All @@ -23,7 +23,7 @@ string(MD5 FMUGUID modelDescription.in.xml)
configure_file(modelDescription.in.xml modelDescription.xml @ONLY)
configure_file(OSMPDummySourceConfig.in.h OSMPDummySourceConfig.h)

find_package(Protobuf 2.6.1 REQUIRED)
find_package(Protobuf REQUIRED)
add_library(OSMPDummySource SHARED OSMPDummySource.cpp)
set_target_properties(OSMPDummySource PROPERTIES PREFIX "")
target_compile_definitions(OSMPDummySource PRIVATE "FMU_SHARED_OBJECT")
Expand Down
1 change: 0 additions & 1 deletion examples/open-simulation-interface
Submodule open-simulation-interface deleted from 25188c
1 change: 1 addition & 0 deletions examples/osi-cpp
Submodule osi-cpp added at 47d2fa
14 changes: 14 additions & 0 deletions examples/vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"default-registry": {
"kind": "git",
"baseline": "4f8fe05871555c1798dbcb1957d0d595e94f7b57",
"repository": "https://github.com/microsoft/vcpkg"
},
"registries": [
{
"kind": "artifact",
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
"name": "microsoft"
}
]
}
5 changes: 5 additions & 0 deletions examples/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"protobuf"
]
}