Files
libwiiuse/FindWinHID.cmake
Ryan Pavlik dd2c7e902a Squashed 'cmake/' changes from b0d0a58..cac13f1
cac13f1 Add CMakePackageConfigHelpers as a backported module from 2.8.10
44e17a5 Update help
92f9405 Add FindDirectShow from VRPN
a93bf46 Update FindVRPN
edf459d clean up some modules
0bf8b53 Update documentation/help
900ae37 Improvements to findcppdom
bcdd5ed Adrienne timecode generator finder
fc14864 IDLJ finder/script
5fa91d4 Finder for windows/platform SDK
835a160 Add module to find perl modules: pass them as components
7dc76c3 cleanup
38e2a0d Create a doc_open target to open html docs
e8de008 Improved directx finding
787900c Conditionally use libuuid for VPR22
1c73e35 Add a helper error message to findcppcheck.
9e8b357 Generate, rather than enumerate, juggler lib names.
d42ae48 Add another compiler flag for warnings.
911f522 Just a little cleanup.
a466ea5 Update help
30af184 Add two new scripts written for VR Juggler
09ccc48 Update VR Juggler finders for 3.0.1
f9a5b86 VR JuggLua is no longer unreleased research software - ditch the scary warning.
1adb75e Update GetGitRevisionDescription to handle new submodules a little better.
187b7b2 Add new FindViewPoint
d1ec683 Enhance FindOpenHaptics to handle 3.1
de68fc0 Restore some tabs that went missing
feb11f6 Improve GHOST finder.
b922e06 Update help
7ff9c53 Run cmake-bulk-decrufter.
0873f79 Merge branch 'jscasallas/master'
e2ec7cd Add helpful comment about use as submodule
2a42dc5 Simplify FindQVRPN.
8ddcb84 Windows compatibility for the pull request just merged
4fcc618 Merge pull request #6 from phire/cmake-modules
fa1ef4c Add additional versions of cppdom and gmtl.
7db0714 Regenerate help
39c0f2f Add find directinput
d2e2a74 Update copyright year
5c05172 Update module help
5b62638 Rename to UseMarkdown and add rename feature
f92055a Add markdown scripts (finding and targets)
00cefbe GetGitRevisionDescription: Search parent dirs for .git/
0fb259a New module: FindQVRPN.cmake
9616f6e Find jccl and vrjuggler plugins, and split between debug and release
4856978 Set WIIUSE_RUNTIME_LIBRARY in Wiiuse even not on Windows
d94b209 make FindWinHID work on MinGW.
4c110cb Fix copy-pasteo in findcppunit
8be460a fix doc typo
6a78da3 Handle other compilers better by using compiler ID
a90f87b Use compiler behavior, not identity, to decide what warning flags to use
f03d7a8 Properly check the various arguments to cppcheck rather than assume based on a few tests.
d3ffd8a get git revision more robustly
1fb0e41 update ghost fake stl to simplify header
6fbe007 No more checking the stdc++ version for openhaptics
db11bb9 make sure we actually link against HDU/HLU nested targets!
a6580e9 remove unused variables in test file
f4a26c5 update copyright
16a6266 fix dcubed nested target
ca5cd7a mark luac item as advanced
f131cbe actually use the jttk root dir specified
501dbb2 improve dcubed include dirs
ae8764f improve splitting osg plugins into debug and release

git-subtree-dir: cmake
git-subtree-split: cac13f1c3225555cec9ae06a1ba47baa8c90442a
2012-12-12 11:27:56 -06:00

160 lines
3.7 KiB
CMake

# - try to find Windows HID support, part of the WDK/DDK
#
# Cache Variables: (probably not for direct use in your scripts)
# WINHID_INCLUDE_DIR
# WINHID_CRT_INCLUDE_DIR
# WINHID_LIBRARY
#
# Non-cache variables you might use in your CMakeLists.txt:
# WINHID_FOUND
# WINHID_INCLUDE_DIRS
# WINHID_LIBRARIES
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
# PrefixListGlob
# CleanDirectoryList
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(NOT WIN32)
find_package_handle_standard_args(WinHID
"Skipping search for Windows HID on non-Windows platform"
WIN32)
return()
endif()
if(MSVC)
if( (NOT WINHID_ROOT_DIR) AND (NOT ENV{DDKROOT} STREQUAL "") )
set(WINHID_ROOT_DIR "$ENV{DDKROOT}")
endif()
endif()
set(WINHID_ROOT_DIR
"${WINHID_ROOT_DIR}"
CACHE
PATH
"Directory to search")
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(_arch amd64)
else()
set(_arch i386)
endif()
if(MSVC)
include(PrefixListGlob)
include(CleanDirectoryList)
prefix_list_glob(_prefixed
"*/"
"$ENV{SYSTEMDRIVE}/WinDDK/"
"c:/WinDDK/")
clean_directory_list(_prefixed)
find_library(WINHID_LIBRARY
NAMES
hid
libhid
HINTS
"${WINHID_ROOT_DIR}"
${_prefixed}
PATH_SUFFIXES
"lib/w2k/${_arch}" # Win2k min requirement
"lib/wxp/${_arch}" # WinXP min requirement
"lib/wnet/${_arch}" # Win Server 2003 min requirement
"lib/wlh/${_arch}" # Win Vista ("Long Horn") min requirement
"lib/win7/${_arch}" # Win 7 min requirement
)
# Might want to look close to the library first for the includes.
get_filename_component(_libdir "${WINHID_LIBRARY}" PATH)
get_filename_component(_basedir "${_libdir}/../../.." ABSOLUTE)
find_path(WINHID_CRT_INCLUDE_DIR # otherwise you get weird compile errors
NAMES
stdio.h
HINTS
"${_basedir}"
PATHS
"${WINHID_ROOT_DIR}"
PATH_SUFFIXES
inc/crt
NO_DEFAULT_PATH)
find_path(WINHID_INCLUDE_DIR
NAMES
hidsdi.h
HINTS
"${_basedir}"
PATHS
"${WINHID_ROOT_DIR}"
PATH_SUFFIXES
inc/ddk
inc/api
inc/w2k
inc/wxp
inc/wnet)
else()
find_library(WINHID_LIBRARY
NAMES
libhid
HINTS
"${WINHID_ROOT_DIR}"
/mingw
PATH_SUFFIXES
lib
lib/w32api)
find_path(WINHID_INCLUDE_DIR
NAMES
hidsdi.h
PATHS
"${WINHID_ROOT_DIR}"
/mingw
PATH_SUFFIXES
include/w32api/ddk
include/ddk
ddk)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WinHID
DEFAULT_MSG
WINHID_LIBRARY
WINHID_INCLUDE_DIR)
if(WINHID_FOUND)
if(MSVC)
set(_winreq "Unknown")
if(WINHID_LIBRARY MATCHES "lib/w2k")
set(_winreq "Windows 2000")
elseif(WINHID_LIBRARY MATCHES "lib/wxp")
set(_winreq "Windows XP")
elseif(WINHID_LIBRARY MATCHES "lib/wnet")
set(_winreq "Windows Server 2003")
elseif(WINHID_LIBRARY MATCHES "lib/wlh")
set(_winreq "Windows Vista")
elseif(WINHID_LIBRARY MATCHES "lib/win7")
set(_winreq "Windows 7")
endif()
if(NOT "${WINHID_MIN_WINDOWS_VER}" STREQUAL "${_winreq}")
if(NOT WinHID_FIND_QUIETLY)
message(STATUS
"Linking against WINHID_LIBRARY will enforce this minimum version: ${_winreq}")
endif()
set(WINHID_MIN_WINDOWS_VER "${_winreq}" CACHE INTERNAL "" FORCE)
endif()
endif()
set(WINHID_LIBRARIES "${WINHID_LIBRARY}")
set(WINHID_INCLUDE_DIRS
"${WINHID_CRT_INCLUDE_DIR}"
"${WINHID_INCLUDE_DIR}")
mark_as_advanced(WINHID_ROOT_DIR)
endif()
mark_as_advanced(WINHID_INCLUDE_DIR
WINHID_CRT_INCLUDE_DIR
WINHID_LIBRARY)