]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Keep compatibility
authoragrayver <agrayver@erdw.ethz.ch>
Mon, 28 Oct 2019 12:44:37 +0000 (13:44 +0100)
committeragrayver <agrayver@erdw.ethz.ch>
Mon, 28 Oct 2019 12:44:37 +0000 (13:44 +0100)
contrib/python-bindings/source/CMakeLists.txt

index dceed12782792f15108ca3456bbe6046641aa5b3..d774d0ac5eb48fcd491531f2fe28fa8405e59c1b 100644 (file)
@@ -29,14 +29,22 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED)
 ENDIF()
 
 #
-# Unset Boost_Found and run the low level FindBOOST.cmake module again to
-# pick up libboost_python.so
+# As of 1.67, boost requires specifying the suffix for the python 
+# component manually. 
 #
-LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
-SET(Boost_FOUND)
-# Use the low level _FIND_PACKAGE function instead of our wrapper
-_FIND_PACKAGE(Boost 1.59 COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED)
-LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
+IF(${BOOST_VERSION} VERSION_LESS 1.67)
+  #
+  # Unset Boost_Found and run the low level FindBOOST.cmake module again to
+  # pick up libboost_python.so
+  #
+  LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
+  SET(Boost_FOUND)
+  # Use the low level _FIND_PACKAGE function instead of our wrapper
+  _FIND_PACKAGE(Boost 1.59 COMPONENTS python REQUIRED)
+  LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
+ELSE()
+  _FIND_PACKAGE(Boost 1.67 COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED)
+ENDIF()
 
 IF(NOT Boost_FOUND)
   MESSAGE(FATAL_ERROR

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.