python và python3 được cài đặt trong OS X Yosemite qua Homebrew, nhưng cmake thất bại trong việc tìm PythonLibs 3, chỉ 2:OS X cmake không thể tìm thấy PythonLibs 3.4
CMakeLists.txt:
set(Python_ADDITIONAL_VERSIONS 3.4)
FIND_PACKAGE(PythonInterp REQUIRED)
FIND_PACKAGE(PythonLibs 3.4 REQUIRED)
get:
-- Found PythonInterp: /usr/local/bin/python3.4 (found suitable version "3.4.3", minimum required is "3.4")
-- Found PythonLibs: /usr/lib/libpython3.4.dylib (found version "2.7.6"
CMakeLi sts.txt:
set(Python_ADDITIONAL_VERSIONS 3.4)
FIND_PACKAGE(PythonInterp 3.4 REQUIRED)
FIND_PACKAGE(PythonLibs 3.4 REQUIRED)
get:
Could NOT find PythonLibs: Found unsuitable version "2.7.6", but required
is at least "3.4" (found PYTHON_LIBRARY-NOTFOUND)
Sau đó, tôi thêm này để cmake danh sách:
INCLUDE_DIRECTORIES(/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib)
INCLUDE_DIRECTORIES(/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/include/python3.4m)
và thậm chí sao chép thư mục đó để /usr/lib
, và sau đó got:
Could NOT find PythonLibs: Found unsuitable version "2.7.6", but required
is at least "3.4" (found /usr/lib/libpython3.4.dylib)
trông có vẻ lạ.
cùng một vấn đề với cmake trên Windows, đặc biệt dòng này là một thông báo lỗi ngu ngốc: '(tìm thấy phiên bản phù hợp "3.4 .3 ", yêu cầu tối thiểu là" 3.4 ")' – dashesy