This repository has been archived by the owner on May 18, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simulation runtime for FMU/OMSU simulation in ANSI C. - Added OMSIC build - Added OMSIC to existing omsi-Makefiles - Use CMake to build SimultaionRuntime/OMSIC - Added OMSIC in Simulation Runtime - Using OMSIBase library for base functionalities shared with OMSICpp runtime - Wrapper for FMI 2.0 ModelExchange functions - Functions for continuous simulation of FMU/OMSU - Functions for event simulation of FMU/OMSU - Getter and Setter functions for FMU/OMSU - Logging and some debugging functionalities - Initialization and deallocation of FMU/OMSU - Documentation with Doxygen - Doxyfile not included Belonging to [master]: - #3059 Co-authored-by: niklwors <niiklas.worschech@boschrexroth.de> Co-authored-by: wibraun <wbraun@fh-bielefeld.de> Belonging to [master]: - #3059
- Loading branch information
1 parent
047112f
commit c252b04
Showing
22 changed files
with
4,176 additions
and
22 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
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,91 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9) | ||
SET(CMAKE_VERBOSE_MAKEFILE ON) | ||
MESSAGE(STATUS "CMake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}") | ||
|
||
PROJECT(OMSICSimulationRuntime) | ||
|
||
# enable warnings and use ANSI C compatible compiler | ||
if(CMAKE_COMPILER_IS_GNUCXX) | ||
message(STATUS "GCC detected, adding compile flags") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -ansi -pedantic -g") | ||
IF(NOT WIN32) | ||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") | ||
ENDIF() | ||
endif(CMAKE_COMPILER_IS_GNUCXX) | ||
message(STATUS "Compiling with C flags: ${CMAKE_C_FLAGS}") | ||
|
||
if(NOT PLATFORM OR PLATFORM STREQUAL "dynamic") | ||
set(BUILD_SHARED_LIBS ON) | ||
elseif(PLATFORM STREQUAL "static") | ||
set(BUILD_SHARED_LIBS OFF) | ||
else() | ||
endif() | ||
|
||
IF(BUILD_SHARED_LIBS) | ||
SET(LIBSUFFIX "") | ||
ELSE(BUILD_SHARED_LIBS) | ||
SET(LIBSUFFIX "_static") | ||
ENDIF(BUILD_SHARED_LIBS) | ||
|
||
IF(MSVC) | ||
MESSAGE(STATUS "MSVC") | ||
IF(LIB_OMC) | ||
SET(LIBINSTALLEXT "${LIB_OMC}/omsi/msvc" CACHE STRING "library directory" FORCE) | ||
ELSE(LIB_OMC) | ||
SET(LIBINSTALLEXT "omsi/msvc" CACHE STRING "library directory" FORCE) | ||
ENDIF(LIB_OMC) | ||
ELSE(MSVC) | ||
IF(LIB_OMC) | ||
SET(LIBINSTALLEXT "${LIB_OMC}/omsi" CACHE STRING "library directory" FORCE) | ||
ELSE(LIB_OMC) | ||
SET(LIBINSTALLEXT "omsi" CACHE STRING "library directory" FORCE) | ||
ENDIF(LIB_OMC) | ||
ENDIF(MSVC) | ||
message(STATUS "Libs will be installed in ${CMAKE_INSTALL_PREFIX}/${LIBINSTALLEXT}") | ||
|
||
|
||
SET(OMSICName ${LIBPREFIX}OMSIC${LIBSUFFIX}) | ||
|
||
SET(OMSI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../OMSI) | ||
|
||
include_directories ("${OMSI_SOURCE_DIR}/include") | ||
include_directories ("${OMSI_SOURCE_DIR}/include/fmi2") | ||
include_directories ("${OMSI_SOURCE_DIR}/base/include") | ||
include_directories ("${OMSI_SOURCE_DIR}/solver/include") | ||
|
||
# omsic simulation runtime | ||
ADD_SUBDIRECTORY(src/omsu) | ||
|
||
|
||
install(FILES | ||
${OMSI_SOURCE_DIR}/include/omsi.h | ||
${OMSI_SOURCE_DIR}/include/omsi_callbacks.h | ||
${OMSI_SOURCE_DIR}/include/omsi_api_functions.h | ||
DESTINATION include/omc/omsi) | ||
|
||
install(FILES | ||
${CMAKE_SOURCE_DIR}/include/omsic.h | ||
${CMAKE_SOURCE_DIR}/include/omsu/omsu_common.h | ||
${CMAKE_SOURCE_DIR}/include/omsu/omsu_helper.h | ||
${CMAKE_SOURCE_DIR}/include/omsu/omsu_initialization.h | ||
${CMAKE_SOURCE_DIR}/include/omsu/omsu_getters_and_setters.h | ||
${CMAKE_SOURCE_DIR}/include/omsu/omsu_continuous_simulation.h | ||
${CMAKE_SOURCE_DIR}/include/omsu/omsu_event_simulation.h | ||
DESTINATION include/omc/omsic) | ||
|
||
install(FILES | ||
${CMAKE_SOURCE_DIR}/include/fmi2/fmi2Functions.h | ||
${CMAKE_SOURCE_DIR}/include/fmi2/fmi2FunctionTypes.h | ||
${CMAKE_SOURCE_DIR}/include/fmi2/fmi2TypesPlatform.h | ||
DESTINATION include/omc/omsic/fmi2/) | ||
|
||
# uninstall target | ||
if(NOT TARGET uninstall) | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | ||
IMMEDIATE @ONLY) | ||
|
||
add_custom_target(uninstall | ||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) | ||
endif() |
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,19 @@ | ||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") | ||
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
|
||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) | ||
string(REGEX REPLACE "\n" ";" files "${files}") | ||
foreach(file ${files}) | ||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}") | ||
exec_program( | ||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" | ||
OUTPUT_VARIABLE rm_out | ||
RETURN_VALUE rm_retval | ||
) | ||
if(NOT "${rm_retval}" STREQUAL 0) | ||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") | ||
endif(NOT "${rm_retval}" STREQUAL 0) | ||
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
endforeach(file) |
Oops, something went wrong.