[CMake] about FIND_PACKAGE(PythonLibs): Could NOT find PythonLibs

David Aldrich David.Aldrich at EU.NEC.COM
Tue Oct 5 03:58:35 EDT 2010


I think you should be doing something like:

find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})

You shouldn't be calling SET.

Best regards 

David 


> -----Original Message-----
> From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of
> Richie Hwang
> Sent: 04 October 2010 20:24
> To: cmake at cmake.org
> Subject: [CMake] about FIND_PACKAGE(PythonLibs): Could NOT find PythonLibs
> 
> Hi,
> 
> I am using swig to bind python and a c++ project. According to the
> example, In my Cmakelist.txt I wrote as follows:
> 
> SET(PYTHON_INCLUDE_DIRS "C:\\Python27\\include")
> SET(PYTHON_LIBRARIES "C:\\Python27\\libs")
> FIND_PACKAGE(PythonLibs)
> 
> Still get the errors:
> 
> Could NOT find PythonLibs  (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
> CMake Error: The following variables are used in this project, but
> they are set to NOTFOUND.
> Please set them or make sure they are set and tested correctly in the
> CMake files:
> PYTHON_INCLUDE_DIR (ADVANCED)
>    used as include directory in directory D:/test_swig/cmake_swig
> PYTHON_LIBRARY (ADVANCED)
>     linked by target "_scalar_vector_matrix" in directory
> D:/test_swig/cmake_swig
> 
> Could you please tell my why I still got this error after setting
> PYTHON_INCLUDE_DIRS and PYTHON_LIBRARIES?
> 
> Thanks,
> Richie
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 
> 
>  Click
> https://www.mailcontrol.com/sr/QR6!d3p8FaDTndxI!oX7Umg7i2cqMKDpqtYQ2QUoGuWZLX
> 0MCsyBHR3iE!E9p78q8o!I4OToXnBPZmPPpGmKJg==  to report this email as spam.


More information about the CMake mailing list