The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14920 
====================================================================== 
Reported By:                George Sakhnovsky
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14920
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   low
Status:                     new
====================================================================== 
Date Submitted:             2014-05-16 11:19 EDT
Last Modified:              2014-05-16 11:19 EDT
====================================================================== 
Summary:                    find_package PythonInterp & PythonLibs fails if
packages have been found previously
Description: 
The 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?
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-05-16 11:19 George SakhnovskyNew Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to