WtFindHaru.txt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # We set:
  2. # - HARU_INCLUDE_DIRS
  3. # - HARU_LIBRARIES
  4. # - HARU_FOUND
  5. # Taking into account:
  6. # - HARU_PREFIX
  7. FIND_PATH(HARU_INCLUDE_DIR
  8. hpdf.h
  9. PATHS
  10. ${HARU_PREFIX}/include
  11. ${HARU_PREFIX}/include/hpdf
  12. ${HARU_PREFIX}/include/libharu
  13. /usr/include
  14. )
  15. IF(WIN32)
  16. IF(HARU_DYNAMIC)
  17. SET(HARU_RELEASE_NAMES "libhpdf")
  18. SET(HARU_DEBUG_NAMES "libhpdfd")
  19. ELSE(HARU_DYNAMIC)
  20. SET(HARU_RELEASE_NAMES "libhpdfs")
  21. SET(HARU_DEBUG_NAMES "libhpdfsd")
  22. ENDIF(HARU_DYNAMIC)
  23. FIND_LIBRARY(HARU_LIB_RELEASE
  24. NAMES
  25. ${HARU_RELEASE_NAMES}
  26. PATHS
  27. ${HARU_PREFIX}/lib
  28. )
  29. FIND_LIBRARY(HARU_LIB_DEBUG
  30. NAMES
  31. ${HARU_DEBUG_NAMES}
  32. PATHS
  33. ${HARU_PREFIX}/lib
  34. )
  35. SET(HARU_LIB ${HARU_LIB_RELEASE})
  36. IF(HARU_LIB_RELEASE AND HARU_LIB_DEBUG)
  37. SET(HARU_LIB optimized ${HARU_LIB_RELEASE} debug ${HARU_LIB_DEBUG})
  38. ENDIF(HARU_LIB_RELEASE AND HARU_LIB_DEBUG)
  39. SET(HARU_SUPPORT_LIBS_FOUND FALSE)
  40. IF (PNG_LIBRARIES AND ZLIB_LIBRARIES)
  41. SET(HARU_SUPPORT_LIBS_FOUND TRUE)
  42. SET(HARU_SUPPORT_LIBS ${PNG_LIBRARIES} ${ZLIB_LIBRARIES})
  43. ENDIF (PNG_LIBRARIES AND ZLIB_LIBRARIES)
  44. ELSE(WIN32)
  45. FIND_LIBRARY(HARU_LIB
  46. NAMES
  47. hpdf
  48. haru
  49. PATHS
  50. ${HARU_PREFIX}/lib
  51. )
  52. FIND_LIBRARY(M_LIB
  53. NAMES
  54. m
  55. PATHS
  56. ${HARU_PREFIX}/lib
  57. ${USERLIB_PREFIX}/lib
  58. /lib/x86_64-linux-gnu
  59. )
  60. SET(HARU_SUPPORT_LIBS_FOUND FALSE)
  61. IF (PNG_LIBRARIES AND M_LIB AND ZLIB_LIBRARIES)
  62. SET(HARU_SUPPORT_LIBS_FOUND TRUE)
  63. SET(HARU_SUPPORT_LIBS ${PNG_LIBRARIES} ${M_LIB} ${ZLIB_LIBRARIES})
  64. ENDIF (PNG_LIBRARIES AND M_LIB AND ZLIB_LIBRARIES)
  65. ENDIF(WIN32)
  66. IF(HARU_LIB AND HARU_INCLUDE_DIR AND HARU_SUPPORT_LIBS_FOUND)
  67. SET(HARU_FOUND TRUE)
  68. SET(HARU_INCLUDE_DIRS ${HARU_INCLUDE_DIR})
  69. SET(HARU_LIBRARIES ${HARU_LIB} ${HARU_SUPPORT_LIBS})
  70. MESSAGE(STATUS "Found libharu libraries")
  71. ELSE(HARU_LIB AND HARU_INCLUDE_DIR AND HARU_SUPPORT_LIBS_FOUND)
  72. SET(HARU_FOUND FALSE)
  73. MESSAGE(STATUS "libharu libraries not found - set HARU_PREFIX")
  74. ENDIF(HARU_LIB AND HARU_INCLUDE_DIR AND HARU_SUPPORT_LIBS_FOUND)