summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenThreads.cmake
diff options
context:
space:
mode:
authorPhilip Lowman <philip@yhbt.com>2009-01-19 18:33:36 (GMT)
committerPhilip Lowman <philip@yhbt.com>2009-01-19 18:33:36 (GMT)
commitd1640b11def5076223a87680adb6341b1dbd2c10 (patch)
tree558e9c82969d7aa589bd0cebbf2e11a45aa25358 /Modules/FindOpenThreads.cmake
parentd69e68609c29c14b3a88e2539d12940c04afb32b (diff)
downloadCMake-d1640b11def5076223a87680adb6341b1dbd2c10.zip
CMake-d1640b11def5076223a87680adb6341b1dbd2c10.tar.gz
CMake-d1640b11def5076223a87680adb6341b1dbd2c10.tar.bz2
BUG: Fixed Issue #7331 Bugs in Findosg*.cmake. Also added OPENTHREADS_LIBRARIES.
Diffstat (limited to 'Modules/FindOpenThreads.cmake')
-rw-r--r--Modules/FindOpenThreads.cmake32
1 files changed, 14 insertions, 18 deletions
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index 75fdbdd..13d101c 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -38,7 +38,7 @@
# standard install paths.
# Explicit -DVAR=value arguments should still be able to override everything.
-FIND_PATH(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
+find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS
$ENV{OPENTHREADS_INCLUDE_DIR}
$ENV{OPENTHREADS_DIR}/include
@@ -62,7 +62,7 @@ FIND_PATH(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
)
-FIND_LIBRARY(OPENTHREADS_LIBRARY
+find_library(OPENTHREADS_LIBRARY
NAMES OpenThreads OpenThreadsWin32
HINTS
$ENV{OPENTHREADS_LIBRARY_DIR}
@@ -95,8 +95,7 @@ FIND_LIBRARY(OPENTHREADS_LIBRARY
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
)
-
-FIND_LIBRARY(OPENTHREADS_LIBRARY_DEBUG
+find_library(OPENTHREADS_LIBRARY_DEBUG
NAMES OpenThreadsd OpenThreadsWin32d
HINTS
$ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
@@ -128,18 +127,15 @@ FIND_LIBRARY(OPENTHREADS_LIBRARY_DEBUG
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
)
+if(OPENTHREADS_LIBRARY_DEBUG)
+ set(OPENTHREADS_LIBRARIES
+ optimized ${OPENTHREADS_LIBRARY}
+ debug ${OPENTHREADS_LIBRARY_DEBUG})
+else()
+ set(OPENTHREADS_LIBRARY_DEBUG ${OPENTHREADS_LIBRARY})
+ set(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY})
+endif()
-IF(OPENTHREADS_LIBRARY)
- IF(NOT OPENTHREADS_LIBRARY_DEBUG)
- #MESSAGE("-- Warning Debug OpenThreads not found, using: ${OPENTHREADS_LIBRARY}")
- #SET(OPENTHREADS_LIBRARY_DEBUG "${OPENTHREADS_LIBRARY}")
- SET(OPENTHREADS_LIBRARY_DEBUG "${OPENTHREADS_LIBRARY}" CACHE FILEPATH "Debug version of OpenThreads Library (use regular version if not available)" FORCE)
- ENDIF(NOT OPENTHREADS_LIBRARY_DEBUG)
-ENDIF(OPENTHREADS_LIBRARY)
-
-SET(OPENTHREADS_FOUND "NO")
-IF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)
- SET(OPENTHREADS_FOUND "YES")
- # MESSAGE("-- Found OpenThreads: "${OPENTHREADS_LIBRARY})
-ENDIF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)
-
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENTHREADS DEFAULT_MSG
+ OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR)