| 35 | | |
|---|
| 36 | | # FIXME: The FindOpenThreads stuff below is not quite correct. |
|---|
| 37 | | # The problem is that if we are building OpenSceneGraph by itself |
|---|
| 38 | | # (not part of the triple-set OT/OP/OSG source), then we need to hunt |
|---|
| 39 | | # down the OpenThreads library on the system. |
|---|
| 40 | | # But if we are building as part of the triple-set, then we want to |
|---|
| 41 | | # refer to the version in the triple set. But this gets harder because |
|---|
| 42 | | # FIND_LIBRARY will fail to pick the triple set version in this case |
|---|
| 43 | | # because the library is not yet built when running this CMake script. |
|---|
| 44 | | # |
|---|
| 45 | | # Maybe we need a global flag (set in the root CMakeLists.txt) |
|---|
| 46 | | # that tells us which scenario we are doing. |
|---|
| 47 | | # And in the triple set case, we skip this check. |
|---|
| 48 | | |
|---|
| 49 | | IF(USING_OSG_OP_OT_TRIPLE_SET) |
|---|
| 50 | | # MESSAGE("OSG: Using TripleSet, ${OpenThreads_SOURCE_DIR}.") |
|---|
| 51 | | # So I think the fall-out is that all the OpenThreads variables |
|---|
| 52 | | # that have been set are still in play. So the include paths are still |
|---|
| 53 | | # visible, and the library is still set. |
|---|
| 54 | | # To keep the same code paths |
|---|
| 55 | | SET(OPENTHREADS_LIBRARY OpenThreads) |
|---|
| 56 | | SET(OPENTHREADS_INCLUDE_DIR ${OpenThreads_SOURCE_DIR}/include) |
|---|
| 57 | | |
|---|
| 58 | | # MESSAGE("Lib: ${OPENTHREADS_LIBRARY}") |
|---|
| 59 | | |
|---|
| 60 | | |
|---|
| 61 | | ELSE(USING_OSG_OP_OT_TRIPLE_SET) |
|---|
| 62 | | # MESSAGE("OSG: Not using Triple Set") |
|---|
| 63 | | FIND_PACKAGE(OpenThreads REQUIRED) |
|---|
| 64 | | |
|---|
| 65 | | ENDIF(USING_OSG_OP_OT_TRIPLE_SET) |
|---|