You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindThirdPartyExpat.cmake 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # ---------------------------------
  2. # Finds EXPAT toolkit
  3. #
  4. # Sets EXPAT_FOUND
  5. # Sets EXPAT_LIBRARIES
  6. # Sets EXPAT_LIBRARY_DIRS
  7. # Sets EXPAT_LDFLAGS
  8. # Sets EXPAT_LDFLAGS_OTHERS
  9. # Sets EXPAT_INCLUDE_DIRS
  10. # Sets EXPAT_CFLAGS
  11. # Sets EXPAT_CFLAGS_OTHERS
  12. # ---------------------------------
  13. IF(UNIX)
  14. SET(EXPAT_expat_INCLUDE_PATH "EXPAT_expat_INCLUDE_PATH-NOTFOUND")
  15. FIND_PATH(EXPAT_expat_INCLUDE_PATH "include/expat.h"
  16. PATHS "${LIST_DEPENDENCIES_PATH}")
  17. FIND_LIBRARY(EXPAT_expat_LIBRARY
  18. NAMES lib/expat
  19. PATHS "${LIST_DEPENDENCIES_PATH}")
  20. ENDIF(UNIX)
  21. IF(WIN32)
  22. SET(EXPAT_expat_INCLUDE_PATH "EXPAT_expat_INCLUDE_PATH-NOTFOUND")
  23. FIND_PATH(EXPAT_expat_INCLUDE_PATH "expat/Source/libexpat.h"
  24. PATHS "${LIST_DEPENDENCIES_PATH}")
  25. FIND_LIBRARY(EXPAT_expat_LIBRARY
  26. NAMES libexpat
  27. PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES "expat/Libs" "expat/Bin")
  28. ENDIF(WIN32)
  29. IF(EXPAT_expat_INCLUDE_PATH)
  30. IF(EXPAT_expat_LIBRARY)
  31. SET(EXPAT_FOUND TRUE)
  32. SET(EXPAT_LIBRARIES ${EXPAT_expat_LIBRARY})
  33. SET(EXPAT_LIBRARY_DIRS "")
  34. SET(EXPAT_LDFLAGS "")
  35. SET(EXPAT_LDFLAGS_OTHERS "")
  36. SET(EXPAT_INCLUDE_DIRS ${EXPAT_expat_INCLUDE_PATH})
  37. SET(EXPAT_CFLAGS "")
  38. SET(EXPAT_CFLAGS_OTHERS "")
  39. ENDIF(EXPAT_expat_LIBRARY)
  40. ENDIF(EXPAT_expat_INCLUDE_PATH)
  41. MARK_AS_ADVANCED(
  42. EXPAT_expat_INCLUDE_PATH
  43. EXPAT_expat_LIBRARY
  44. EXPAT_FOUND
  45. EXPAT_LIBRARIES
  46. EXPAT_LIBRARY_DIRS
  47. EXPAT_LDFLAGS
  48. EXPAT_LDFLAGS_OTHERS
  49. EXPAT_INCLUDE_DIRS
  50. EXPAT_CFLAGS
  51. EXPAT_CFLAGS_OTHERS
  52. )
  53. IF(EXPAT_FOUND)
  54. debug_message( " Found expat...")
  55. INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIRS})
  56. ADD_DEFINITIONS(${EXPAT_CFLAGS})
  57. ADD_DEFINITIONS(${EXPAT_CFLAGS_OTHERS})
  58. # LINK_DIRECTORIES(${EXPAT_LIBRARY_DIRS})
  59. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${EXPAT_LIBRARIES})
  60. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyExpat)
  61. ELSE(EXPAT_FOUND)
  62. MESSAGE(WARNING " FAILED to find expat...")
  63. ENDIF(EXPAT_FOUND)