summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenThreads.cmake
diff options
context:
space:
mode:
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)