Changeset f9d30283 in OpenModelica


Ignore:
Timestamp:
2023-06-22T12:59:18+02:00 (13 months ago)
Author:
Mahder Gebremedhin <mahder.geb@…>
Children:
0d3b20c5
Parents:
424efd2
git-author:
Mahder Gebremedhin <mahder.geb@…> (06/22/23 12:52:40)
git-committer:
Mahder Gebremedhin <mahder.geb@…> (06/22/23 12:59:18)
Message:

Use hdf5 for ModelicaMatIO libraries.

  • hdf5 is now a required library. We can make it optional if needed but it is something that is readily available on most systems so make it required to enforce consistency for everyone. This is of course subjective and can be changed if needed.
  • CMake 3.14 (our minimum required version now) does not provide an imported target for hdf5. So do it the manual way.
Location:
OMCompiler/SimulationRuntime/ModelicaExternalC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/SimulationRuntime/ModelicaExternalC/CMakeLists.txt

    r9e629e5 rf9d30283  
    5656
    5757## ModelicaMatIO #########################################################################
     58find_package(HDF5 REQUIRED)
     59
    5860set(libModelicaMatIO_SOURCES C-Sources/ModelicaMatIO.c C-Sources/snprintf.c)
    5961# Static version
     
    6264
    6365target_compile_definitions(ModelicaMatIO PRIVATE HAVE_ZLIB)
     66target_compile_definitions(ModelicaMatIO PRIVATE HAVE_HDF5)
     67
     68target_include_directories(ModelicaMatIO PRIVATE ${HDF5_INCLUDE_DIRS})
     69
     70target_link_libraries(ModelicaMatIO PUBLIC ${HDF5_LIBRARIES})
    6471target_link_libraries(ModelicaMatIO PUBLIC omc::3rd::zlib)
    6572target_link_libraries(ModelicaMatIO PUBLIC omc::simrt::runtime)
     
    7178                      PROPERTIES OUTPUT_NAME ModelicaMatIO CLEAN_DIRECT_OUTPUT 1)
    7279
    73 target_compile_definitions(ModelicaMatIO_shared PUBLIC HAVE_ZLIB)
     80target_compile_definitions(ModelicaMatIO_shared PRIVATE HAVE_ZLIB)
     81target_compile_definitions(ModelicaMatIO_shared PRIVATE HAVE_HDF5)
     82
     83target_include_directories(ModelicaMatIO_shared PRIVATE ${HDF5_INCLUDE_DIRS})
     84
     85target_link_libraries(ModelicaMatIO_shared PUBLIC ${HDF5_LIBRARIES})
    7486target_link_libraries(ModelicaMatIO_shared PUBLIC omc::3rd::zlib)
    7587target_link_libraries(ModelicaMatIO_shared PUBLIC omc::simrt::runtime)
  • OMCompiler/SimulationRuntime/ModelicaExternalC/MEC_standalone_2.8.cmake

    r160a2896 rf9d30283  
    6363
    6464## ModelicaMatIO #########################################################################
     65find_package(HDF5 REQUIRED)
     66
    6567set(libModelicaMatIO_SOURCES C-Sources/ModelicaMatIO.c C-Sources/snprintf.c)
    6668# Static version
     
    6971
    7072target_compile_definitions(ModelicaMatIO PRIVATE HAVE_ZLIB)
     73target_compile_definitions(ModelicaMatIO PRIVATE HAVE_HDF5)
     74
     75target_include_directories(ModelicaMatIO PRIVATE ${HDF5_INCLUDE_DIRS})
     76
     77target_link_libraries(ModelicaMatIO PUBLIC ${HDF5_LIBRARIES})
    7178target_link_libraries(ModelicaMatIO PUBLIC zlib)
    7279target_link_libraries(ModelicaMatIO PUBLIC OpenModelicaRuntimeC)
     
    8087
    8188target_compile_definitions(ModelicaMatIO_shared PUBLIC HAVE_ZLIB)
     89target_compile_definitions(ModelicaMatIO_shared PUBLIC HAVE_HDF5)
     90
     91target_include_directories(ModelicaMatIO_shared PRIVATE ${HDF5_INCLUDE_DIRS})
     92
     93target_link_libraries(ModelicaMatIO_shared PUBLIC ${HDF5_LIBRARIES})
    8294target_link_libraries(ModelicaMatIO_shared PUBLIC zlib)
    8395target_link_libraries(ModelicaMatIO_shared PUBLIC OpenModelicaRuntimeC)
Note: See TracChangeset for help on using the changeset viewer.