File: FindPyBroccoli.cmake

package info (click to toggle)
broccoli-python 0.62-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 460 kB
  • ctags: 105
  • sloc: python: 407; sh: 202; makefile: 21
file content (25 lines) | stat: -rw-r--r-- 765 bytes parent folder | download | duplicates (22)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# - Determine if the Broccoli Python bindings are available
#
# Usage of this module as follows:
#
#  find_package(PythonInterp REQUIRED)
#  find_package(PyBroccoli)
#
# Variables defined by this module:
#
#  PYBROCCOLI_FOUND             Python successfully imports broccoli bindings

if (NOT PYBROCCOLI_FOUND)
    execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import broccoli"
                    RESULT_VARIABLE PYBROCCOLI_IMPORT_RESULT)

    if (PYBROCCOLI_IMPORT_RESULT)
        # python returned non-zero exit status
        set(BROCCOLI_PYTHON_MODULE false)
    else ()
        set(BROCCOLI_PYTHON_MODULE true)
    endif ()
endif ()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PyBroccoli DEFAULT_MSG BROCCOLI_PYTHON_MODULE)