Missing file
[opentx.git] / cmake / FindXercesC.cmake
blob4431cbdf598e871cd10eb7a8be552b769c04a8fe
1 # Find Xerces-C
2 # The following setings are defined
3 # XERCESC_ROOT_DIR, the root of the include and lib directory
4 # XERCESC_INCLUDE_DIR, the full path of the include dir (ADVANCED)
5 # XERCESC_LIBRARIES, the name of the xerces-c library (ADVANCED)
7 # Look for a root installation
8 IF( MSVC )
9 SET( XERCES_WINDIR C:/Programs/xerces-vc )
10 ELSE( )
11 SET( XERCES_WINDIR C:/Programs/xerces )
12 ENDIF( )
14 FIND_PATH(XERCESC_ROOT_DIR include/xercesc/parsers/SAXParser.hpp
15   ${XERCES_WINDIR}
16   "C:/mingw/msys/1.0/local"
17   "C:/Program Files/CodeSynthesis XSD 3.2"
18   /usr
19   /usr/local
20   "C:/MinGW"
21   $ENV{CODESYNTH}
22   DOC "The root of an installed xerces-c installation"
25 # try to find the header
26 FIND_PATH(XERCESC_INCLUDE_DIR xercesc/parsers/SAXParser.hpp
27   ${XERCESC_ROOT_DIR}/include
28   /usr/include
29   /usr/local/include
32 # Find the library
33 FIND_LIBRARY(XERCESC_LIBRARY
34   NAMES xerces-c xerces-c_3
35   PATHS
36     ${XERCESC_ROOT_DIR}/lib
37     ${XERCESC_ROOT_DIR}/lib/vc-9.0
38     ${XERCESC_ROOT_DIR}/lib64/vc-9.0
39     /usr/lib
40     /usr/local/lib
41   DOC "The name of the xerces-c library"
44 IF (XERCESC_ROOT_DIR)
45   IF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
46     SET (XERCESC_FOUND TRUE)
47     SET (XERCESC_LIBRARIES "${XERCESC_LIBRARY}")
48     # FIXME: There should be a better way of handling this?
49     # FIXME: How can we test to see if the lib dir isn't
50     # FIXME: one of the default dirs?
51     LINK_DIRECTORIES(${XERCESC_ROOT_DIR}/lib)
52   ENDIF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
53 ENDIF (XERCESC_ROOT_DIR)
55 IF (XERCESC_FOUND)
56   IF (NOT XERCESC_FIND_QUIETLY)
57     MESSAGE (STATUS "  found xerces-c: ${XERCESC_LIBRARY}")
58   ENDIF (NOT XERCESC_FIND_QUIETLY)
59 ELSE (XERCESC_FOUND)
60   IF (XERCESC_FIND_REQUIRED)
61     MESSAGE(FATAL_ERROR "Could not find Xerces-C")
62   ENDIF (XERCESC_FIND_REQUIRED)
63 ENDIF (XERCESC_FOUND)
65 MARK_AS_ADVANCED(
66   XERCESC_INCLUDE_DIR
67   XERCESC_LIBRARY