FindLIBXSLT.cmake 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ################################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ################################################################################
  16. # - Try to find the LIBXSLT xml library
  17. # Once done this will define
  18. #
  19. # LIBXSLT_FOUND - system has the LIBXSLT library
  20. # LIBXSLT_INCLUDE_DIR - the LIBXSLT include directory
  21. # LIBXSLT_LIBRARIES - The libraries needed to use LIBXSLT
  22. if (NOT LIBXSLT_FOUND)
  23. IF (WIN32)
  24. SET (libxslt_libs "xslt libxslt")
  25. SET (libexslt_libs "exslt libexslt")
  26. ELSE()
  27. SET (libxslt_libs "xslt libxslt")
  28. SET (libexslt_libs "exslt libexslt")
  29. ENDIF()
  30. IF (NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")
  31. IF (UNIX)
  32. IF (${ARCH64BIT} EQUAL 1)
  33. SET (osdir "linux64_gcc4.1.1")
  34. ELSE()
  35. SET (osdir "linux32_gcc4.1.1")
  36. ENDIF()
  37. ELSEIF(WIN32)
  38. SET (osdir "lib")
  39. ELSE()
  40. SET (osdir "unknown")
  41. ENDIF()
  42. IF (NOT ("${osdir}" STREQUAL "unknown"))
  43. FIND_PATH (LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h PATHS "${EXTERNALS_DIRECTORY}/libxslt/include" NO_DEFAULT_PATH)
  44. FIND_LIBRARY (LIBXSLT_LIBRARIES NAMES ${libxslt_libs} PATHS "${EXTERNALS_DIRECTORY}/libxslt/${osdir}" NO_DEFAULT_PATH)
  45. FIND_PATH (LIBEXSLT_INCLUDE_DIR NAMES libexslt/exslt.h PATHS "${EXTERNALS_DIRECTORY}/libexslt/include" NO_DEFAULT_PATH)
  46. FIND_LIBRARY (LIBEXSLT_LIBRARIES NAMES ${libexslt_libs} PATHS "${EXTERNALS_DIRECTORY}/libexslt/${osdir}" NO_DEFAULT_PATH)
  47. ENDIF()
  48. ENDIF()
  49. if (USE_NATIVE_LIBRARIES)
  50. # if we didn't find in externals, look in system include path
  51. FIND_PATH (LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h )
  52. FIND_LIBRARY (LIBXSLT_LIBRARIES NAMES xslt libxslt)
  53. FIND_PATH (LIBEXSLT_INCLUDE_DIR NAMES libexslt/exslt.h )
  54. FIND_LIBRARY (LIBEXSLT_LIBRARIES NAMES exslt libexslt)
  55. endif()
  56. include(FindPackageHandleStandardArgs)
  57. find_package_handle_standard_args(Libxslt DEFAULT_MSG
  58. LIBXSLT_LIBRARIES
  59. LIBXSLT_INCLUDE_DIR
  60. LIBEXSLT_LIBRARIES
  61. LIBEXSLT_INCLUDE_DIR
  62. )
  63. MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBEXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES LIBEXSLT_LIBRARIES)
  64. ENDIF()