Skip to content

Commit

Permalink
Fix FMU name (#10)
Browse files Browse the repository at this point in the history
Signed-off-by: ClemensLinnhoff <clemens.linnhoff@persival.de>
  • Loading branch information
ClemensLinnhoff authored Aug 12, 2024
1 parent e4fb777 commit 020001f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(OSMPTraceFilePlayer)
project(sl-5-5-osi-trace-file-player)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -11,9 +11,9 @@ set(DEBUG_BREAKS_TRACE_FILE_PLAYER OFF CACHE BOOL "Enable debugger traps for deb

if(PRIVATE_LOGGING_TRACE_FILE_PLAYER)
if(WIN32)
set(PRIVATE_LOG_PATH_TRACE_FILE_PLAYER "C:/TEMP/OSMPTraceFilePlayerLog.log" CACHE FILEPATH "Path to write private log file to")
set(PRIVATE_LOG_PATH_TRACE_FILE_PLAYER "C:/TEMP/sl-5-5-osi-trace-file-player.log" CACHE FILEPATH "Path to write private log file to")
else()
set(PRIVATE_LOG_PATH_TRACE_FILE_PLAYER "/tmp/OSMPTraceFilePlayerLog.log" CACHE FILEPATH "Path to write private log file to")
set(PRIVATE_LOG_PATH_TRACE_FILE_PLAYER "/tmp/sl-5-5-osi-trace-file-player.log" CACHE FILEPATH "Path to write private log file to")
endif()
file(TO_NATIVE_PATH ${PRIVATE_LOG_PATH_TRACE_FILE_PLAYER} PRIVATE_LOG_PATH_TRACE_FILE_PLAYER_NATIVE)
string(REPLACE "\\" "\\\\" PRIVATE_LOG_PATH_TRACE_FILE_PLAYER ${PRIVATE_LOG_PATH_TRACE_FILE_PLAYER_NATIVE})
Expand Down
16 changes: 8 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ configure_file(modelDescription.in.xml modelDescription.xml @ONLY)
configure_file(OSMPTraceFilePlayerConfig.in.h OSMPTraceFilePlayerConfig.h)

find_package(Protobuf 2.6.1 REQUIRED)
add_library(OSMPTraceFilePlayer SHARED OSMPTraceFilePlayer.cpp)
set_target_properties(OSMPTraceFilePlayer PROPERTIES PREFIX "")
target_compile_definitions(OSMPTraceFilePlayer PRIVATE "FMU_SHARED_OBJECT")
add_library(sl-5-5-osi-trace-file-player SHARED OSMPTraceFilePlayer.cpp)
set_target_properties(sl-5-5-osi-trace-file-player PROPERTIES PREFIX "")
target_compile_definitions(sl-5-5-osi-trace-file-player PRIVATE "FMU_SHARED_OBJECT")
if(LINK_WITH_SHARED_OSI)
target_link_libraries(OSMPTraceFilePlayer open_simulation_interface stdc++fs)
target_link_libraries(sl-5-5-osi-trace-file-player open_simulation_interface stdc++fs)
else()
target_link_libraries(OSMPTraceFilePlayer open_simulation_interface_pic stdc++fs)
target_link_libraries(sl-5-5-osi-trace-file-player open_simulation_interface_pic stdc++fs)
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})

Expand All @@ -34,7 +34,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
endif()

add_custom_command(TARGET OSMPTraceFilePlayer
add_custom_command(TARGET sl-5-5-osi-trace-file-player
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/buildfmu"
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources"
Expand All @@ -43,5 +43,5 @@ add_custom_command(TARGET OSMPTraceFilePlayer
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/OSMPTraceFilePlayer.cpp" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources/"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/OSMPTraceFilePlayer.h" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources/"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/OSMPTraceFilePlayerConfig.h" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources/OSMPTraceFilePlayerConfig.h"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:OSMPTraceFilePlayer> $<$<PLATFORM_ID:Windows>:$<$<CONFIG:Debug>:$<TARGET_PDB_FILE:OSMPTraceFilePlayer>>> "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}"
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/buildfmu" ${CMAKE_COMMAND} -E tar "cfv" "${FMU_INSTALL_DIR}/OSMPTraceFilePlayer.fmu" --format=zip "modelDescription.xml" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}")
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:sl-5-5-osi-trace-file-player> $<$<PLATFORM_ID:Windows>:$<$<CONFIG:Debug>:$<TARGET_PDB_FILE:sl-5-5-osi-trace-file-player>>> "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}"
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/buildfmu" ${CMAKE_COMMAND} -E tar "cfv" "${FMU_INSTALL_DIR}/sl-5-5-osi-trace-file-player.fmu" --format=zip "modelDescription.xml" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/sources" "${CMAKE_CURRENT_BINARY_DIR}/buildfmu/binaries/${FMI_BINARIES_PLATFORM}")
4 changes: 2 additions & 2 deletions src/modelDescription.in.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<fmiModelDescription
fmiVersion="2.0"
modelName="OSMPTraceFilePlayer"
modelName="sl-5-5-osi-trace-file-player"
guid="@FMUGUID@"
description="FMU that reads a binary OSI trace file and outputs the content step by step"
author="Persival"
Expand All @@ -10,7 +10,7 @@
generationDateAndTime="@FMUTIMESTAMP@"
variableNamingConvention="structured">
<CoSimulation
modelIdentifier="OSMPTraceFilePlayer"
modelIdentifier="sl-5-5-osi-trace-file-player"
canHandleVariableCommunicationStepSize="true"
canNotUseMemoryManagementFunctions="true">
<SourceFiles>
Expand Down

0 comments on commit 020001f

Please sign in to comment.