• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
27find_package( PythonInterp )
28if( 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}
33    )
34else()
35  find_program( CYTHON_EXECUTABLE
36    NAMES cython cython.bat cython3
37    )
38endif()
39
40
41include( FindPackageHandleStandardArgs )
42FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE )
43
44mark_as_advanced( CYTHON_EXECUTABLE )
45