Skip to content

Commit

Permalink
Fix ModelicaLibraryConfig_gcc.inc for newer CMake
Browse files Browse the repository at this point in the history
  - Fix for CMake for C++ runtime on Ubuntu Focal fossa
  - Generate "-lboost_someCrazyStuff" from "Boost::SomeCrazyStuff"
  - Fix warning due to different text in if branches
  • Loading branch information
AnHeuermann authored and adrpo committed May 19, 2020
1 parent dffda8e commit c888c30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions OMCompiler/SimulationRuntime/OMSICpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -925,9 +925,9 @@ IF(ZeroMQ_FOUND AND cppzmq_FOUND)
message(STATUS "cppzmq version ${cppzmq_VERSION}")
message (STATUS "Using ZMQ Header ${ZeroMQ_INCLUDE_DIR}" )
message (STATUS "Using CPPZMQ Header ${cppzmq_INCLUDE_DIR}" )
ELSE(ZeroMQ_found AND cppzmq_found)
ELSE(ZeroMQ_FOUND AND cppzmq_FOUND)
SET(USE_ZEROMQ OFF)
ENDIF(ZeroMQ_found AND cppzmq_found)
ENDIF(ZeroMQ_FOUND AND cppzmq_FOUND)

#Write the defines into the ADDITIONAL_DEFINES variable
# GET_DIRECTORY_PROPERTY(ADDITIONAL_DEFINES DEFINITIONS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ ENDIF()

SET(Boost_LIBRARIES_NEW)
FOREACH(lib ${Boost_LIBRARIES_})
GET_FILENAME_COMPONENT(libNew "${lib}" NAME_WE)
# Convert "Boost:SomeCrazyLib" to "-lboost_SomeCrazyLib" for ModelicaConfig_gcc.inc
IF (${CMAKE_VERSION} VERSION_GREATER "3.16.0") # support newer cmake >= 3.16
GET_TARGET_PROPERTY(libNew "${lib}" LOCATION)
GET_FILENAME_COMPONENT(libNew "${libNew}" NAME_WE)
ELSE(${CMAKE_VERSION} VERSION_GREATER "3.16.0") # support older cmake <= 3.16
GET_FILENAME_COMPONENT(libNew "${lib}" NAME_WE)
ENDIF(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
STRING(REGEX REPLACE "^lib" "" libNew ${libNew})
SET(Boost_LIBRARIES_NEW "${Boost_LIBRARIES_NEW} ${LINKER_LIB_PREFIX}${libNew}")
ENDFOREACH()
Expand Down

0 comments on commit c888c30

Please sign in to comment.