Warning, /education/kalzium/cmake/modules/FindOCaml.cmake is written in an unsupported language. File is not indexed.

0001 # - Try to find OCaml
0002 # Once done this will define
0003 #
0004 #  OCAML_FOUND - system has OCaml
0005 #  OCAML_OCAMLC_EXECUTABLE - the Libfacile include directory
0006 #  OCAML_OCAMLDEP_EXECUTABLE - Link these to use Libfacile
0007 #  OCAML_OCAMLOPT_EXECUTABLE - Compiler switches required for using Libfacile
0008 #  OCAMLC_DIR
0009 #
0010 # SPDX-FileCopyrightText: 2006 Carsten Niehaus <cniehaus@gmx.de>
0011 # SPDX-FileCopyrightText: 2006 Montel Laurent <montel@kde.org>
0012 # SPDX-License-Identifier: BSD-3-Clause
0013 
0014 if ( OCAML_OCAMLC_EXECUTABLE AND OCAML_OCAMLDEP_EXECUTABLE AND OCAML_OCAMLOPT_EXECUTABLE)
0015 
0016   # in cache already
0017   set(OCAML_FOUND TRUE)
0018 
0019 else ()
0020 
0021 find_program(OCAML_OCAMLC_EXECUTABLE NAMES ocamlc)
0022 find_program(OCAML_OCAMLDEP_EXECUTABLE NAMES ocamldep)
0023 find_program(OCAML_OCAMLOPT_EXECUTABLE NAMES ocamlopt)
0024 
0025 if( OCAML_OCAMLC_EXECUTABLE AND OCAML_OCAMLDEP_EXECUTABLE AND OCAML_OCAMLOPT_EXECUTABLE)
0026    execute_process(COMMAND ${OCAML_OCAMLC_EXECUTABLE} -where OUTPUT_VARIABLE OCAMLC_DIR)
0027    string(REPLACE "\n" "" OCAMLC_DIR "${OCAMLC_DIR}")
0028    #MESSAGE(STATUS "ocamlc directory <${OCAMLC_DIR}>")
0029 
0030      # show the LIBFACILE_INCLUDE_DIR and LIBFACILE_LIBRARIES variables only in the advanced view
0031      MARK_AS_ADVANCED(LIBFACILE_INCLUDE_DIR LIBFACILE_LIBRARIES )
0032  
0033    set(OCAML_FOUND TRUE)
0034 else()
0035 
0036    if(NOT OCAML_OCAMLC_EXECUTABLE)
0037       message(STATUS "ocamlc not found.")
0038    endif()
0039    if(NOT OCAML_OCAMLDEP_EXECUTABLE)
0040       message(STATUS "ocamldep not found.")
0041    endif()
0042    if(NOT OCAML_OCAMLOPT_EXECUTABLE)
0043       message(STATUS "ocamlopt not found.")
0044    endif()
0045    set(OCAML_FOUND FALSE)
0046 endif()
0047 
0048 
0049 if(OCAML_FOUND)
0050    if(NOT OCaml_FIND_QUIETLY)
0051       message(STATUS "Found OCaml: ${OCAML_OCAMLC_EXECUTABLE}")
0052    endif()
0053 else()
0054    if(OCaml_FIND_REQUIRED)
0055       message(FATAL_ERROR "Could not find OCaml")
0056    endif()
0057 endif()
0058 
0059 endif ()
0060