]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move check to configure_boost.cmake
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 25 Oct 2017 15:48:47 +0000 (17:48 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 25 Oct 2017 16:18:26 +0000 (18:18 +0200)
cmake/configure/configure_boost.cmake
cmake/modules/FindBOOST.cmake

index 29ab0c1e5bb8a1ce5a8b5c2dacfd9ae085bf9e13..fc7bbde4eb41fca693496cf80647ae7f1b6357dc 100644 (file)
@@ -79,6 +79,48 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
 
   IF(BOOST_FOUND)
     SET(${var} TRUE)
+
+    IF(DEAL_II_WITH_ZLIB)
+      #
+      # Test that Boost.Iostreams is usuable.
+      #
+      RESET_CMAKE_REQUIRED()
+      PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+      PUSH_CMAKE_REQUIRED("-L${Boost_LIBRARY_DIRS}")
+      SET(CMAKE_REQUIRED_LIBRARIES "-lboost_iostreams")
+      CHECK_CXX_SOURCE_COMPILES(
+        "
+        #include <string>
+        #include <boost/iostreams/device/back_inserter.hpp>
+        #include <boost/iostreams/filter/gzip.hpp>
+        #include <boost/iostreams/filtering_stream.hpp>
+
+        int main()
+        {
+          std::string decompressed_buffer;
+          char test[1] = {'c'};
+
+          boost::iostreams::filtering_ostream decompressing_stream;
+          decompressing_stream.push(boost::iostreams::gzip_decompressor());
+          decompressing_stream.push(boost::iostreams::back_inserter(decompressed_buffer));
+          decompressing_stream.write (test, 1);
+        }
+        "
+        _boost_iostreams_usuable
+        )
+      IF(${_boost_iostreams_usuable})
+        MESSAGE(STATUS "Boost.Iostreams is usuable.")
+      ELSE()
+        MESSAGE(STATUS
+                "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled "
+                "with zlib support but a simple test failed! "
+                "Therefore, the bundled boost package is used."
+               )
+        SET(${var} FALSE)
+      ENDIF()
+      RESET_CMAKE_REQUIRED()
+    ENDIF()
+
   ENDIF()
 ENDMACRO()
 
index 57c35234c9dc0dbcebb170459a41d75cbe05bc8f..5e1bec5e8d8ed24b37eac221336f684e4aca50fb 100644 (file)
@@ -78,51 +78,6 @@ IF(Boost_FOUND)
   SET(BOOST_VERSION
     "${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}.${BOOST_VERSION_SUBMINOR}"
     )
-
-  IF(DEAL_II_WITH_ZLIB)
-    #
-    # Test that Boost.Iostreams is usuable.
-    #
-    RESET_CMAKE_REQUIRED()
-    PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
-    PUSH_CMAKE_REQUIRED("-L${Boost_LIBRARY_DIRS}")
-    SET(CMAKE_REQUIRED_LIBRARIES "-lboost_iostreams")
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <string>
-      #include <boost/iostreams/device/back_inserter.hpp>
-      #include <boost/iostreams/filter/gzip.hpp>
-      #include <boost/iostreams/filtering_stream.hpp>
-
-      int main()
-      {
-        std::string decompressed_buffer;
-        char test[1] = {'c'};
-
-        boost::iostreams::filtering_ostream decompressing_stream;
-        decompressing_stream.push(boost::iostreams::gzip_decompressor());
-        decompressing_stream.push(boost::iostreams::back_inserter(decompressed_buffer));
-        decompressing_stream.write (test, 1);
-      }
-      "
-      DEAL_II_BOOST_IOSTREAMS_USUABLE
-      )
-    MESSAGE(STATUS "${DEAL_II_BOOST_IOSTREAMS_USUABLE}")
-    IF(${DEAL_II_BOOST_IOSTREAMS_USUABLE})
-      MESSAGE(STATUS "Boost.Iostreams is usuable.")
-    ELSE()
-      MESSAGE(STATUS
-              "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled "
-              "with zlib support but a simple test failed! "
-              "Therefore, the bundled boost package is used."
-             )
-      SET(Boost_FOUND FALSE)
-      SET(Boost_LIBRARIES "")
-      SET(Boost_INCLUDE_DIRS "")
-    ENDIF()
-    RESET_CMAKE_REQUIRED()
-  ENDIF()
-
 ENDIF()
 
 DEAL_II_PACKAGE_HANDLE(BOOST

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.