Changeset 87d58d47 in OpenModelica


Ignore:
Timestamp:
2022-01-21T23:38:21+01:00 (2 years ago)
Author:
GitHub <noreply@…>
Branches:
maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
5c10d4c, a91df6e
Parents:
5cb0f20
git-author:
Mahder Gebremedhin <mahge@…> (01/21/22 23:38:21)
git-committer:
GitHub <noreply@…> (01/21/22 23:38:21)
Message:

Fixes for FMU generation on Windows with CMake built omc (#8451)

  • [cmake] Define CMINPACK_NO_DLL to libSimulationRuntimeFMI.
  • It is a static library.
  • Install fmi/export/buildproject/configure.ac on Win
  • This is just following what the Makefiles do. I am not 100% sure why it is needed and how it is used.

If it is not installed on Windows, the FMU creation complains about
missing file and terminates.

Location:
OMCompiler/SimulationRuntime
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/SimulationRuntime/c/cmake/source_code_fmu_config.cmake

    rb1113d93 r87d58d47  
    134134                                            ${3RD_CMINPACK_FMU_FILES})
    135135
    136 target_compile_definitions(SimulationRuntimeFMI PRIVATE "-DOMC_MINIMAL_RUNTIME=1 -DOMC_FMI_RUNTIME=1")
     136target_compile_definitions(SimulationRuntimeFMI PRIVATE -DOMC_MINIMAL_RUNTIME=1 -DOMC_FMI_RUNTIME=1 -DCMINPACK_NO_DLL)
    137137
    138138install(TARGETS SimulationRuntimeFMI)
     
    140140
    141141# ######################################################################################################################
    142 # Library: SimulationRuntimeFMI
     142# Library: OpenModelicaFMIRuntimeC
     143
     144file(GLOB OMC_SIMRT_FMI_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fmi/*.c)
     145file(GLOB OMC_SIMRT_FMI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/fmi/*.h)
     146
    143147add_library(OpenModelicaFMIRuntimeC STATIC)
    144148add_library(omc::simrt::fmiruntime ALIAS OpenModelicaFMIRuntimeC)
  • OMCompiler/SimulationRuntime/c/cmake_3.14.cmake

    r2e9ac992 r87d58d47  
    2626file(GLOB_RECURSE OMC_SIMRT_OPTIMIZATION_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/optimization/*.c)
    2727file(GLOB_RECURSE OMC_SIMRT_OPTIMIZATION_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/optimization/*.h)
    28 
    29 file(GLOB OMC_SIMRT_FMI_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fmi/*.c)
    30 file(GLOB OMC_SIMRT_FMI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/fmi/*.h)
    3128
    3229
  • OMCompiler/SimulationRuntime/fmi/export/buildproject/CMakeLists.txt

    r2e9ac992 r87d58d47  
    33## This is not tested very well. Will be updated as we go.
    44
    5 if(NOT WIN32)
    6 execute_process(COMMAND autoconf
    7   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    8   RESULT_VARIABLE AUTOCONF_FOR_FMU_EXIT_STATUS
    9   OUTPUT_VARIABLE AUTOCONF_FOR_FMU_OUTPUT
    10   ERROR_VARIABLE AUTOCONF_FOR_FMU_ERROR
    11   #   OUTPUT_QUIET
    12 )
    13 
    14 if(AUTOCONF_FOR_FMU_EXIT_STATUS AND NOT AUTOCONF_FOR_FMU_EXIT_STATUS EQUAL 0)
    15     message(STATUS ${AUTOCONF_FOR_FMU_EXIT_STATUS})
    16     message(STATUS ${AUTOCONF_FOR_FMU_OUTPUT})
    17     message(STATUS ${AUTOCONF_FOR_FMU_ERROR})
    18     message(FATAL_ERROR "autoconf failed configuring for FMUS.")
    19 endif()
    20 
    21 install(FILES configure
     5if(WIN32)
     6  install(FILES configure.ac
    227        DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/omc/runtime/c/fmi/buildproject ## This should not be omc/runtime/c/fmi but rather omc/fmi. It is inconsistent
    238)
     9else()
     10  execute_process(COMMAND autoconf
     11    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
     12    RESULT_VARIABLE AUTOCONF_FOR_FMU_EXIT_STATUS
     13    OUTPUT_VARIABLE AUTOCONF_FOR_FMU_OUTPUT
     14    ERROR_VARIABLE AUTOCONF_FOR_FMU_ERROR
     15    #   OUTPUT_QUIET
     16  )
    2417
     18  if(AUTOCONF_FOR_FMU_EXIT_STATUS AND NOT AUTOCONF_FOR_FMU_EXIT_STATUS EQUAL 0)
     19      message(STATUS ${AUTOCONF_FOR_FMU_EXIT_STATUS})
     20      message(STATUS ${AUTOCONF_FOR_FMU_OUTPUT})
     21      message(STATUS ${AUTOCONF_FOR_FMU_ERROR})
     22      message(FATAL_ERROR "autoconf failed configuring for FMUS.")
     23  endif()
     24
     25  install(FILES configure
     26          DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/omc/runtime/c/fmi/buildproject ## This should not be omc/runtime/c/fmi but rather omc/fmi. It is inconsistent
     27  )
    2528endif()
Note: See TracChangeset for help on using the changeset viewer.