View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014920CMakeCMakepublic2014-05-16 11:192016-06-10 14:31
ReporterGeorge Sakhnovsky 
Assigned ToKitware Robot 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformWindows 7OSWindows 7OS VersionWindows 7
Product VersionCMake 2.8.12.2 
Target VersionFixed in Version 
Summary0014920: find_package PythonInterp & PythonLibs fails if packages have been found previously
DescriptionThe following are set in the main CMakeLists.txt:

set (PYTHON_EXECUTABLE "${ADS_DIR}/Python_2_7_3/Win32/python.exe")
set (PYTHON_INCLUDE_DIR "${ADS_DIR}/Python_2_7_3/include")
set (PYTHON_LIBRARY "${ADS_DIR}/Python_2_7_3/Win32/libs/python27.lib")

The first time find_package(PythonInterp) or find_package(PythonLibs) are called, whether from the main CMakeLists.txt or that added via add_subdirectory, the call is successful:

Found PythonInterp: D:/tfs/ADSDIR/Python_2_7_3/Win32/python.exe (found version "2.7.3")
Found PythonLibs: D:/tfs/ADSDIR/Python_2_7_3/Win32/libs/python27.lib (found version "2.7.3")

However, from this point on, any time find_package(PythonInterp) or find_package(PythonLibs) are called, they fail and seemingly remove all knowledge of the python instance being found, including un-setting PYTHONINTERP_FOUND and PYTHONLIBS_FOUND:

Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (found version "2.7.3")
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)

This is in contradiction to how find_package works with other targets such as QT and VTK.

As a temporary band-aid I added conditionals:

#if (NOT PYTHONLIBS_FOUND)
    FIND_PACKAGE(PythonLibs)
#endif (NOT PYTHONLIBS_FOUND)

Is this behavior of add_package by design or a bug?
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0042548)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-05-16 11:19 George Sakhnovsky New Issue
2016-06-10 14:29 Kitware Robot Note Added: 0042548
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team