[Cmake-commits] [cmake-commits] hoffman committed FindPythonLibs.cmake 1.42 1.43

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Sep 14 09:35:03 EDT 2009


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv13835

Modified Files:
	FindPythonLibs.cmake 
Log Message:
Change FindPythonLibs to use the standard _DIR instead of _PATH but stay backwards compatible


Index: FindPythonLibs.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindPythonLibs.cmake,v
retrieving revision 1.42
retrieving revision 1.43
diff -C 2 -d -r1.42 -r1.43
*** FindPythonLibs.cmake	15 Feb 2008 23:26:37 -0000	1.42
--- FindPythonLibs.cmake	14 Sep 2009 13:34:57 -0000	1.43
***************
*** 4,11 ****
  # the library is. This code sets the following variables:
  #
! #  PYTHONLIBS_FOUND     = have the Python libs been found
! #  PYTHON_LIBRARIES     = path to the python library
! #  PYTHON_INCLUDE_PATH  = path to where Python.h is found
! #  PYTHON_DEBUG_LIBRARIES = path to the debug library
  #
  
--- 4,12 ----
  # the library is. This code sets the following variables:
  #
! #  PYTHONLIBS_FOUND       - have the Python libs been found
! #  PYTHON_LIBRARIES       - path to the python library
! #  PYTHON_INCLUDE_PATH    - path to where Python.h is found (deprecated)
! #  PYTHON_INCLUDE_DIRS    - path to where Python.h is found
! #  PYTHON_DEBUG_LIBRARIES - path to the debug library
  #
  
***************
*** 34,46 ****
    )
  
    SET(PYTHON_FRAMEWORK_INCLUDES)
!   IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_PATH)
      FOREACH(dir ${Python_FRAMEWORKS})
        SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
          ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
      ENDFOREACH(dir)
!   ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_PATH)
  
!   FIND_PATH(PYTHON_INCLUDE_PATH
      NAMES Python.h
      PATHS
--- 35,54 ----
    )
  
+   # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if 
+   # PYTHON_INCLUDE_DIR is not set.
+   IF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+     SET(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
+       "Path to where Python.h is found" FORCE)
+   ENDIF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+ 
    SET(PYTHON_FRAMEWORK_INCLUDES)
!   IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
      FOREACH(dir ${Python_FRAMEWORKS})
        SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
          ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
      ENDFOREACH(dir)
!   ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
  
!   FIND_PATH(PYTHON_INCLUDE_DIR
      NAMES Python.h
      PATHS
***************
*** 50,53 ****
--- 58,65 ----
        python${_CURRENT_VERSION}
    )
+ 
+   # For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal.
+   SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL 
+     "Path to where Python.h is found (deprecated)")
    
  ENDFOREACH(_CURRENT_VERSION)
***************
*** 56,60 ****
    PYTHON_DEBUG_LIBRARY
    PYTHON_LIBRARY
!   PYTHON_INCLUDE_PATH
  )
  
--- 68,72 ----
    PYTHON_DEBUG_LIBRARY
    PYTHON_LIBRARY
!   PYTHON_INCLUDE_DIR
  )
  
***************
*** 63,70 ****
    # If a framework has been selected for the include path,
    # make sure "-framework" is used to link it.
!   IF("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
      SET(PYTHON_LIBRARY "")
      SET(PYTHON_DEBUG_LIBRARY "")
!   ENDIF("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
    IF(NOT PYTHON_LIBRARY)
      SET (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
--- 75,82 ----
    # If a framework has been selected for the include path,
    # make sure "-framework" is used to link it.
!   IF("${PYTHON_INCLUDE_DIR}" MATCHES "Python\\.framework")
      SET(PYTHON_LIBRARY "")
      SET(PYTHON_DEBUG_LIBRARY "")
!   ENDIF("${PYTHON_INCLUDE_DIR}" MATCHES "Python\\.framework")
    IF(NOT PYTHON_LIBRARY)
      SET (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
***************
*** 75,82 ****
  ENDIF(Python_FRAMEWORKS)
  
! # We use PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the cache entries
! # because they are meant to specify the location of a single library.
! # We now set the variables listed by the documentation for this
  # module.
  SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
  SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
--- 87,95 ----
  ENDIF(Python_FRAMEWORKS)
  
! # We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
! # cache entries because they are meant to specify the location of a single
! # library. We now set the variables listed by the documentation for this
  # module.
+ SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
  SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
  SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
***************
*** 84,88 ****
  
  INCLUDE(FindPackageHandleStandardArgs)
! FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_PATH)
  
  
--- 97,101 ----
  
  INCLUDE(FindPackageHandleStandardArgs)
! FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
  
  



More information about the Cmake-commits mailing list