a3f7373fdf75b637a6b0506b40668dc9829bbd2d
[reactos.git] / reactos / lib / 3rdparty / libwin-iconv / FindWcecompat.cmake
1 # Try to find Wcecompat functionality
2 # Once done this will define
3 #
4 # WCECOMPAT_FOUND - system has Wcecompat
5 # WCECOMPAT_INCLUDE_DIR - Wcecompat include directory
6 # WCECOMPAT_LIBRARIES - Libraries needed to use Wcecompat
7 #
8 # Copyright (c) 2010, Andreas Holzammer, <andy@kdab.com>
9 #
10 # Redistribution and use is allowed according to the terms of the BSD license.
11
12 if(WCECOMPAT_INCLUDE_DIR AND WCECOMPAT_LIB_FOUND)
13 set(Wcecompat_FIND_QUIETLY TRUE)
14 endif(WCECOMPAT_INCLUDE_DIR AND WCECOMPAT_LIB_FOUND)
15
16 find_path(WCECOMPAT_INCLUDE_DIR errno.h PATH_SUFFIXES wcecompat)
17
18 set(WCECOMPAT_LIB_FOUND FALSE)
19
20 if(WCECOMPAT_INCLUDE_DIR)
21 find_library(WCECOMPAT_LIBRARIES NAMES wcecompat wcecompatex )
22 if(WCECOMPAT_LIBRARIES)
23 set(WCECOMPAT_LIB_FOUND TRUE)
24 endif(WCECOMPAT_LIBRARIES)
25 endif(WCECOMPAT_INCLUDE_DIR)
26
27 # I have no idea what this is about, but it seems to be used quite often, so I add this here
28 set(WCECOMPAT_CONST const)
29
30 include(FindPackageHandleStandardArgs)
31 find_package_handle_standard_args(Wcecompat DEFAULT_MSG WCECOMPAT_LIBRARIES WCECOMPAT_LIB_FOUND)
32
33 mark_as_advanced(WCECOMPAT_INCLUDE_DIR WCECOMPAT_LIBRARIES WCECOMPAT_CONST WCECOMPAT_LIB_FOUND)