Does Cmake Support Python3?
I am not able to build a Python wrapper module for my C library via CMake and Swig for Python3. Everything works fine for Python2.x but it looks like CMake cannot find Python3. I a
Solution 1:
Can you make sure your build directory is clean? I had the exact same issue and after cleaning the dir it worked.
Solution 2:
CMake 3.12 should help you with your issue. Citing the release notes:
New “FindPython3” and “FindPython2” modules, as well as a new “FindPython” module, have been added to provide a new way to locate python environments.
Solution 3:
I kind of solved the problem by setting the python version manually. This is not really recommendable but it works for now (note that you have to use your own installation path of the python version you want to use):
SET(PYTHON_INCLUDE_PATH /usr/include/python3.2mu)
SET(PYTHON_LIBRARIES /usr/lib/libpython3.2mu.so)
SET(PYTHON_EXECUTABLE /usr/bin/python3.2mu)
SET(PYTHON_INCLUDE_DIR /usr/include/python3.2mu)
Post a Comment for "Does Cmake Support Python3?"