Changeset 8183:821aecbc5fc8 in orange


Ignore:
Timestamp:
08/16/11 16:24:14 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
e757ef289b106c8d198f66ef5639934745b3bfd9
Message:

Using find_package(PythonLibs) instead of a custom library search.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orangeqt/modules/FindPythonLibrary.cmake

    r8171 r8183  
    3030 
    3131 
    32 include(CMakeFindFrameworks) 
     32#include(CMakeFindFrameworks) 
    3333 
    3434if(EXISTS PYTHON_LIBRARY) 
     
    3838 
    3939  find_package(PythonInterp) 
    40  
     40  find_package(PythonLibs) 
     41   
     42  if(PYTHONLIBS_FOUND) 
     43    set(PYTHONLIBRARY_FOUND TRUE) 
     44  endif(PYTHONLIBS_FOUND) 
     45   
    4146  if(PYTHONINTERP_FOUND) 
    4247 
     
    6469 
    6570      string(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION}) 
    66       set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT}) 
     71#      set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT}) 
    6772      if(WIN32) 
    6873          string(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR}) 
    69       endif(WIN32) 
    70       find_library(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs NO_DEFAULT_PATH) 
    71       set(PYTHONLIBRARY_FOUND TRUE) 
     74#      endif(WIN32) 
     75#      find_library(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs NO_DEFAULT_PATH) 
     76#      set(PYTHONLIBRARY_FOUND TRUE) 
    7277    endif(python_config) 
    7378 
    7479    # adapted from cmake's builtin FindPythonLibs 
    75     if(APPLE) 
    76       cmake_find_frameworks(Python) 
    77       set(PYTHON_FRAMEWORK_INCLUDES) 
    78       if(Python_FRAMEWORKS) 
    79         # If a framework has been selected for the include path, 
    80         # make sure "-framework" is used to link it. 
    81         if("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") 
    82           set(PYTHON_LIBRARY "") 
    83           set(PYTHON_DEBUG_LIBRARY "") 
    84         endif("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") 
    85         if(NOT PYTHON_LIBRARY) 
    86           set (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE) 
    87         endif(NOT PYTHON_LIBRARY) 
    88         set(PYTHONLIBRARY_FOUND TRUE) 
    89       endif(Python_FRAMEWORKS) 
    90     endif(APPLE) 
     80#    if(APPLE) 
     81#      cmake_find_frameworks(Python) 
     82#      set(PYTHON_FRAMEWORK_INCLUDES) 
     83#      if(Python_FRAMEWORKS) 
     84#        # If a framework has been selected for the include path, 
     85#        # make sure "-framework" is used to link it. 
     86#        if("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") 
     87#          set(PYTHON_LIBRARY "") 
     88#          set(PYTHON_DEBUG_LIBRARY "") 
     89#        endif("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") 
     90#        if(NOT PYTHON_LIBRARY) 
     91#          set (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE) 
     92#        endif(NOT PYTHON_LIBRARY) 
     93#        set(PYTHONLIBRARY_FOUND TRUE) 
     94#      endif(Python_FRAMEWORKS) 
     95#    endif(APPLE) 
    9196  endif(PYTHONINTERP_FOUND) 
    9297 
    9398  if(PYTHONLIBRARY_FOUND) 
    94     set(PYTHON_LIBRARIES ${PYTHON_LIBRARY}) 
     99#    set(PYTHON_LIBRARIES ${PYTHON_LIBRARY}) 
    95100    if(NOT PYTHONLIBRARY_FIND_QUIETLY) 
    96101      message(STATUS "Found Python executable: ${PYTHON_EXECUTABLE}") 
    97102      message(STATUS "Found Python version: ${PYTHON_LONG_VERSION}") 
    98       message(STATUS "Found Python library: ${PYTHON_LIBRARY}") 
     103      message(STATUS "Found Python library: ${PYTHON_LIBRARIES}") 
    99104    endif(NOT PYTHONLIBRARY_FIND_QUIETLY) 
    100105  else(PYTHONLIBRARY_FOUND) 
Note: See TracChangeset for help on using the changeset viewer.