diff options
| author | Alexander Neundorf <neundorf@kde.org> | 2010-06-22 20:39:03 +0000 | 
|---|---|---|
| committer | Alexander Neundorf <neundorf@kde.org> | 2010-06-22 20:39:03 +0000 | 
| commit | dce1cd0521e1e308910390d67a2b38856d5b42f4 (patch) | |
| tree | 93815e69a7a04cbebc850abddad9aae6feaa3436 | |
| parent | e018549380e071f80dc01171446ff4bf9364292d (diff) | |
| download | extra-cmake-modules-dce1cd0521e1e308910390d67a2b38856d5b42f4.tar.gz extra-cmake-modules-dce1cd0521e1e308910390d67a2b38856d5b42f4.tar.bz2 | |
-call FindLibPy.py directly from the same directory, no need to use find_file() here
Alex
svn path=/trunk/KDE/kdelibs/; revision=1141467
| -rw-r--r-- | modules/FindPythonLibrary.cmake | 8 | 
1 files changed, 6 insertions, 2 deletions
| 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}) | 
