The first line of the error message is the key.<div><br></div><div>Set PYTHON_LIBRARY in the cmake interface to the location of your Python library. For example on my system it is set to:</div><div><br></div><div>PYTHON_LIBRARY C:/Kitware/ParaView 3.10/build-x32/python-build/PCbuild/python27.lib</div>
<div><br></div><div>You will likely also need to set PYTHON_INCLUD_DIR and PYTHON_EXECUTABLE in a similar fashion.</div><div><br></div><div><br><div class="gmail_quote">On Wed, Jun 8, 2011 at 7:28 AM, Thomas Templier <span dir="ltr"><<a href="mailto:templier@neuro.mpg.de" target="_blank">templier@neuro.mpg.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Cmake 2.8.4</p>
<p class="MsoNormal">VTK 5.6.1</p>
<p class="MsoNormal">Compiler : Microsoft Visual C++ 2010 Express</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Dear list, </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I’m struggling with the installation of VTK with python. In Cmake, I activate VTK_WRAP_PYTHON and BUILD_SHARED_LIBS. It gives me the following (see below):</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Then I tried all possible combinations to set the pathways for include, and for the libraries (with PATH, DIR or even DIRS) (should I set /Lib or /libs ?) , then I have the same log as before.
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">I’ve googled it, and found that some years ago, Cmake had a problem with finding Pyhon libraries. But it seems to have been fixed a long time ago also. Here is my FindPythonLibs
file (below): </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">I don’t understand why it does not work.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Has anybody an idea to help me ?</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Thank you</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Best Regards</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Thomas</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Could NOT find PythonLibs (missing: PYTHON_LIBRARIES)
</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">CMake Error: The following variables are used in this project, but they are set to NOTFOUND.</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">Please set them or make sure they are set and tested correctly in the CMake files:</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">PYTHON_LIBRARY (ADVANCED)</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkWrapPython" in directory C:/VTK/vtk-5.4.2/Wrapping</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkCommonPython" in directory C:/VTK/vtk-5.4.2/Common</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkCommonPythonD" in directory C:/VTK/vtk-5.4.2/Common</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkFilteringPython" in directory C:/VTK/vtk-5.4.2/Filtering</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkFilteringPythonD" in directory C:/VTK/vtk-5.4.2/Filtering</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkImagingPython" in directory C:/VTK/vtk-5.4.2/Imaging</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkImagingPythonD" in directory C:/VTK/vtk-5.4.2/Imaging</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkGraphicsPython" in directory C:/VTK/vtk-5.4.2/Graphics</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkGraphicsPythonD" in directory C:/VTK/vtk-5.4.2/Graphics</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkGenericFilteringPython" in directory C:/VTK/vtk-5.4.2/GenericFiltering</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkGenericFilteringPythonD" in directory C:/VTK/vtk-5.4.2/GenericFiltering</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkIOPython" in directory C:/VTK/vtk-5.4.2/IO</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkIOPythonD" in directory C:/VTK/vtk-5.4.2/IO</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkRenderingPython" in directory C:/VTK/vtk-5.4.2/Rendering</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkRenderingPythonD" in directory C:/VTK/vtk-5.4.2/Rendering</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkVolumeRenderingPython" in directory C:/VTK/vtk-5.4.2/VolumeRendering</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkVolumeRenderingPythonD" in directory C:/VTK/vtk-5.4.2/VolumeRendering</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkHybridPython" in directory C:/VTK/vtk-5.4.2/Hybrid</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkHybridPythonD" in directory C:/VTK/vtk-5.4.2/Hybrid</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkWidgetsPython" in directory C:/VTK/vtk-5.4.2/Widgets</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkWidgetsPythonD" in directory C:/VTK/vtk-5.4.2/Widgets</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkInfovisPython" in directory C:/VTK/vtk-5.4.2/Infovis</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkInfovisPythonD" in directory C:/VTK/vtk-5.4.2/Infovis</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkGeovisPython" in directory C:/VTK/vtk-5.4.2/Geovis</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkGeovisPythonD" in directory C:/VTK/vtk-5.4.2/Geovis</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkViewsPython" in directory C:/VTK/vtk-5.4.2/Views</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkViewsPythonD" in directory C:/VTK/vtk-5.4.2/Views</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";color:red">linked by target "vtkpython" in directory C:/VTK/vtk-5.4.2/Wrapping/Python</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Configuring incomplete, errors occurred!</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">*************</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">*************</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">*************</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">FindPythonLibs</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># - Find python libraries</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># This module finds if Python is installed and determines where the</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># include files and libraries are. It also determines what the name of</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># the library is. This code sets the following variables:</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># PYTHONLIBS_FOUND - have the Python libs been found</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># PYTHON_LIBRARIES - path to the python library</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># PYTHON_INCLUDE_DIRS - path to where Python.h is found</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># PYTHON_DEBUG_LIBRARIES - path to the debug library</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#=============================================================================</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># Copyright 2001-2009 Kitware, Inc.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># Distributed under the OSI-approved BSD License (the "License");</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># see accompanying file Copyright.txt for details.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># This software is distributed WITHOUT ANY WARRANTY; without even the</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># See the License for more information.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#=============================================================================</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># (To distribute this file outside of CMake, substitute the full</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># License text for the above reference.)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">INCLUDE(CMakeFindFrameworks)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># Search for the python framework on Apple.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">CMAKE_FIND_FRAMEWORKS(Python)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># Set up the versions we know about, in the order we will search. Always add</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># the user supplied additional versions to the front.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">set(_Python_VERSIONS</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ${Python_ADDITIONAL_VERSIONS}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> IF(WIN32)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FIND_LIBRARY(PYTHON_DEBUG_LIBRARY</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> NAMES python${_CURRENT_VERSION_NO_DOTS}_d python</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PATHS</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs )</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDIF(WIN32)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FIND_LIBRARY(PYTHON_LIBRARY</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PATHS</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> # Avoid finding the .dll in the PATH. We want the .lib.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> NO_SYSTEM_ENVIRONMENT_PATH</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> )</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> # Look for the static library in the Python config directory</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FIND_LIBRARY(PYTHON_LIBRARY</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> # Avoid finding the .dll in the PATH. We want the .lib.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> NO_SYSTEM_ENVIRONMENT_PATH</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> # This is where the static library is usually located</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PATH_SUFFIXES python${_CURRENT_VERSION}/config</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> )</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> # PYTHON_INCLUDE_DIR is not set.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> IF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> "Path to where Python.h is found" FORCE)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDIF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET(PYTHON_FRAMEWORK_INCLUDES)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FOREACH(dir ${Python_FRAMEWORKS})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDFOREACH(dir)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FIND_PATH(PYTHON_INCLUDE_DIR</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> NAMES Python.h</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PATHS</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ${PYTHON_FRAMEWORK_INCLUDES}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PATH_SUFFIXES</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> python${_CURRENT_VERSION}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> )</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> # For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> "Path to where Python.h is found (deprecated)")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">ENDFOREACH(_CURRENT_VERSION)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">MARK_AS_ADVANCED(</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PYTHON_DEBUG_LIBRARY</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PYTHON_LIBRARY</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PYTHON_INCLUDE_DIR</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># cache entries because they are meant to specify the location of a single</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># library. We now set the variables listed by the documentation for this</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># module.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># in your sources to initialize the static python modules</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">FUNCTION(PYTHON_ADD_MODULE _NAME )</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> OPTION(PYTHON_MODULE_${_NAME}_BUILD_SHARED</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> "Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> # Mark these options as advanced</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> MARK_AS_ADVANCED(PYTHON_ENABLE_MODULE_${_NAME}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> PYTHON_MODULE_${_NAME}_BUILD_SHARED)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> IF(PYTHON_ENABLE_MODULE_${_NAME})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET(PY_MODULE_TYPE MODULE)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ELSE(PYTHON_MODULE_${_NAME}_BUILD_SHARED)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET(PY_MODULE_TYPE STATIC)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET_PROPERTY(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET_PROPERTY(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET_TARGET_PROPERTIES(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> IF(WIN32 AND NOT CYGWIN)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET_TARGET_PROPERTIES(${_NAME} PROPERTIES SUFFIX ".pyd")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDIF(WIN32 AND NOT CYGWIN)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDIF(PYTHON_ENABLE_MODULE_${_NAME})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">ENDFUNCTION(PYTHON_ADD_MODULE)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">FUNCTION(PYTHON_WRITE_MODULES_HEADER _filename)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> GET_PROPERTY(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> GET_FILENAME_COMPONENT(_name "${_filename}" NAME)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> STRING(REPLACE "." "_" _name "${_name}")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> STRING(TOUPPER ${_name} _nameUpper)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> SET(_filenameTmp "${_filename}.in")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(APPEND ${_filenameTmp}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">"#ifndef ${_nameUpper}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#define ${_nameUpper}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#include <Python.h></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#ifdef __cplusplus</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">extern \"C\" {</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#endif /* __cplusplus */</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(APPEND ${_filenameTmp}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">"#ifdef __cplusplus</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">}</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">#endif /* __cplusplus */</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name,
init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(APPEND ${_filenameTmp} "}\n\n")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> FILE(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""># with CONFIGURE_FILE() cmake complains that you may not use a file created using FILE(WRITE) as input file for CONFIGURE_FILE()</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">ENDFUNCTION(PYTHON_WRITE_MODULES_HEADER)</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""> </span></p>
<p class="MsoNormal"> </p>
</div>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>