aboutsummaryrefslogtreecommitdiff
path: root/attic/modules/FindPythonLibrary.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'attic/modules/FindPythonLibrary.cmake')
-rw-r--r--attic/modules/FindPythonLibrary.cmake26
1 files changed, 13 insertions, 13 deletions
diff --git a/attic/modules/FindPythonLibrary.cmake b/attic/modules/FindPythonLibrary.cmake
index 60567e29..bb02c1bb 100644
--- a/attic/modules/FindPythonLibrary.cmake
+++ b/attic/modules/FindPythonLibrary.cmake
@@ -34,7 +34,7 @@ include(CMakeFindFrameworks)
if(EXISTS PYTHON_LIBRARY)
# Already in cache, be silent
set(PYTHONLIBRARY_FOUND TRUE)
-else(EXISTS PYTHON_LIBRARY)
+else()
find_package(PythonInterp)
@@ -44,7 +44,7 @@ else(EXISTS PYTHON_LIBRARY)
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")
+ endif()
execute_process(COMMAND ${PYTHON_EXECUTABLE} "${_py_cmake_module_dir}/FindLibPython.py" OUTPUT_VARIABLE python_config)
if(python_config)
@@ -66,10 +66,10 @@ else(EXISTS PYTHON_LIBRARY)
set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT})
if(WIN32)
string(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR})
- endif(WIN32)
+ endif()
find_library(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs NO_DEFAULT_PATH)
set(PYTHONLIBRARY_FOUND TRUE)
- endif(python_config)
+ endif()
# adapted from cmake's builtin FindPythonLibs
if(APPLE)
@@ -81,14 +81,14 @@ else(EXISTS PYTHON_LIBRARY)
if("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
set(PYTHON_LIBRARY "")
set(PYTHON_DEBUG_LIBRARY "")
- endif("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
+ endif()
if(NOT PYTHON_LIBRARY)
set (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
- endif(NOT PYTHON_LIBRARY)
+ endif()
set(PYTHONLIBRARY_FOUND TRUE)
- endif(Python_FRAMEWORKS)
- endif(APPLE)
- endif(PYTHONINTERP_FOUND)
+ endif()
+ endif()
+ endif()
if(PYTHONLIBRARY_FOUND)
set(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
@@ -96,11 +96,11 @@ else(EXISTS PYTHON_LIBRARY)
message(STATUS "Found Python executable: ${PYTHON_EXECUTABLE}")
message(STATUS "Found Python version: ${PYTHON_LONG_VERSION}")
message(STATUS "Found Python library: ${PYTHON_LIBRARY}")
- endif(NOT PYTHONLIBRARY_FIND_QUIETLY)
- else(PYTHONLIBRARY_FOUND)
+ endif()
+ else()
if(PYTHONLIBRARY_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Python")
- endif(PYTHONLIBRARY_FIND_REQUIRED)
- endif(PYTHONLIBRARY_FOUND)
+ endif()
+ endif()
endif (EXISTS PYTHON_LIBRARY)