Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial dummy example code to illustrate draft spec.
- Loading branch information
Showing
13 changed files
with
1,631 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "examples/open-simulation-interface"] | ||
path = examples/open-simulation-interface | ||
url = https://github.com/OpenSimulationInterface/open-simulation-interface.git | ||
branch = feature/initial-build-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cmake_minimum_required(VERSION 3.7) | ||
add_subdirectory( open-simulation-interface ) | ||
include_directories( includes ) | ||
add_subdirectory( OSMPDummySensor ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
cmake_minimum_required(VERSION 3.7) | ||
project(OSMPDummySensor) | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
find_package(Protobuf 2.6.1 REQUIRED) | ||
add_library(OSMPDummySensor SHARED OSMPDummySensor.cpp) | ||
set_target_properties(OSMPDummySensor PROPERTIES PREFIX "") | ||
include_directories(${OSI_PROTOBUF_INCLUDE_PATH}) | ||
target_link_libraries(OSMPDummySensor open_simulation_interface_pic) | ||
if(WIN32) | ||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(FMI_BINARIES_PLATFORM "win64") | ||
else() | ||
set(FMI_BINARIES_PLATFORM "win32") | ||
endif() | ||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(FMI_BINARIES_PLATFORM "linux64") | ||
else() | ||
set(FMI_BINARIES_PLATFORM "linux32") | ||
endif() | ||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(FMI_BINARIES_PLATFORM "darwin64") | ||
else() | ||
set(FMI_BINARIES_PLATFORM "darwin32") | ||
endif() | ||
endif() | ||
add_custom_command(TARGET OSMPDummySensor | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/buildfmu" | ||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}" | ||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/modelDescription.xml" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu" | ||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:OSMPDummySensor> "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}" | ||
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/buildfmu" ${CMAKE_COMMAND} -E tar "cfv" "../OSMPDummySensor.fmu" --format=zip "modelDescription.xml" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}") |
Oops, something went wrong.