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