146 | | find_package(Boost 1.33 COMPONENTS thread REQUIRED) |
147 | | list(APPEND OROCOS-RTT_INCLUDE_DIRS ${Boost_thread_INCLUDE_DIRS} ) |
| 146 | if (NOT Boost_THREAD_FOUND) |
| 147 | find_package(Boost 1.33 COMPONENTS thread REQUIRED) |
| 148 | endif () |
| 149 | list(APPEND OROCOS-RTT_INCLUDE_DIRS ${Boost_THREAD_INCLUDE_DIRS} ) |
| 150 | |
| 151 | # add to list of libraries in pkgconfig file |
| 152 | # As Boost_THREAD_LIBRARY may be a list of libraries, and we can't deal |
| 153 | # with that in pkgconfig, we take 1) the library for this build type, or |
| 154 | # 2) the library if only one is listed, or 3) we error out. |
| 155 | STRING(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER) |
| 156 | if (DEFINED Boost_THREAD_LIBRARY_${CMAKE_BUILD_TYPE_UPPER}) |
| 157 | LIST(APPEND OROCOS-RTT_USER_LINK_LIBS ${Boost_THREAD_LIBRARY_${CMAKE_BUILD_TYPE_UPPER}}) |
| 158 | else (DEFINED Boost_THREAD_LIBRARY_${CMAKE_BUILD_TYPE_UPPER}) |
| 159 | LIST(LENGTH Boost_THREAD_LIBRARY COUNT_Boost_THREAD_LIBRARY) |
| 160 | if (1 LESS COUNT_Boost_THREAD_LIBRARY) |
| 161 | MESSAGE(FATAL_ERROR "Found multiple boost thread libraries, but not one specific to the current build type '${CMAKE_BUILD_TYPE_UPPER}'.") |
| 162 | endif (1 LESS COUNT_Boost_THREAD_LIBRARY) |
| 163 | LIST(APPEND OROCOS-RTT_USER_LINK_LIBS ${Boost_THREAD_LIBRARY}}) |
| 164 | endif (DEFINED Boost_THREAD_LIBRARY_${CMAKE_BUILD_TYPE_UPPER}) |