From dce1cd0521e1e308910390d67a2b38856d5b42f4 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 22 Jun 2010 20:39:03 +0000 Subject: -call FindLibPy.py directly from the same directory, no need to use find_file() here Alex svn path=/trunk/KDE/kdelibs/; revision=1141467 --- modules/FindPythonLibrary.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/FindPythonLibrary.cmake') diff --git a/modules/FindPythonLibrary.cmake b/modules/FindPythonLibrary.cmake index e96d63e6..4fe427d0 100644 --- a/modules/FindPythonLibrary.cmake +++ b/modules/FindPythonLibrary.cmake @@ -35,9 +35,13 @@ else(EXISTS PYTHON_LIBRARY) if(PYTHONINTERP_FOUND) - find_file(_find_lib_python_py FindLibPython.py PATHS ${CMAKE_MODULE_PATH}) + # get the directory of the current file, used later on in the file + get_filename_component( _py_cmake_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH) + if(NOT EXISTS "${_py_cmake_module_dir}/FindLibPython.py") + message(FATAL_ERROR "The file FindLibPython.py does not exist in ${_py_cmake_module_dir} (the directory where FindPythonLibrary.cmake is located). Check your installation.") + endif(NOT EXISTS "${_py_cmake_module_dir}/FindLibPython.py") - execute_process(COMMAND ${PYTHON_EXECUTABLE} ${_find_lib_python_py} OUTPUT_VARIABLE python_config) + execute_process(COMMAND ${PYTHON_EXECUTABLE} "${_py_cmake_module_dir}/FindLibPython.py" OUTPUT_VARIABLE python_config) if(python_config) string(REGEX REPLACE ".*exec_prefix:([^\n]+).*$" "\\1" PYTHON_PREFIX ${python_config}) string(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" PYTHON_SHORT_VERSION ${python_config}) -- cgit v1.2.1