Ticket #25145: patch-src-CMakeLists.txt.diff

File patch-src-CMakeLists.txt.diff, 1.5 KB (added by kiwi.2008@…, 14 years ago)
  • src/CMakeLists.

    old new  
    1919  if (NOT Boost_THREAD_FOUND)
    2020    message(SEND_ERROR "ORO_OS_USE_BOOST_THREAD turned on, but Boost thread library is not installed or wrong version.")
    2121  endif()
    22   list(APPEND OROCOS-RTT_LIBRARIES ${Boost_THREAD_LIBRARY} )
     22
     23  # As Boost_THREAD_LIBRARY may be a list of libraries, and we can't deal
     24  # with that in pkgconfig, we take 1) the library for this build type, or
     25  # 2) the library if only one is listed, or 3) we error out.
     26  STRING(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
     27  if (DEFINED Boost_THREAD_LIBRARY_${CMAKE_BUILD_TYPE_UPPER})
     28        LIST(APPEND OROCOS-RTT_LIBRARIES ${Boost_THREAD_LIBRARY_${CMAKE_BUILD_TYPE_UPPER}})
     29  else (DEFINED Boost_THREAD_LIBRARY_${CMAKE_BUILD_TYPE_UPPER})
     30        LIST(LENGTH Boost_THREAD_LIBRARY COUNT_Boost_THREAD_LIBRARY)
     31        if (1 LESS COUNT_Boost_THREAD_LIBRARY)
     32          MESSAGE(FATAL_ERROR "Found multiple boost thread libraries, but not one specific to the current build type '${CMAKE_BUILD_TYPE_UPPER}'.")
     33        endif (1 LESS COUNT_Boost_THREAD_LIBRARY)
     34        list(APPEND OROCOS-RTT_LIBRARIES ${Boost_THREAD_LIBRARY} )
     35  endif (DEFINED Boost_THREAD_LIBRARY_${CMAKE_BUILD_TYPE_UPPER})
     36
    2337endif()
    2438
    2539SET(OS_MAX_CONC_ACCESS 8 CACHE STRING  "The maximum number of threads that will access a lock-free resource at exactly the same time. The Default (8) is very conservative. Your application may have more threads than this number.")