30e1f035cc66f111fbf416ddee3ac92fc74e9652
[platform/upstream/dldt.git] / inference-engine / ie_bridges / python / cmake / FindCython.cmake
1 # Find the Cython compiler.
2 #
3 # This code sets the following variables:
4 #
5 #  CYTHON_EXECUTABLE
6 #
7 # See also UseCython.cmake
8
9 #=============================================================================
10 # Copyright 2011 Kitware, Inc.
11 #
12 # Licensed under the Apache License, Version 2.0 (the "License");
13 # you may not use this file except in compliance with the License.
14 # You may obtain a copy of the License at
15 #
16 #     http://www.apache.org/licenses/LICENSE-2.0
17 #
18 # Unless required by applicable law or agreed to in writing, software
19 # distributed under the License is distributed on an "AS IS" BASIS,
20 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 # See the License for the specific language governing permissions and
22 # limitations under the License.
23 #=============================================================================
24
25 # Use the Cython executable that lives next to the Python executable
26 # if it is a local installation.
27 find_package( PythonInterp )
28 if( PYTHONINTERP_FOUND )
29   get_filename_component( _python_path ${PYTHON_EXECUTABLE} PATH )
30   find_program( CYTHON_EXECUTABLE
31     NAMES cython cython.bat cython3
32     HINTS ${_python_path} $ENV{HOME}/.local/bin
33     )
34 else()
35   find_program( CYTHON_EXECUTABLE
36     NAMES cython cython.bat cython3
37     )
38 endif()
39
40
41 include( FindPackageHandleStandardArgs )
42 FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE )
43
44 mark_as_advanced( CYTHON_EXECUTABLE )