From fb5679efcb15bf98f9ab8f709e769d172b3ffb92 Mon Sep 17 00:00:00 2001 From: maier Date: Sun, 22 Dec 2013 17:03:18 +0000 Subject: [PATCH] CMake: Add support for bzip2. git-svn-id: https://svn.dealii.org/trunk@32096 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/bundled/CMakeLists.txt | 12 ++---- .../cmake/configure/configure_1_bzip2.cmake | 36 ++++++++++++++++ ...gure_zlib.cmake => configure_1_zlib.cmake} | 0 deal.II/cmake/configure/configure_boost.cmake | 7 --- deal.II/include/deal.II/base/config.h.in | 43 ++++++++++++++----- 5 files changed, 73 insertions(+), 25 deletions(-) create mode 100644 deal.II/cmake/configure/configure_1_bzip2.cmake rename deal.II/cmake/configure/{configure_zlib.cmake => configure_1_zlib.cmake} (100%) diff --git a/deal.II/bundled/CMakeLists.txt b/deal.II/bundled/CMakeLists.txt index f2891f1d71..f1ab6bc839 100644 --- a/deal.II/bundled/CMakeLists.txt +++ b/deal.II/bundled/CMakeLists.txt @@ -32,17 +32,13 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED) "${BOOST_FOLDER}/include\n" ) - ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/iostreams/src) ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/serialization/src) + IF(DEAL_II_WITH_ZLIB AND DEAL_II_WITH_BZIP2) + ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/iostreams/src) + ENDIF() + IF(DEAL_II_WITH_THREADS AND NOT DEAL_II_USE_CXX11) - # - # If the C++ compiler doesn't completely support the C++11 standard - # (and consequently we can't use std::thread, std::mutex, etc), then - # include all the files that form BOOST's thread implementation so that - # we don't have to build BOOST itself only to get at this small part of - # it. it also ensures that we use the correct compiler and flags - # ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/thread/src) ENDIF() ENDIF() diff --git a/deal.II/cmake/configure/configure_1_bzip2.cmake b/deal.II/cmake/configure/configure_1_bzip2.cmake new file mode 100644 index 0000000000..61fd319e7e --- /dev/null +++ b/deal.II/cmake/configure/configure_1_bzip2.cmake @@ -0,0 +1,36 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2012 - 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +# +# Configuration for the zlib library: +# + +MACRO(FEATURE_BZIP2_FIND_EXTERNAL var) + + FIND_PACKAGE(BZip2) + + IF(BZIP2_FOUND) + # + # Rename some variables: + # + SET(BZIP2_VERSION ${BZIP2_VERSION_STRING}) + SET(BZIP2_INCLUDE_DIRS ${BZIP2_INCLUDE_DIR}) + + SET(${var} TRUE) + ENDIF() +ENDMACRO() + +CONFIGURE_FEATURE(BZIP2) diff --git a/deal.II/cmake/configure/configure_zlib.cmake b/deal.II/cmake/configure/configure_1_zlib.cmake similarity index 100% rename from deal.II/cmake/configure/configure_zlib.cmake rename to deal.II/cmake/configure/configure_1_zlib.cmake diff --git a/deal.II/cmake/configure/configure_boost.cmake b/deal.II/cmake/configure/configure_boost.cmake index 31983ddcee..de29304bbf 100644 --- a/deal.II/cmake/configure/configure_boost.cmake +++ b/deal.II/cmake/configure/configure_boost.cmake @@ -112,13 +112,6 @@ SET(BOOST_ADD_TO_USER_INCLUDE_DIRS TRUE) MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED) - # - # We need to set some definitions to use the headers of the bundled boost - # library: - # - LIST(APPEND DEAL_II_DEFINITIONS "BOOST_NO_HASH" "BOOST_NO_SLIST") - LIST(APPEND DEAL_II_USER_DEFINITIONS "BOOST_NO_HASH" "BOOST_NO_SLIST") - INCLUDE_DIRECTORIES(${BOOST_FOLDER}/include) ENDMACRO() diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index 6766f7c24e..34c4b9baf9 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -114,6 +114,7 @@ */ #cmakedefine DEAL_II_USE_CXX11 #ifdef DEAL_II_USE_CXX11 +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_CAN_USE_CXX11 # define DEAL_II_CAN_USE_CXX1X #endif @@ -237,6 +238,7 @@ #cmakedefine DEAL_II_WITH_ARPACK #ifdef DEAL_II_WITH_ARPACK +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_USE_ARPACK #endif @@ -246,6 +248,7 @@ #cmakedefine DEAL_II_WITH_FUNCTIONPARSER #ifdef DEAL_II_WITH_FUNCTIONPARSER +/* Compatibility definition (with naming from deal.II < 8.0): */ # define HAVE_FUNCTIONPARSER #endif @@ -255,6 +258,7 @@ #cmakedefine DEAL_II_WITH_HDF5 #ifdef DEAL_II_WITH_HDF5 +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_HAVE_HDF5 #endif @@ -264,6 +268,7 @@ #cmakedefine DEAL_II_WITH_LAPACK #ifdef DEAL_II_WITH_LAPACK +/* Compatibility definition (with naming from deal.II < 8.0): */ # define HAVE_LIBLAPACK /* Defined if the corresponding BLAS or LAPACK function is available */ @@ -315,6 +320,7 @@ #cmakedefine DEAL_II_WITH_METIS #ifdef DEAL_II_WITH_METIS +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_USE_METIS #endif @@ -325,6 +331,7 @@ #cmakedefine DEAL_II_WITH_MPI #ifdef DEAL_II_WITH_MPI +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_COMPILER_SUPPORTS_MPI #endif @@ -335,6 +342,7 @@ #cmakedefine DEAL_II_WITH_MUMPS #ifdef DEAL_II_WITH_MUMPS +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_USE_MUMPS #endif @@ -345,6 +353,7 @@ #cmakedefine DEAL_II_WITH_NETCDF #ifdef DEAL_II_WITH_NETCDF +/* Compatibility definition (with naming from deal.II < 8.0): */ # define HAVE_LIBNETCDF #endif @@ -355,6 +364,7 @@ #cmakedefine DEAL_II_WITH_P4EST #ifdef DEAL_II_WITH_P4EST +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_USE_P4EST # define DEAL_II_P4EST_VERSION_MAJOR @P4EST_VERSION_MAJOR@ @@ -390,6 +400,7 @@ #cmakedefine DEAL_II_WITH_PETSC #ifdef DEAL_II_WITH_PETSC +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_USE_PETSC #endif @@ -438,16 +449,25 @@ #cmakedefine DEAL_II_WITH_SLEPC #ifdef DEAL_II_WITH_SLEPC +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_USE_SLEPC #endif +/*************************************** + * Configured in configure_1_bzip2.cmake: * + ***************************************/ + +#cmakedefine DEAL_II_WITH_BZIP2 + + /******************************************** * Configured in configure_1_threads.cmake: * ********************************************/ #cmakedefine DEAL_II_WITH_THREADS #ifdef DEAL_II_WITH_THREADS +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_USE_MT #endif @@ -474,12 +494,24 @@ #endif +/***************************************** + * Configured in configure_1_zlib.cmake: * + *****************************************/ + +#cmakedefine DEAL_II_WITH_ZLIB +#ifdef DEAL_II_WITH_ZLIB +/* Compatibility definition (with naming from deal.II < 8.0): */ +# define HAVE_LIBZ +#endif + + /******************************************* * Configured in configure_trilinos.cmake: * *******************************************/ #cmakedefine DEAL_II_WITH_TRILINOS #ifdef DEAL_II_WITH_TRILINOS +/* Compatibility definition (with naming from deal.II < 8.0): */ # define DEAL_II_USE_TRILINOS #endif @@ -490,20 +522,11 @@ #cmakedefine DEAL_II_WITH_UMFPACK #ifdef DEAL_II_WITH_UMFPACK +/* Compatibility definition (with naming from deal.II < 8.0): */ # define HAVE_LIBUMFPACK #endif -/*************************************** - * Configured in configure_zlib.cmake: * - ***************************************/ - -#cmakedefine DEAL_II_WITH_ZLIB -#ifdef DEAL_II_WITH_ZLIB -# define HAVE_LIBZ -#endif - - #include #include -- 2.39.5