Remove QuickLZ from OSS builds
[hiphop-php.git] / CMake / FindOCaml.cmake
blobc58062299bc49e071c9a23eaf8cc6b86632cdff9
1 set(OCAMLC_FOUND FALSE)
2 set(OCAMLC_OPT_SUFFIX "")
4 find_program(OCAMLC_EXECUTABLE ocamlc DOC "path to ocamlc")
5 mark_as_advanced(OCAMLC_EXECUTABLE)
7 if(OCAMLC_EXECUTABLE)
8   message(STATUS "Found ocamlc: ${OCAMLC_EXECUTABLE}")
9   execute_process(COMMAND ${OCAMLC_EXECUTABLE} -version
10     OUTPUT_VARIABLE OCAMLC_VERSION
11     OUTPUT_STRIP_TRAILING_WHITESPACE)
12   if ("${OCAMLC_VERSION}" VERSION_LESS "3.12")
13     message(STATUS "OCaml version ${OCAMLC_VERSION} is too old "
14       "to build the Hack typechecker, need at least 3.12")
15   else()
16     set(OCAMLC_FOUND TRUE)
18     find_program(OCAMLC_OPT_EXECUTABLE ocamlc.opt DOC "path to ocamlc.opt")
19     mark_as_advanced(OCAMLC_OPT_EXECUTABLE)
21     if (OCAMLC_OPT_EXECUTABLE)
22       message(STATUS "Found ocamlc.opt: ${OCAMLC_OPT_EXECUTABLE}")
23       set(OCAMLC_OPT_SUFFIX ".opt")
24     else()
25       message(STATUS "Could not find ocamlc.opt, "
26         "Hack typechecker build will be slow")
27     endif()
28   endif()
29 else()
30   message(STATUS "OCaml not found, will not build Hack typechecker")
31 endif()