Changeset 6429

Show
Ignore:
Timestamp:
03/29/07 12:46:39
Author:
robert
Message:

From Eric Wing, added local FindThreads?.cmake to enable inclusion of platform specific pthread paths

Files:

Legend:

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

    r6394 r6429  
    22 
    33PROJECT(OpenThreads) 
     4 
     5# We have some custom .cmake scripts not in the official distribution. 
     6# Maybe this can be used override existing behavior if needed? 
     7SET(CMAKE_MODULE_PATH "${OpenThreads_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}") 
    48 
    59################################################################################ 
     
    1620 
    1721SET(LIB_POSTFIX "") 
    18 if (UNIX AND NOT WIN32
    19   if (CMAKE_SIZEOF_VOID_P MATCHES "8") 
     22IF(UNIX AND NOT WIN32 AND NOT APPLE
     23  IF(CMAKE_SIZEOF_VOID_P MATCHES "8") 
    2024        SET(LIB_POSTFIX "64") 
    21   endif (CMAKE_SIZEOF_VOID_P MATCHES "8") 
    22 endif (UNIX AND NOT WIN32
     25  ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8") 
     26ENDIF(UNIX AND NOT WIN32 AND NOT APPLE
    2327 
    2428################################################################################ 
     
    6266ENDIF(DYNAMIC_OPENTHREADS) 
    6367 
     68# Use our modified version of FindThreads.cmake which has Sproc hacks. 
     69FIND_PACKAGE(Threads) 
     70 
    6471# Do we have sproc? 
    6572IF(CMAKE_SYSTEM MATCHES IRIX) 
    66         INCLUDE(CheckIncludeFiles) 
    67         CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h"  CMAKE_HAVE_SPROC_H) 
    68         IF(CMAKE_HAVE_SPROC_H) 
    69                 OPTION(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS "Set to ON to build OpenThreads against sproc instead of pthreads" OFF) 
    70         ENDIF(CMAKE_HAVE_SPROC_H) 
     73        IF(CMAKE_USE_SPROC_INIT) 
     74                # In this case, only Sproc exists, so no option. 
     75                SET(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS 1) 
     76        ELSE(CMAKE_USE_SPROC_INIT) 
     77                IF(CMAKE_HAVE_SPROC_H) 
     78                        OPTION(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS "Set to ON to build OpenThreads against sproc instead of pthreads" OFF) 
     79                ENDIF(CMAKE_HAVE_SPROC_H) 
     80        ENDIF(CMAKE_USE_SPROC_INIT) 
    7181ENDIF(CMAKE_SYSTEM MATCHES IRIX) 
    7282 
  • OpenThreads/trunk/pthread_src/CMakeLists.txt

    r6353 r6429  
    1818 
    1919TARGET_LINK_LIBRARIES(${LIB_NAME} 
    20         pthread 
     20        ${CMAKE_THREAD_LIBS_INIT} 
    2121) 
    2222