Skip to content

Commit

Permalink
Remove spurious files from FMU packages.
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Rule (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Dec 19, 2024
1 parent 6f916e4 commit cfbd900
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 42 deletions.
53 changes: 32 additions & 21 deletions dse/examples/fmu/counter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ set(FMI_3_COMMON_FILES
${FMU_SOURCE_DIR}/fmi3fmu.c
${FMU_SOURCE_DIR}/signal.c
)
file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.keepme
CONTENT "keepme"
)


# Targets
Expand Down Expand Up @@ -112,6 +116,12 @@ install(
DESTINATION
${FMU_FMI2_PATH}
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/.keepme
DESTINATION
${FMU_FMI2_PATH}/resources
)


# FMI3 FMU
Expand Down Expand Up @@ -145,58 +155,59 @@ install(
LIBRARY DESTINATION
${FMU_FMI3_PATH}/binaries/x86_64-linux
)
install(
FILES
fmi3/modelDescription.xml
DESTINATION
${FMU_FMI3_PATH}
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/.keepme
DESTINATION
${FMU_FMI3_PATH}/resources
)


# Package FMU
# -----------
install(CODE "
execute_process(
COMMAND sh -c \"
mkdir -p resources
touch resources/.keepme
zip -r ${MODULE_LC}.zip ./
FILE=${CMAKE_CURRENT_BINARY_DIR}/fmu2${MODULE_LC}.zip
if [ ! -f $FILE ]; then
zip -r $FILE ./
fi
exit 0
\"
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${FMU_FMI2_PATH}
)"
)
install(
FILES
${CMAKE_INSTALL_PREFIX}/${FMU_FMI2_PATH}/${MODULE_LC}.zip
${CMAKE_CURRENT_BINARY_DIR}/fmu2${MODULE_LC}.zip
DESTINATION
${FMU_FMI2_PATH}
RENAME
${MODULE_LC}.fmu
)
install(
FILES
${CMAKE_INSTALL_PREFIX}/${FMU_FMI2_PATH}/resources/.keepme
DESTINATION
${FMU_FMI2_PATH}
)

install(CODE "
execute_process(
COMMAND sh -c \"
mkdir -p resources
touch resources/.keepme
zip -r ${MODULE_LC}.zip ./
exit 0
FILE=${CMAKE_CURRENT_BINARY_DIR}/fmu3${MODULE_LC}.zip
if [ ! -f $FILE ]; then
zip -r $FILE ./
fi
\"
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${FMU_FMI3_PATH}
)"
)
install(
FILES
${CMAKE_INSTALL_PREFIX}/${FMU_FMI3_PATH}/${MODULE_LC}.zip
${CMAKE_CURRENT_BINARY_DIR}/fmu3${MODULE_LC}.zip
DESTINATION
${FMU_FMI3_PATH}
RENAME
${MODULE_LC}.fmu
)
install(
FILES
${CMAKE_INSTALL_PREFIX}/${FMU_FMI3_PATH}/resources/.keepme
DESTINATION
${FMU_FMI3_PATH}
)
47 changes: 26 additions & 21 deletions dse/examples/fmu/linear/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ set(FMI_3_COMMON_FILES
${FMU_SOURCE_DIR}/fmi3fmu.c
${FMU_SOURCE_DIR}/signal.c
)
file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.keepme
CONTENT "keepme"
)


# Targets
Expand Down Expand Up @@ -112,6 +116,12 @@ install(
DESTINATION
${FMU_FMI2_PATH}
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/.keepme
DESTINATION
${FMU_FMI2_PATH}/resources
)


# FMI3 FMU
Expand Down Expand Up @@ -151,58 +161,53 @@ install(
DESTINATION
${FMU_FMI3_PATH}
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/.keepme
DESTINATION
${FMU_FMI3_PATH}/resources
)


# Package FMU
# -----------
install(CODE "
execute_process(
COMMAND sh -c \"
mkdir -p resources
touch resources/.keepme
zip -r ${MODULE_LC}.zip ./
FILE=${CMAKE_CURRENT_BINARY_DIR}/fmu2${MODULE_LC}.zip
if [ ! -f $FILE ]; then
zip -r $FILE ./
fi
exit 0
\"
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${FMU_FMI2_PATH}
)"
)
install(
FILES
${CMAKE_INSTALL_PREFIX}/${FMU_FMI2_PATH}/${MODULE_LC}.zip
${CMAKE_CURRENT_BINARY_DIR}/fmu2${MODULE_LC}.zip
DESTINATION
${FMU_FMI2_PATH}
RENAME
${MODULE_LC}.fmu
)
install(
FILES
${CMAKE_INSTALL_PREFIX}/${FMU_FMI2_PATH}/resources/.keepme
DESTINATION
${FMU_FMI2_PATH}
)

install(CODE "
execute_process(
COMMAND sh -c \"
mkdir -p resources
touch resources/.keepme
zip -r ${MODULE_LC}.zip ./
exit 0
FILE=${CMAKE_CURRENT_BINARY_DIR}/fmu3${MODULE_LC}.zip
if [ ! -f $FILE ]; then
zip -r $FILE ./
fi
\"
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${FMU_FMI3_PATH}
)"
)
install(
FILES
${CMAKE_INSTALL_PREFIX}/${FMU_FMI3_PATH}/${MODULE_LC}.zip
${CMAKE_CURRENT_BINARY_DIR}/fmu3${MODULE_LC}.zip
DESTINATION
${FMU_FMI3_PATH}
RENAME
${MODULE_LC}.fmu
)
install(
FILES
${CMAKE_INSTALL_PREFIX}/${FMU_FMI3_PATH}/resources/.keepme
DESTINATION
${FMU_FMI3_PATH}
)

0 comments on commit cfbd900

Please sign in to comment.