Changeset 6588

Show
Ignore:
Timestamp:
05/02/07 20:07:41
Author:
robert
Message:

Added CMake support for local OpenThreads? build

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/CMakeLists.txt

    r6569 r6588  
    3333ENDIF(USING_OSG_OP_OT_TRIPLE_SET) 
    3434 
    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) 
    6635 
    6736# Okay, here's the problem: On some platforms, linking against OpenThreads 
     
    10271INCLUDE_DIRECTORIES( 
    10372    ${OpenSceneGraph_SOURCE_DIR}/include 
    104     ${OPENTHREADS_INCLUDE_DIR} 
    10573    ${OPENGL_INCLUDE_DIR} 
    10674) 
  • OpenSceneGraph/trunk/src/CMakeLists.txt

    r6343 r6588  
    11 
    22SUBDIRS( 
     3        OpenThreads 
    34        osg 
    45        osgDB  
  • OpenSceneGraph/trunk/src/osg/CMakeLists.txt

    r6430 r6588  
    292292) 
    293293 
     294LINK_INTERNAL(${LIB_NAME}        
     295        OpenThreads 
     296) 
    294297LINK_EXTERNAL(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT}     ${MATH_LIBRARY} ) 
    295298LINK_CORELIB_DEFAULT(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} )