1 # Find the Cython compiler.
3 # This code sets the following variables:
7 # See also UseCython.cmake
9 #=============================================================================
10 # Copyright 2011 Kitware, Inc.
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
16 # http://www.apache.org/licenses/LICENSE-2.0
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 #=============================================================================
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
35 find_program( CYTHON_EXECUTABLE
36 NAMES cython cython.bat cython3
41 include( FindPackageHandleStandardArgs )
42 FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE )
44 mark_as_advanced( CYTHON_EXECUTABLE )