cmake finds wrong python libs

前端 未结 4 2030

I\'m new to CMake and have trouble understanding some usage concepts.

I\'m calling a python script from a c++ program:

#include 
...
Py_I         


        
4条回答
  •  心在旅途
    2021-02-04 03:36

    The best way to solve the problem that the wrong version is found (for instance 3.0 instead of 2.7) is to specify the minimum version to find_package (this will choose any version >= 2.7):

    FIND_PACKAGE(PythonLibs 2.7 REQUIRED)
    

    or to get the exact version:

    FIND_PACKAGE(PythonLibs 2.7.5 EXACT REQUIRED)
    

提交回复
热议问题