-
Notifications
You must be signed in to change notification settings - Fork 11
Fix cmake #39
base: develop
Are you sure you want to change the base?
Conversation
CMakeLists.txt
Outdated
if (${CMAKE_VERSION} VERSION_LESS "3.13.3") | ||
find_package(PythonInterp) | ||
set(Python_Interpreter_FOUND ${PYTHONINTERP_FOUND}) | ||
set(Python_EXECUTABLE ${Python_EXECUTABLE}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment is not required in this case or you mean PYTHON_EXECUTABLE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it was supposed to be all uppercase.
CMakeLists.txt
Outdated
|
||
if (PYTHON_PLUGIN) | ||
if (NOT ${PYTHON_VERISON_MAJOR} EQUAL ${OpenCV_VERSION_MAJOR}) | ||
message(WARNING "Python version " ${PYTHON_VERSION_MAJOR} " incompatible with OpenCV version " ${OpenCV_VERSION_MAJOR}) | ||
if (${Python_VERISON_MAJOR} LESS ${OpenCV_VERSION_MAJOR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in Python_VERISON_MAJOR, should be Python_VERSION_MAJOR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
Bumping cmake version to 3.13.3 allows usage of
find_package(Python COMPONENTS Interpreter Development NumPy)
which is superior to previous methods. Eliminates need for additional FindNumpy module and solves problem of python version 2/3 mismatch.It should work theoretically, but it finds python2.6 over 3.4 on my docker so I don't have successful proof.
Sources: https://cmake.org/cmake/help/v3.13/module/FindPython.html