From c7b8de48b6b72debda9a59acae7c4e16865cffb5 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Tue, 22 Jul 2025 11:52:31 +0200 Subject: [PATCH 1/2] Adjust build to new separate repo setup Signed-off-by: Pierre R. Mai --- .github/workflows/protobuf.yml | 2 +- .gitmodules | 7 +++---- examples/CMakeLists.txt | 11 ++++++----- examples/CMakePresets.json | 19 +++++++++++++++++++ examples/OSMPCNetworkProxy/CMakeLists.txt | 2 +- examples/OSMPDummySensor/CMakeLists.txt | 4 ++-- examples/OSMPDummySource/CMakeLists.txt | 4 ++-- examples/open-simulation-interface | 1 - examples/osi-cpp | 1 + examples/vcpkg-configuration.json | 14 ++++++++++++++ examples/vcpkg.json | 5 +++++ 11 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 examples/CMakePresets.json delete mode 160000 examples/open-simulation-interface create mode 160000 examples/osi-cpp create mode 100644 examples/vcpkg-configuration.json create mode 100644 examples/vcpkg.json diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index b3fa70e..bad79f5 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -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 diff --git a/.gitmodules b/.gitmodules index 4f956e3..c8050f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 2b8f93a..b936139 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -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 @@ -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 ) diff --git a/examples/CMakePresets.json b/examples/CMakePresets.json new file mode 100644 index 0000000..cc69dea --- /dev/null +++ b/examples/CMakePresets.json @@ -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" + } + } + ] +} diff --git a/examples/OSMPCNetworkProxy/CMakeLists.txt b/examples/OSMPCNetworkProxy/CMakeLists.txt index 372bb56..f998839 100644 --- a/examples/OSMPCNetworkProxy/CMakeLists.txt +++ b/examples/OSMPCNetworkProxy/CMakeLists.txt @@ -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") diff --git a/examples/OSMPDummySensor/CMakeLists.txt b/examples/OSMPDummySensor/CMakeLists.txt index 625725d..f30b05b 100644 --- a/examples/OSMPDummySensor/CMakeLists.txt +++ b/examples/OSMPDummySensor/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) project(OSMPDummySensor) set(CMAKE_CXX_STANDARD 11) @@ -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") diff --git a/examples/OSMPDummySource/CMakeLists.txt b/examples/OSMPDummySource/CMakeLists.txt index e7c2f48..412d8cc 100644 --- a/examples/OSMPDummySource/CMakeLists.txt +++ b/examples/OSMPDummySource/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) project(OSMPDummySource) set(CMAKE_CXX_STANDARD 11) @@ -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") diff --git a/examples/open-simulation-interface b/examples/open-simulation-interface deleted file mode 160000 index 25188c8..0000000 --- a/examples/open-simulation-interface +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 25188c886bf20588c2b7c3f54a631c75e437083b diff --git a/examples/osi-cpp b/examples/osi-cpp new file mode 160000 index 0000000..47201aa --- /dev/null +++ b/examples/osi-cpp @@ -0,0 +1 @@ +Subproject commit 47201aa08a5aa9b90b90a7f2f73a6b0c6f77048a diff --git a/examples/vcpkg-configuration.json b/examples/vcpkg-configuration.json new file mode 100644 index 0000000..0f3f891 --- /dev/null +++ b/examples/vcpkg-configuration.json @@ -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" + } + ] +} diff --git a/examples/vcpkg.json b/examples/vcpkg.json new file mode 100644 index 0000000..4b3fb5d --- /dev/null +++ b/examples/vcpkg.json @@ -0,0 +1,5 @@ +{ + "dependencies": [ + "protobuf" + ] +} From 6046c10a07ec50ba0d328f66517459e530767969 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Thu, 23 Oct 2025 14:25:46 +0200 Subject: [PATCH 2/2] Update to current OSI master Signed-off-by: Pierre R. Mai --- examples/osi-cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osi-cpp b/examples/osi-cpp index 47201aa..47d2faf 160000 --- a/examples/osi-cpp +++ b/examples/osi-cpp @@ -1 +1 @@ -Subproject commit 47201aa08a5aa9b90b90a7f2f73a6b0c6f77048a +Subproject commit 47d2faf2805a409cb10348df68d1f93ae480908f