]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Restructure python-bindings CMakeLists.txt files
authorDaniel Arndt <arndtd@ornl.gov>
Sat, 4 Jan 2020 17:31:27 +0000 (18:31 +0100)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 18 Jan 2020 00:16:05 +0000 (17:16 -0700)
contrib/python-bindings/CMakeLists.txt
contrib/python-bindings/source/CMakeLists.txt

index a7e2f53d5eb85372e2627ac666f1df7fcc78228e..884b8322c3ec4d04ce67e9348d060269f5c9b41e 100644 (file)
@@ -18,6 +18,64 @@ IF(DEAL_II_COMPONENT_PYTHON_BINDINGS)
   MESSAGE(STATUS "")
   MESSAGE(STATUS "Setting up python bindings")
 
+  #
+  # Find Python:
+  #
+  INCLUDE(FindPythonInterp)
+  INCLUDE(FindPythonLibs)
+
+  IF(FEATURE_BOOST_BUNDLED_CONFIGURED)
+    MESSAGE(FATAL_ERROR
+      "DEAL_II_COMPONENT_PYTHON_BINDINGS has unmet configuration requirements: "
+      "Python bindings require an external boost library, but deal.II was "
+      "configured with bundled boost."
+      )
+  ENDIF()
+
+  #
+  # As of 1.67, boost requires specifying the suffix for the python
+  # component manually.
+  #
+  UNSET(Boost_FOUND)
+  IF(${BOOST_VERSION} VERSION_LESS 1.67)
+    _FIND_PACKAGE(Boost 1.59 COMPONENTS python REQUIRED)
+  ELSE()
+    _FIND_PACKAGE(Boost 1.67 COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED)
+  ENDIF()
+
+  IF(NOT Boost_FOUND)
+    MESSAGE(FATAL_ERROR
+      "DEAL_II_COMPONENT_PYTHON_BINDINGS has unmet configuration requirements: "
+      "The external boost library does not provide Boost.Python"
+      )
+  ENDIF()
+
+  #
+  # FIXME: Once finalized, reconsider moving this definitions into
+  # cmake/setup_dealii.cmake
+  #
+  # General information about deal.II:
+  #
+  #     PYTHON_BINDINGS_BASE_NAME       *)
+  #     PYTHON_BINDINGS_DEBUG_NAME      *)
+  #     PYTHON_BINDINGS_RELEASE_NAME    *)
+  #
+  # Information about paths, install locations and names:
+  #
+  #     DEAL_II_PYTHON_RELDIR           *) **)
+  #
+  # *)  Can be overwritten by the command line via -D<...>
+  # **) We do a best effort guess on site-packages location...
+  #
+
+  SET_IF_EMPTY(PYTHON_BINDINGS_BASE_NAME "PyDealII")
+  SET_IF_EMPTY(PYTHON_BINDINGS_DEBUG_NAME "Debug")
+  SET_IF_EMPTY(PYTHON_BINDINGS_RELEASE_NAME "Release")
+
+  SET_IF_EMPTY(DEAL_II_PYTHON_RELDIR
+    "${DEAL_II_LIBRARY_RELDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/${PYTHON_BINDINGS_BASE_NAME}"
+    )
+
   ADD_SUBDIRECTORY(source)
 
   MESSAGE(STATUS "Setting up python bindings - Done")
index a76c202ee943b595bd5fe2a2a5c78df0f7bfe186..5dd35adcc80d6901ce5fbd0e34f81423c0f0c99a 100644 (file)
 ##
 ## ---------------------------------------------------------------------
 
-#
-# Find Python:
-#
-
-INCLUDE(FindPythonInterp)
-INCLUDE(FindPythonLibs)
-
-IF(FEATURE_BOOST_BUNDLED_CONFIGURED)
-  MESSAGE(FATAL_ERROR
-    "DEAL_II_COMPONENT_PYTHON_BINDINGS has unmet configuration requirements: "
-    "Python bindings require an external boost library, but deal.II was "
-    "configured with bundled boost."
-    )
-ENDIF()
-
-#
-# As of 1.67, boost requires specifying the suffix for the python
-# component manually.
-#
-UNSET(Boost_FOUND)
-IF(${BOOST_VERSION} VERSION_LESS 1.67)
-  _FIND_PACKAGE(Boost 1.59 COMPONENTS python REQUIRED)
-ELSE()
-  _FIND_PACKAGE(Boost 1.67 COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED)
-ENDIF()
-
-IF(NOT Boost_FOUND)
-  MESSAGE(FATAL_ERROR
-    "DEAL_II_COMPONENT_PYTHON_BINDINGS has unmet configuration requirements: "
-    "The external boost library does not provide Boost.Python"
-    )
-ENDIF()
-
-#
-# FIXME: Once finalized, reconsider moving this definitions into
-# cmake/setup_dealii.cmake
-#
-# General information about deal.II:
-#
-#     PYTHON_BINDINGS_BASE_NAME       *)
-#     PYTHON_BINDINGS_DEBUG_NAME      *)
-#     PYTHON_BINDINGS_RELEASE_NAME    *)
-#
-# Information about paths, install locations and names:
-#
-#     DEAL_II_PYTHON_RELDIR           *) **)
-#
-# *)  Can be overwritten by the command line via -D<...>
-# **) We do a best effort guess on site-packages location...
-#
-
-SET_IF_EMPTY(PYTHON_BINDINGS_BASE_NAME "PyDealII")
-SET_IF_EMPTY(PYTHON_BINDINGS_DEBUG_NAME "Debug")
-SET_IF_EMPTY(PYTHON_BINDINGS_RELEASE_NAME "Release")
-
-SET_IF_EMPTY(DEAL_II_PYTHON_RELDIR
-  "${DEAL_II_LIBRARY_RELDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/${PYTHON_BINDINGS_BASE_NAME}"
-  )
-
 INCLUDE_DIRECTORIES(
   ${CMAKE_BINARY_DIR}/include/
   ${CMAKE_SOURCE_DIR}/include/

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.