Skip to content

Commit cd25589

Browse files
committed
Adjust build to new separate repo setup
Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
1 parent 961f01a commit cd25589

11 files changed

Lines changed: 54 additions & 16 deletions

File tree

.github/workflows/protobuf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Checkout OSI
3030
uses: actions/checkout@v4
3131
with:
32-
submodules: true
32+
submodules: recursive
3333

3434
- name: Setup Python
3535
uses: actions/setup-python@v5

.gitmodules

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[submodule "examples/open-simulation-interface"]
2-
path = examples/open-simulation-interface
3-
url = https://github.com/OpenSimulationInterface/open-simulation-interface.git
4-
branch = master
1+
[submodule "examples/osi-cpp"]
2+
path = examples/osi-cpp
3+
url = https://github.com/PMSFIT/osi-cpp.git

examples/CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.10)
2+
project("OSMPExamples")
23
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Modules/")
34

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

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

32-
add_subdirectory( open-simulation-interface )
33+
add_subdirectory( osi-cpp )
3334

34-
get_directory_property(OSI_VERSION_MAJOR DIRECTORY open-simulation-interface DEFINITION VERSION_MAJOR)
35-
get_directory_property(OSI_VERSION_MINOR DIRECTORY open-simulation-interface DEFINITION VERSION_MINOR)
36-
get_directory_property(OSI_VERSION_PATCH DIRECTORY open-simulation-interface DEFINITION VERSION_PATCH)
35+
get_directory_property(OSI_VERSION_MAJOR DIRECTORY osi-cpp DEFINITION VERSION_MAJOR)
36+
get_directory_property(OSI_VERSION_MINOR DIRECTORY osi-cpp DEFINITION VERSION_MINOR)
37+
get_directory_property(OSI_VERSION_PATCH DIRECTORY osi-cpp DEFINITION VERSION_PATCH)
3738
set(OSIVERSION "${OSI_VERSION_MAJOR}.${OSI_VERSION_MINOR}.${OSI_VERSION_PATCH}")
3839

3940
include_directories( includes )

examples/CMakePresets.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": 3,
3+
"configurePresets": [
4+
{
5+
"name": "vcpkg",
6+
"binaryDir": "${sourceDir}/build",
7+
"cacheVariables": {
8+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
9+
}
10+
},
11+
{
12+
"name": "vcpkg-windows",
13+
"inherits": "vcpkg",
14+
"cacheVariables": {
15+
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
16+
}
17+
}
18+
]
19+
}

examples/OSMPCNetworkProxy/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.10)
22
project(OSMPCNetworkProxy)
33

44
set(PUBLIC_LOGGING OFF CACHE BOOL "Enable logging via FMI logger")

examples/OSMPDummySensor/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.10)
22
project(OSMPDummySensor)
33

44
set(CMAKE_CXX_STANDARD 11)
@@ -23,7 +23,7 @@ string(MD5 FMUGUID modelDescription.in.xml)
2323
configure_file(modelDescription.in.xml modelDescription.xml @ONLY)
2424
configure_file(OSMPDummySensorConfig.in.h OSMPDummySensorConfig.h)
2525

26-
find_package(Protobuf 2.6.1 REQUIRED)
26+
find_package(Protobuf REQUIRED)
2727
add_library(OSMPDummySensor SHARED OSMPDummySensor.cpp)
2828
set_target_properties(OSMPDummySensor PROPERTIES PREFIX "")
2929
target_compile_definitions(OSMPDummySensor PRIVATE "FMU_SHARED_OBJECT")

examples/OSMPDummySource/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.10)
22
project(OSMPDummySource)
33

44
set(CMAKE_CXX_STANDARD 11)
@@ -23,7 +23,7 @@ string(MD5 FMUGUID modelDescription.in.xml)
2323
configure_file(modelDescription.in.xml modelDescription.xml @ONLY)
2424
configure_file(OSMPDummySourceConfig.in.h OSMPDummySourceConfig.h)
2525

26-
find_package(Protobuf 2.6.1 REQUIRED)
26+
find_package(Protobuf REQUIRED)
2727
add_library(OSMPDummySource SHARED OSMPDummySource.cpp)
2828
set_target_properties(OSMPDummySource PROPERTIES PREFIX "")
2929
target_compile_definitions(OSMPDummySource PRIVATE "FMU_SHARED_OBJECT")

examples/open-simulation-interface

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/osi-cpp

Submodule osi-cpp added at 7042920

examples/vcpkg-configuration.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"default-registry": {
3+
"kind": "git",
4+
"baseline": "4f8fe05871555c1798dbcb1957d0d595e94f7b57",
5+
"repository": "https://github.com/microsoft/vcpkg"
6+
},
7+
"registries": [
8+
{
9+
"kind": "artifact",
10+
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
11+
"name": "microsoft"
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)