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 2.0KB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 "expat.h"
  16. PATHS "${OV_CUSTOM_DEPENDENCIES_PATH}/include")
  17. FIND_LIBRARY(EXPAT_expat_LIBRARY
  18. NAMES expat
  19. PATHS "${OV_CUSTOM_DEPENDENCIES_PATH}/lib")
  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.h"
  24. PATHS ${OV_CUSTOM_DEPENDENCIES_PATH} PATH_SUFFIXES expat/include expat/Source/lib)
  25. FIND_LIBRARY(EXPAT_expat_LIBRARY
  26. NAMES libexpat
  27. PATHS ${OV_CUSTOM_DEPENDENCIES_PATH} PATH_SUFFIXES expat/Lib expat/Bin)
  28. FIND_PATH(EXPAT_BIN . PATHS ${OV_CUSTOM_DEPENDENCIES_PATH} PATH_SUFFIXES expat/Bin NO_DEFAULT_PATH)
  29. INSTALL(
  30. DIRECTORY ${EXPAT_BIN}/
  31. DESTINATION ${DIST_BINDIR}
  32. FILES_MATCHING PATTERN "*.dll")
  33. ENDIF(WIN32)
  34. IF(EXPAT_expat_INCLUDE_PATH)
  35. IF(EXPAT_expat_LIBRARY)
  36. SET(EXPAT_FOUND TRUE)
  37. SET(EXPAT_LIBRARIES ${EXPAT_expat_LIBRARY})
  38. SET(EXPAT_LIBRARY_DIRS "")
  39. SET(EXPAT_LDFLAGS "")
  40. SET(EXPAT_LDFLAGS_OTHERS "")
  41. SET(EXPAT_INCLUDE_DIRS ${EXPAT_expat_INCLUDE_PATH})
  42. SET(EXPAT_CFLAGS "")
  43. SET(EXPAT_CFLAGS_OTHERS "")
  44. ENDIF(EXPAT_expat_LIBRARY)
  45. ENDIF(EXPAT_expat_INCLUDE_PATH)
  46. MARK_AS_ADVANCED(
  47. EXPAT_expat_INCLUDE_PATH
  48. EXPAT_expat_LIBRARY
  49. EXPAT_FOUND
  50. EXPAT_LIBRARIES
  51. EXPAT_LIBRARY_DIRS
  52. EXPAT_LDFLAGS
  53. EXPAT_LDFLAGS_OTHERS
  54. EXPAT_INCLUDE_DIRS
  55. EXPAT_CFLAGS
  56. EXPAT_CFLAGS_OTHERS
  57. )
  58. IF(EXPAT_FOUND)
  59. debug_message( " Found expat...")
  60. INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIRS})
  61. ADD_DEFINITIONS(${EXPAT_CFLAGS})
  62. ADD_DEFINITIONS(${EXPAT_CFLAGS_OTHERS})
  63. # LINK_DIRECTORIES(${EXPAT_LIBRARY_DIRS})
  64. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${EXPAT_LIBRARIES})
  65. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyExpat)
  66. ELSE(EXPAT_FOUND)
  67. MESSAGE(WARNING " FAILED to find expat...")
  68. ENDIF(EXPAT_FOUND)