at master 2.7 kB view raw
1commit b14ca23651d390fcae4a929dedc7c33a83453a66 2Author: Frederik Rietdijk <fridh@fridh.nl> 3Date: Sun Feb 17 08:41:27 2019 +0100 4 5 Find boost_pythonXX 6 7diff --git a/CMakeLists.txt b/CMakeLists.txt 8index 08f56a33..0a04592a 100644 9--- a/CMakeLists.txt 10+++ b/CMakeLists.txt 11@@ -99,10 +99,10 @@ add_subdirectory(docs) 12 add_custom_target(lint COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lint.cmake) 13 14 # ---[ pytest target 15-if(BUILD_python) 16- add_custom_target(pytest COMMAND python${python_version} -m unittest discover -s caffe/test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python ) 17- add_dependencies(pytest pycaffe) 18-endif() 19+# if(BUILD_python) 20+# add_custom_target(pytest COMMAND python${python_version} -m unittest discover -s caffe/test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python ) 21+# add_dependencies(pytest pycaffe) 22+# endif() 23 24 # ---[ uninstall target 25 configure_file( 26diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake 27index 4a5bac47..be026d43 100644 28--- a/cmake/Dependencies.cmake 29+++ b/cmake/Dependencies.cmake 30@@ -141,37 +141,14 @@ if(BUILD_python) 31 # use python3 32 find_package(PythonInterp 3.0) 33 find_package(PythonLibs 3.0) 34- find_package(NumPy 1.7.1) 35- # Find the matching boost python implementation 36- set(version ${PYTHONLIBS_VERSION_STRING}) 37- 38- STRING( REGEX REPLACE "[^0-9]" "" boost_py_version ${version} ) 39- find_package(Boost 1.46 COMPONENTS "python-py${boost_py_version}") 40- set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND}) 41- 42- while(NOT "${version}" STREQUAL "" AND NOT Boost_PYTHON_FOUND) 43- STRING( REGEX REPLACE "([0-9.]+).[0-9]+" "\\1" version ${version} ) 44- 45- STRING( REGEX REPLACE "[^0-9]" "" boost_py_version ${version} ) 46- find_package(Boost 1.46 COMPONENTS "python-py${boost_py_version}") 47- set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND}) 48- 49- STRING( REGEX MATCHALL "([0-9.]+).[0-9]+" has_more_version ${version} ) 50- if("${has_more_version}" STREQUAL "") 51- break() 52- endif() 53- endwhile() 54- if(NOT Boost_PYTHON_FOUND) 55- find_package(Boost 1.46 COMPONENTS python) 56- endif() 57 else() 58 # disable Python 3 search 59 find_package(PythonInterp 2.7) 60 find_package(PythonLibs 2.7) 61- find_package(NumPy 1.7.1) 62- find_package(Boost 1.46 COMPONENTS python) 63 endif() 64- if(PYTHONLIBS_FOUND AND NUMPY_FOUND AND Boost_PYTHON_FOUND) 65+ find_package(NumPy 1.7.1) 66+ find_package(Boost 1.46 REQUIRED COMPONENTS python@major@@minor@) 67+ if(PYTHONLIBS_FOUND AND NUMPY_FOUND AND Boost_PYTHON@major@@minor@_FOUND) 68 set(HAVE_PYTHON TRUE) 69 if(BUILD_python_layer) 70 list(APPEND Caffe_DEFINITIONS PRIVATE -DWITH_PYTHON_LAYER)