diff options
Diffstat (limited to 'Modules/FindOpenThreads.cmake')
-rw-r--r-- | Modules/FindOpenThreads.cmake | 76 |
1 files changed, 43 insertions, 33 deletions
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake index 6b81fbe3a..e0599604a 100644 --- a/Modules/FindOpenThreads.cmake +++ b/Modules/FindOpenThreads.cmake @@ -1,10 +1,10 @@ -# OpenThreads is a C++ based threading library. Its largest userbase +# OpenThreads is a C++ based threading library. Its largest userbase # seems to OpenSceneGraph so you might notice I accept OSGDIR as an # environment path. -# I consider this part of the Findosg* suite used to find OpenSceneGraph +# I consider this part of the Findosg* suite used to find OpenSceneGraph # components. # Each component is separate and you must opt in to each module. -# +# # Locate OpenThreads # This module defines # OPENTHREADS_LIBRARY @@ -15,10 +15,15 @@ # correspond to the ./configure --prefix=$OPENTHREADS_DIR # used in building osg. # +# [CMake 2.8.10]: +# The CMake variables OPENTHREADS_DIR or OSG_DIR can now be used as well to influence +# detection, instead of needing to specify an environment variable. +# # Created by Eric Wing. #============================================================================= # Copyright 2007-2009 Kitware, Inc. +# Copyright 2012 Philip Lowman <philip@yhbt.com> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -34,8 +39,8 @@ # #include <OpenThreads/Thread> # To make it easier for one-step automated configuration/builds, -# we leverage environmental paths. This is preferable -# to the -DVAR=value switches because it insulates the +# we leverage environmental paths. This is preferable +# to the -DVAR=value switches because it insulates the # users from changes we may make in this script. # It also offers a little more flexibility than setting # the CMAKE_*_PATH since we can target specific components. @@ -53,14 +58,15 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread HINTS - # enough environment variables? - $ENV{OPENTHREADS_INCLUDE_DIR} - $ENV{OPENTHREADS_DIR} - $ENV{OSG_INCLUDE_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OpenThreads_ROOT} - $ENV{OSG_ROOT} + ENV OPENTHREADS_INCLUDE_DIR + ENV OPENTHREADS_DIR + ENV OSG_INCLUDE_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OpenThreads_ROOT + ENV OSG_ROOT + ${OPENTHREADS_DIR} + ${OSG_DIR} PATHS /sw # Fink /opt/local # DarwinPorts @@ -71,43 +77,47 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread ) -find_library(OPENTHREADS_LIBRARY - NAMES OpenThreads OpenThreadsWin32 +find_library(OPENTHREADS_LIBRARY + NAMES OpenThreads OpenThreadsWin32 HINTS - $ENV{OPENTHREADS_LIBRARY_DIR} - $ENV{OPENTHREADS_DIR} - $ENV{OSG_LIBRARY_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OpenThreads_ROOT} - $ENV{OSG_ROOT} + ENV OPENTHREADS_LIBRARY_DIR + ENV OPENTHREADS_DIR + ENV OSG_LIBRARY_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OpenThreads_ROOT + ENV OSG_ROOT + ${OPENTHREADS_DIR} + ${OSG_DIR} PATHS /sw /opt/local /opt/csw /opt /usr/freeware - PATH_SUFFIXES lib64 lib + PATH_SUFFIXES lib ) -find_library(OPENTHREADS_LIBRARY_DEBUG +find_library(OPENTHREADS_LIBRARY_DEBUG NAMES OpenThreadsd OpenThreadsWin32d HINTS - $ENV{OPENTHREADS_DEBUG_LIBRARY_DIR} - $ENV{OPENTHREADS_LIBRARY_DIR} - $ENV{OPENTHREADS_DIR} - $ENV{OSG_LIBRARY_DIR} - $ENV{OSG_DIR} - $ENV{OSGDIR} - $ENV{OpenThreads_ROOT} - $ENV{OSG_ROOT} + ENV OPENTHREADS_DEBUG_LIBRARY_DIR + ENV OPENTHREADS_LIBRARY_DIR + ENV OPENTHREADS_DIR + ENV OSG_LIBRARY_DIR + ENV OSG_DIR + ENV OSGDIR + ENV OpenThreads_ROOT + ENV OSG_ROOT + ${OPENTHREADS_DIR} + ${OSG_DIR} PATHS /sw /opt/local /opt/csw /opt /usr/freeware - PATH_SUFFIXES lib64 lib + PATH_SUFFIXES lib ) if(OPENTHREADS_LIBRARY_DEBUG) |