FindXSLTPROC.cmake 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ################################################################################
  2. # Copyright (C) 2011 HPCC Systems.
  3. #
  4. # All rights reserved. This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as
  6. # published by the Free Software Foundation, either version 3 of the
  7. # License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. ################################################################################
  17. # - Try to find the xsltproc executable
  18. #
  19. # XSLTPROC_FOUND - system has the xsltproc executable.
  20. # XSLTPROC_EXECUTABLE - the runtime path of the xsltproc executable
  21. if (NOT XSLTPROC_FOUND)
  22. IF (WIN32)
  23. SET (xsltproc_n "xsltproc.exe")
  24. ELSE()
  25. SET (xsltproc_n "xsltproc")
  26. ENDIF()
  27. IF (NOT ${EXTERNALS_DIRECTORY} STREQUAL "")
  28. IF (UNIX)
  29. IF (${ARCH64BIT} EQUAL 1)
  30. SET (osdir "linux64_gcc4.1.1")
  31. ELSE()
  32. SET (osdir "linux32_gcc4.1.1")
  33. ENDIF()
  34. ELSEIF(WIN32)
  35. SET (osdir "lib")
  36. ELSE()
  37. SET (osdir "unknown")
  38. ENDIF()
  39. IF (NOT ("${osdir}" STREQUAL "unknown"))
  40. FIND_PROGRAM(XSLTPROC_EXECUTABLE ${xsltproc_n} PATHS "${EXTERNALS_DIRECTORY}/xsltproc/${osdir}")
  41. ENDIF()
  42. ENDIF()
  43. if (USE_NATIVE_LIBRARIES)
  44. # if we didn't find in externals, look in system include path
  45. FIND_PROGRAM(XSLTPROC_EXECUTABLE ${xsltproc_n})
  46. endif()
  47. include(FindPackageHandleStandardArgs)
  48. find_package_handle_standard_args(XSLTPROC DEFAULT_MSG
  49. XSLTPROC_EXECUTABLE
  50. )
  51. MARK_AS_ADVANCED(XSLTPROC_EXECUTABLE)
  52. ENDIF()