#
# This file sets up the project configuration consisting of
#
-# Make.global_options (legacy)
# deal.IIConfig.cmake
# deal.IIVersionConfig.cmake
#
#
CONFIGURE_FILE( # for binary dir:
${CMAKE_CURRENT_SOURCE_DIR}/template-arguments.in
- ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
+ ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/template-arguments
)
ENDIF()
ENDFOREACH()
-
-########################################################################
-# #
-# Configure and install the old Makefile configuration: #
-# #
-########################################################################
-
-IF(DEAL_II_COMPONENT_COMPAT_FILES)
- #
- # Transform some cmake lists into a string that the old Makefile
- # mechanism actually understands:
- #
-
- FOREACH(build ${DEAL_II_BUILD_TYPES})
-
- TO_STRING_AND_ADD_PREFIX(MAKEFILE_DEFINITIONS_${build}
- "-D"
- ${DEAL_II_USER_DEFINITIONS}
- ${DEAL_II_USER_DEFINITIONS_${build}}
- )
-
- #
- # Ideally, DEAL_II_EXTERNAL_LIBRARIES should just contain a list of
- # full library paths. Nevertheless, filter out all elements that are
- # not a full path starting with "/" or that happen to be a "framework"
- # - we won't deal with that in Make.global_options.
- #
-
- SET(_libs)
- FOREACH(_lib
- ${DEAL_II_LIBRARIES_${build}}
- ${DEAL_II_LIBRARIES}
- )
- IF(_lib MATCHES "^\\s*\\/" AND NOT _lib MATCHES "\\.framework$")
- LIST(APPEND _libs "${_lib}")
- ENDIF()
- ENDFOREACH()
-
- TO_STRING(MAKEFILE_TARGETS_${build}
- $(D)/${DEAL_II_LIBRARY_RELDIR}/${CONFIG_LIBRARY_${build}}
- ${_libs}
- )
-
- SET(_paths)
- FOREACH(_lib
- $(D)/${DEAL_II_LIBRARY_RELDIR}/${CONFIG_LIBRARY_${build}}
- ${DEAL_II_LIBRARIES_${build}}
- ${DEAL_II_LIBRARIES}
- )
-
- #
- # Strip leading and trailing whitespace
- #
- STRING(STRIP "${_lib}" _lib)
-
- IF(_lib MATCHES "^\\/.*\\.framework$")
- #
- # We have a MacOSX framework
- #
- # TODO: What do?
- #
-
- ELSEIF(_lib MATCHES "^(\\/|\\$\\(D\\))")
- #
- # Full path: /path/to/libfoo.(so|dylib|etc):
- #
-
- # Extract library paths:
- GET_FILENAME_COMPONENT(_path ${_lib} PATH)
- LIST(APPEND _paths ${_path})
-
- LIST(APPEND MAKEFILE_LIBS_${build} ${_lib})
-
- ELSEIF(_lib MATCHES "^-l")
- #
- # Library is of the form "-lfoo":
- #
- LIST(APPEND MAKEFILE_LIBS_${build} ${_lib})
-
- ELSEIF(NOT _lib MATCHES "^\\s*$" AND NOT _lib MATCHES "\\.so(\\.[0-9]+)*$")
- #
- # Well in this case we just assume that we have to append a "-l"
- #
-
- LIST(APPEND MAKEFILE_LIBS_${build} "-l${_lib}")
-
- ELSE()
- #
- # For now, ignore the rest.
- #
- # TODO: What do?
- #
- ENDIF()
-
- ENDFOREACH()
-
- #
- # And build up an rpath:
- #
- SET(_rpath "")
- LIST(REMOVE_DUPLICATES _paths)
- FOREACH(_path ${_paths})
- SET(_rpath "${_rpath} -Wl,-rpath,${_path}")
- ENDFOREACH()
-
- TO_STRING(MAKEFILE_LIBS_${build} ${MAKEFILE_LIBS_${build}} ${_rpath})
-
- #
- # Set up our linker flags:
- #
- SET(MAKEFILE_LDFLAGS_${build}
- "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}} ${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${build}}"
- )
- ENDFOREACH()
-
- #
- # Boilerplate: The Make.global_options expects variables to be set to
- # yes, as is common for Makefiles.
- #
- COND_SET_TO_YES(DEAL_II_WITH_THREADS MAKEFILE_enablethreads)
- COND_SET_TO_YES(DEAL_II_WITH_MUPARSER MAKEFILE_enableparser)
- COND_SET_TO_YES(BUILD_SHARED_LIBS MAKEFILE_enableshared)
-
- COND_SET_TO_YES(DEAL_II_WITH_ARPACK MAKEFILE_ARPACK)
- COND_SET_TO_YES(DEAL_II_WITH_BLAS MAKEFILE_BLAS)
- COND_SET_TO_YES(DEAL_II_WITH_HDF5 MAKEFILE_HDF5)
- COND_SET_TO_YES(DEAL_II_WITH_LAPACK MAKEFILE_LAPACK)
- COND_SET_TO_YES(DEAL_II_WITH_METIS MAKEFILE_METIS)
- COND_SET_TO_YES(DEAL_II_WITH_MPI MAKEFILE_MPI)
- COND_SET_TO_YES(DEAL_II_WITH_OPENCASCADE MAKEFILE_OPENCASCADE)
- COND_SET_TO_YES(DEAL_II_WITH_P4EST MAKEFILE_P4EST)
- COND_SET_TO_YES(DEAL_II_WITH_PETSC MAKEFILE_PETSC)
- COND_SET_TO_YES(DEAL_II_WITH_SLEPC MAKEFILE_SLEPC)
- COND_SET_TO_YES(DEAL_II_WITH_TRILINOS MAKEFILE_TRILINOS)
- COND_SET_TO_YES(DEAL_II_WITH_UMFPACK MAKEFILE_UMFPACK)
-
- #
- # For binary dir:
- #
- SET(MAKEFILE_D ${CMAKE_BINARY_DIR})
- TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS "${CMAKE_INCLUDE_FLAG_CXX}"
- $(D)/install
- $(D)/install/deal.II
- ${CMAKE_SOURCE_DIR}/include/
- ${CMAKE_SOURCE_DIR}/include/deal.II
- ${DEAL_II_BUNDLED_INCLUDE_DIRS}
- ${DEAL_II_USER_INCLUDE_DIRS}
- )
- CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/Make.global_options.in
- ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/Make.global_options
- )
- #
- # For installation:
- #
- SET(MAKEFILE_D ${CMAKE_INSTALL_PREFIX})
- TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS "${CMAKE_INCLUDE_FLAG_CXX}"
- $(D)/${DEAL_II_INCLUDE_RELDIR}
- $(D)/${DEAL_II_INCLUDE_RELDIR}/deal.II
- $(D)/${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled
- ${DEAL_II_USER_INCLUDE_DIRS}
- )
- CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/Make.global_options.in
- ${CMAKE_CURRENT_BINARY_DIR}/Make.global_options
- )
- INSTALL(FILES
- ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
- ${CMAKE_CURRENT_BINARY_DIR}/Make.global_options
- DESTINATION ${DEAL_II_COMMON_RELDIR}
- COMPONENT compat_files
- )
-ENDIF()
-
MESSAGE(STATUS "Setting up project configuration - Done")
#
SET(DEAL_II_CMAKE_MACROS_RELDIR "@DEAL_II_CMAKE_MACROS_RELDIR@")
-SET(DEAL_II_COMMON_RELDIR "@DEAL_II_COMMON_RELDIR@")
+SET(DEAL_II_SHARE_RELDIR "@DEAL_II_SHARE_RELDIR@")
SET(DEAL_II_DOCREADME_RELDIR "@DEAL_II_DOCREADME_RELDIR@")
SET(DEAL_II_DOCHTML_RELDIR "@DEAL_II_DOCHTML_RELDIR@")
SET(DEAL_II_EXAMPLES_RELDIR "@DEAL_II_EXAMPLES_RELDIR@")
+++ /dev/null
-## ---------------------------------------------------------------------
-##
-## Copyright (C) 2012 - 2015 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.
-##
-## ---------------------------------------------------------------------
-
-
-#
-# Please note:
-#
-# This is a compatibility Make.global_options file generated by CMake
-# from the ./cmake/config/Make.global_options.in file.
-#
-
-
-D = @MAKEFILE_D@
-
-CXX = @CMAKE_CXX_COMPILER@
-CXX-ID = @CMAKE_CXX_COMPILER_ID@
-CXX-VERSION = @CMAKE_CXX_COMPILER_VERSION@
-SHLIBLD = @CMAKE_CXX_COMPILER@
-SHLIBFLAGS = @CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS@
-
-ifeq ($(debug-mode), on)
- LDFLAGS = @MAKEFILE_LDFLAGS_DEBUG@
- LIBS = @MAKEFILE_LIBS_DEBUG@
-else
- LDFLAGS = @MAKEFILE_LDFLAGS_RELEASE@
- LIBS = @MAKEFILE_LIBS_RELEASE@
-endif
-
-LIBDIR = $(D)/@DEAL_II_LIBRARY_RELDIR@
-
-enable-threads = @MAKEFILE_enablethreads@
-enable-shared = @MAKEFILE_enableshared@
-enable-parser = @MAKEFILE_enableparser@
-DEAL_II_VERSION = @DEAL_II_PACKAGE_VERSION@
-DEAL_II_MAJOR = @DEAL_II_VERSION_MAJOR@
-DEAL_II_MINOR = @DEAL_II_VERSION_MINOR@
-DEAL_II_SUBMINOR = @DEAL_II_VERSION_SUBMINOR@
-
-PERL = perl
-
-
-USE_CONTRIB_PETSC = @MAKEFILE_PETSC@
-USE_CONTRIB_SLEPC = @MAKEFILE_SLEPC@
-USE_CONTRIB_TRILINOS = @MAKEFILE_TRILINOS@
-USE_CONTRIB_HDF5 = @MAKEFILE_HDF5@
-USE_CONTRIB_BLAS = @MAKEFILE_BLAS@
-USE_CONTRIB_LAPACK = @MAKEFILE_LAPACK@
-USE_CONTRIB_ARPACK = @MAKEFILE_ARPACK@
-USE_CONTRIB_METIS = @MAKEFILE_METIS@
-USE_CONTRIB_UMFPACK = @MAKEFILE_UMFPACK@
-USE_CONTRIB_P4EST = @MAKEFILE_P4EST@
-USE_CONTRIB_OPENCASCADE = @MAKEFILE_OPENCASCADE@
-DEAL_II_USE_MPI = @MAKEFILE_MPI@
-
-OBJEXT = o
-EXEEXT =
-
-shared-lib-suffix = .so
-static-lib-suffix = .a
-
-ifeq ($(enable-shared),yes)
- lib-suffix = $(shared-lib-suffix)
-else
- lib-suffix = $(static-lib-suffix)
-endif
-
-
-# set paths to all the libraries we need:
-lib-deal2.o = @MAKEFILE_TARGETS_RELEASE@
-lib-deal2.g = @MAKEFILE_TARGETS_DEBUG@
-
-
-# Include paths as command line flags
-INCLUDE = @MAKEFILE_INCLUDE_DIRS@
-
-
-# compiler flags for debug and optimized mode
-CXXFLAGS.g = @DEAL_II_CXX_FLAGS@ @DEAL_II_CXX_FLAGS_DEBUG@ @MAKEFILE_DEFINITIONS@ @MAKEFILE_DEFINITIONS_DEBUG@ $(INCLUDE)
-CXXFLAGS.o = @DEAL_II_CXX_FLAGS@ @DEAL_II_CXX_FLAGS_RELEASE@ @MAKEFILE_DEFINITIONS@ @MAKEFILE_DEFINITIONS_RELEASE@ $(INCLUDE)
-
-ifeq ($(enable-threads),yes)
- MT = MT
-else
- MT = ==
-endif
-
# Everything seems to be okay. Launch a terminal with PATH's
# set up to work with deal.II.
-CONF=$DEAL_II_RESOURCES/@DEAL_II_COMMON_RELDIR@/dealii.conf
+CONF=$DEAL_II_RESOURCES/@DEAL_II_SHARE_RELDIR@/dealii.conf
if ! [[ -f $CONF ]]; then
return=`/usr/bin/osascript <<EOF
these lines to your ~/.profile file (the first line turns off this message):
export DEAL_II_CONF_SILENT=ON
- . $DEAL_II_RESOURCES/@DEAL_II_COMMON_RELDIR@/dealii.conf
+ . $DEAL_II_RESOURCES/@DEAL_II_SHARE_RELDIR@/dealii.conf
EOF
fi
else
export DEAL_II_BUNDLE=`echo "$BASH_SOURCE" | sed -e 's|/Contents/MacOS/.*||'`
export DEAL_II_RESOURCES=$DEAL_II_BUNDLE/Contents/Resources
- source $DEAL_II_RESOURCES/@DEAL_II_COMMON_RELDIR@/dealii.conf
+ source $DEAL_II_RESOURCES/@DEAL_II_SHARE_RELDIR@/dealii.conf
fi
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}
DEPENDS ${_dependency}
- ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
+ ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/template-arguments
${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file}
COMMAND ${_command}
- ARGS ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
+ ARGS ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/template-arguments
< ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file}
> ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}
)
## ---------------------------------------------------------------------
##
-## Copyright (C) 2012 - 2014 by the deal.II authors
+## Copyright (C) 2012 - 2015 by the deal.II authors
##
## This file is part of the deal.II library.
##
## ---------------------------------------------------------------------
ADD_EXECUTABLE(expand_instantiations_exe expand_instantiations.cc)
-SET_TARGET_PROPERTIES(expand_instantiations_exe
- PROPERTIES OUTPUT_NAME expand_instantiations
+SET_TARGET_PROPERTIES(expand_instantiations_exe PROPERTIES
+ OUTPUT_NAME expand_instantiations
+ RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}
)
-
-IF(DEAL_II_COMPONENT_COMPAT_FILES)
- MESSAGE(STATUS "Setting up compat_files")
-
- #
- # Also build and install the old dependency_resolution executable:
- #
-
- ADD_EXECUTABLE(make_dependencies make_dependencies.cc)
-
- ADD_DEPENDENCIES(compat_files
- expand_instantiations_exe
- make_dependencies
- )
-
- SET_TARGET_PROPERTIES(expand_instantiations_exe make_dependencies
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/scripts
- )
- INSTALL(TARGETS expand_instantiations_exe make_dependencies
- DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts
- COMPONENT compat_files
- )
- MESSAGE(STATUS "Setting up compat_files - Done")
-ENDIF()
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2003 - 2014 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.
-//
-// ---------------------------------------------------------------------
-
-
-// Make a dependency file tree
-// usage: make_depencies -Iinc_path1 -Iinc_path2 ... -Bbasepath files
-
-// This program is basically a replacement for something like "gcc
-// -M", i.e. it generates for each input file a list of other files it
-// depends on by direct or indirect inclusion (or at least those files
-// that can be found in the directories specified by -I/path/.../
-// flags on the command line). The difference to gcc -M is that it is
-// much faster, since it doesn't really do much parsing except for
-// finding those lines that have a #include at the beginning
-//
-// The output looks like this:
-//
-// $basepath/.o-file $basepath/.g.o-file: file included_files
-//
-// $basepath is the dir where the object files are to be placed (as
-// given by the -B parameter to this script). if no path is given, no
-// path is printed. if one is given, a slash is appended if necessary
-
-// If the -n (for "new-style") flag is passed, then the output format
-// $basepath/optimized/.o-file $basepath/debug/.o-file: file included_files
-// is used.
-
-// Author: Wolfgang Bangerth, 2003 (and based on a previous perl
-// script written 1998, 1999, 2000, 2001, 2002)
-
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <map>
-#include <set>
-#include <vector>
-#include <cassert>
-#include <cstdlib>
-#include <sys/stat.h>
-
-// base path for object files, including trailing slash if non-empty
-std::string basepath;
-
-// list of include directories
-std::vector<std::string> include_directories;
-
-// for each file that we ever visit, store the set of other files it
-// includes directly
-std::map<std::string,std::set<std::string> > direct_includes;
-
-// A variable that stores whether we want old-style or new-style format
-enum Format
-{
- old_style, new_style
-} format;
-
-
-bool file_exists(const std::string &file)
-{
- struct stat buf;
- int error = stat (file.c_str(), &buf);
-
- return ((error == 0) &&
- ((buf.st_mode & S_IFMT) == S_IFREG));
-}
-
-
-// for the given file, fill a respective entry in the "direct_includes" map
-// listing the names of those files that are directly included
-void determine_direct_includes (const std::string &file)
-{
- // if this file has already been treated, then leave it at this
- if (direct_includes.find (file) != direct_includes.end())
- return;
-
- // otherwise, open the file and go through it line by line to search for
- // other includes. we will have to have the path to the present file
- // later, so get it already here
- std::string present_path;
- if (file.find ('/') != std::string::npos)
- present_path = std::string (file.begin(),
- file.begin()+file.rfind ('/')+1);
-
- std::ifstream in(file.c_str());
- // If the file does not exist, for instance an ".inst" file which will be
- // generated by make later, just return from this function.
- //
- // As a result, non-existing files are expected to have no dependencies.
- if (! ((bool)in))
- return;
-
- std::string line;
- while (in)
- {
- // get one line, eat whitespace at the beginning and see whether the
- // first non-whitespace is a # character
- getline (in, line);
- unsigned int pos=0;
- for (; pos<line.length(); ++pos)
- if ((line[pos] != ' ') && (line[pos] != '\t'))
- break;
-
- // if no non-whitespace, or something other than #: next line
- if ((pos == line.length()) || (line[pos] != '#'))
- continue;
-
- // ok, this is a preprocessor line. eat pound sign and again the next
- // couple of whitespaces
- ++pos;
- for (; pos<line.length(); ++pos)
- if ((line[pos] != ' ') && (line[pos] != '\t'))
- break;
-
- // and let's see whether the following is the word include
- if ((line.length() < pos+7)
- ||
- (! ((line[pos+0] == 'i') &&
- (line[pos+1] == 'n') &&
- (line[pos+2] == 'c') &&
- (line[pos+3] == 'l') &&
- (line[pos+4] == 'u') &&
- (line[pos+5] == 'd') &&
- (line[pos+6] == 'e'))))
- continue;
-
- // ok, word found. advance pos and eat more whitespace
- pos += 7;
- for (; pos<line.length(); ++pos)
- if ((line[pos] != ' ') && (line[pos] != '\t'))
- break;
-
- // check that the next char is either '<' or '"'
- if ((line[pos] != '"') && (line[pos] != '<'))
- continue;
-
- // copy out name
- std::string included_file;
- for (unsigned int endpos=pos+1; endpos<line.length(); ++endpos)
- if ((line[endpos]=='"') || (line[endpos] == '>'))
- {
- included_file = std::string (line.begin()+pos+1,
- line.begin()+endpos);
- break;
- }
- if (included_file.length() == 0)
- {
- std::cerr << "Include file name empty in file <" << file << "> line: " << std::endl
- << line << std::endl;
- std::abort();
- }
-
-
- bool is_inst_file =
- included_file.size()>5
- && (included_file.rfind(".inst") == (included_file.size()-5));
-
- // .inst files are always relative to the current path. We need a
- // special case, because they might not exist at this point and the
- // next block checks the files for existence.
- if (is_inst_file)
- included_file = present_path+included_file;
-
-
- // next try to locate the file in absolute paths. For includes of the
- // form #include "...", we check the current path first.
- if (included_file[0] != '/' && !is_inst_file)
- {
- bool is_relative_path = false;
- if (line[pos] == '"' && file_exists(present_path+included_file))
- {
- included_file = present_path+included_file;
- is_relative_path = true;
- }
-
- if (is_relative_path == false)
- for (std::vector<std::string>::const_iterator
- include_dir=include_directories.begin();
- include_dir!=include_directories.end(); ++include_dir)
- {
- if (file_exists((*include_dir+included_file)))
- {
- included_file = *include_dir+included_file;
- break;
- }
- }
- }
-
- // make sure the file exists and that we can read from it, otherwise
- // just ignore the line
-
- // If this is an ".inst" file, it will be generated by make later, so
- // we better keep it on the list.
-
- if (line[pos] != '"' || !is_inst_file)
- {
- if (!file_exists(included_file))
- continue;
- }
-
-
-
- // ok, so we did find an appropriate file. add it to the correct list
- direct_includes[file].insert (included_file);
-
- // work on the include file recursively. note that the first line of
- // this function saves us from infinite recursions in case of include
- // loops
- determine_direct_includes (included_file);
- }
-}
-
-
-
-
-// return the set of all included files, directly or indirectly, for the
-// given file. for this purpose, we consider the direct_includes variable
-// to be a representation of a directed graph: given a file (a node in the
-// graph), the elements of the include-set for this file are outgoing edges
-// from this node. to get at all includes, direct and indirect, we keep a
-// list starting with the direct includes, the collect all direct includes
-// of the files in the list, then their include files, etc. We thus march
-// in fronts through the graph.
-//
-// one of the complications we have to keep track of is that the graph may
-// be cyclic (i.e. header files include each other mutually -- in the real
-// program, one of the includes will be guarded by preprocessor #ifdefs,
-// but we don't see them here), so we have to make sure we strip elements
-// from the present front that we have already visited before
-//
-// this function could presumably be made more efficient in the following
-// way: when we have more than one file for which we want to compute
-// dependencies, we presently walk through the graph for each of them.
-// however, they will likely have one or more includes in common, so they
-// will also have parts of the dependency graph in common. if we could
-// precompute the dependency graph for include files in advance, we
-// wouldn't have to walk through _all_ the graph for each file we consider,
-// but could just draw in blocks. the problem with that is that to make
-// this efficient we cannot just compute the whole set of dependencies for
-// _each_ file, but we have to do this on the fly and to avoid again
-// problems with the cyclic nature we have to keep track where we are
-// presently coming from. that's way too complicated for now and I leave it
-// to times when dependency generation becomes again a noticable time hit
-//
-// one of the ideas to solve this problem would be to start at terminal
-// nodes of the graph (i.e. nodes that have no outgoing edges) and fold
-// these nodes into nodes that have only outgoing edges to terminal nodes.
-// store the dependencies of these next-to-terminal nodes and remove the
-// terminal ones. then start over again with the so generated graph. if we
-// consider the files for which we want to compute dependency information
-// as top level nodes (they will _only_ have outgoing nodes), we could
-// presumable roll up the entire graph from the bottom (terminal nodes) and
-// fold it one layer at a time
-//
-// in any case, there is presently no need for this since the actions of
-// this function are presently not really time critical: parsing the files
-// in the function above is a much bigger time-hit.
-std::set<std::string>
-get_all_includes (const std::string &name)
-{
- // start with direct includes
- std::set<std::string> all_includes = direct_includes[name];
-
- std::set<std::string> next_level_includes = all_includes;
- while (true)
- {
- // traverse all next level includes and get their direct include
- // files. the set makes sure that duplicates are removed
- std::set<std::string> second_next;
- for (std::set<std::string>::const_iterator
- next=next_level_includes.begin();
- next!=next_level_includes.end(); ++next)
- second_next.insert (direct_includes[*next].begin(),
- direct_includes[*next].end());
-
- // for each of them, if it hasn't been treated then add it to the
- // files of the next level and later add it to the all_includes
- next_level_includes.clear ();
- for (std::set<std::string>::const_iterator f=second_next.begin();
- f!=second_next.end(); ++f)
- if (all_includes.find(*f) == all_includes.end())
- next_level_includes.insert (*f);
-
- // if no new includes found no more, then quit
- if (next_level_includes.size() == 0)
- return all_includes;
-
- // otherwise, copy over and start over on the next level of the tree
- all_includes.insert (next_level_includes.begin(),
- next_level_includes.end());
- }
-}
-
-
-
-int main (int argc, char **argv)
-{
- std::vector<std::string> filenames;
-
- // parse all arguments (except the name of the executable itself)
- for (unsigned int c=1; c<static_cast<unsigned int>(argc); ++c)
- {
- const std::string arg = argv[c];
-
- // if string starts with -I, take this as an include path
- if ((arg.length()>2) && (arg[0]=='-') && (arg[1]=='I'))
- {
- std::string dir (arg.begin()+2, arg.end());
-
- // append a slash if not already there
- if (dir[dir.length()-1] != '/')
- dir += '/';
-
- // drop initial ./ if this is there
- if ((dir[0]=='.') && (dir[1]=='/'))
- dir = std::string(dir.begin()+2, dir.end());
-
- include_directories.push_back (dir);
- }
- // if string starts with -B, then this is the base name for object
- // files
- else if ((arg.length()>2) && (arg[0]=='-') && (arg[1]=='B'))
- {
- basepath = std::string(arg.begin()+2, arg.end());
- if (basepath[basepath.size()-1] != '/')
- basepath += '/';
- }
- // if string is -n, then use new-style format
- else if ((arg.length()==2) && (arg[0]=='-') && (arg[1]=='n'))
- format = new_style;
-
- // otherwise assume that this is one of the files for input
- else
- {
- assert (arg.size()>=1);
- assert (arg[0] != '-');
-
- filenames.push_back (arg);
- }
- }
-
- // next iterate through all files and figure out which other files they
- // include
- for (std::vector<std::string>::const_iterator file=filenames.begin();
- file != filenames.end(); ++file)
- determine_direct_includes (*file);
-
-
- // now we have all files that are directly or indirectly included into
- // the files given on the command lines. for each of them, we have
- // recorded which files they include themselves. for each file on the
- // command line, we can thus form a complete include tree.
- for (std::vector<std::string>::const_iterator file=filenames.begin();
- file != filenames.end(); ++file)
- {
- // get base of filename by chipping away .cc extension as well as
- // path
- std::string basename;
- if (file->find (".cc") != std::string::npos)
- basename = std::string (file->begin(),
- file->begin()+file->find (".cc"));
- else if (file->find (".cpp") != std::string::npos)
- basename = std::string (file->begin(),
- file->begin()+file->find (".cpp"));
- else
- basename = *file;
-
- if (basename.rfind ("/") != std::string::npos)
- basename = std::string (basename.begin()+basename.rfind("/")+1,
- basename.end());
-
- // get all direct and indirect includes for this file...
- const std::set<std::string> includes = get_all_includes (*file);
-
- // ...write the rule for the .o file...
- if (format == old_style)
- std::cout << basepath << basename << ".o: \\"
- << std::endl
- << "\t\t" << *file;
- else
- std::cout << basepath << "optimized/" << basename << ".o: \\"
- << std::endl
- << "\t\t" << *file;
- for (std::set<std::string>::const_iterator i=includes.begin();
- i!=includes.end(); ++i)
- std::cout << "\\\n\t\t" << *i;
- std::cout << std::endl;
-
- // ...and a similar rule for the .o file in debug mode
- if (format == old_style)
- std::cout << basepath << basename << ".g.o: \\"
- << std::endl
- << "\t\t" << *file;
- else
- std::cout << basepath << "debug/" << basename << ".o: \\"
- << std::endl
- << "\t\t" << *file;
- for (std::set<std::string>::const_iterator i=includes.begin();
- i!=includes.end(); ++i)
- std::cout << "\\\n\t\t" << *i;
- std::cout << std::endl;
- }
-}
-
#
# DEAL_II_ALLOW_AUTODETECTION
# DEAL_II_ALLOW_BUNDLED
-# DEAL_II_COMPONENT_COMPAT_FILES
# DEAL_II_COMPONENT_DOCUMENTATION
# DEAL_II_COMPONENT_EXAMPLES
# DEAL_II_COMPONENT_MESH_CONVERTER
)
ENDIF()
-OPTION(DEAL_II_COMPONENT_COMPAT_FILES
- "Enable installation of the example steps. This adds a COMPONENT \"compat_files\" to the build system."
- ON
- )
-
If(DEAL_II_HAVE_DOC_DIRECTORY)
OPTION(DEAL_II_COMPONENT_DOCUMENTATION
"Enable configuration, build and installation of the documentation. This adds a COMPONENT \"documentation\" to the build system."
#
# Same for components:
#
- IF(_var MATCHES "^(COMPAT_FILES|DOCUMENTATION|EXAMPLES|MESH_CONVERTER|PACKAGE|PARAMETER_GUI)")
+ IF(_var MATCHES "^(DOCUMENTATION|EXAMPLES|MESH_CONVERTER|PACKAGE|PARAMETER_GUI)")
SET(DEAL_II_COMPONENT_${_var} ${${_var}} CACHE BOOL "" FORCE)
UNSET(${_var} CACHE)
ENDIF()
INSTALL(FILES
${CMAKE_BINARY_DIR}/cpack/dealii.conf
- DESTINATION ${DEAL_II_COMMON_RELDIR}
+ DESTINATION ${DEAL_II_SHARE_RELDIR}
)
INSTALL(PROGRAMS
# DEAL_II_DEBUG_SUFFIX *)
# DEAL_II_RELEASE_SUFFIX *)
#
-# DEAL_II_CMAKE_MACROS_RELDIR *)
-# DEAL_II_DOCHTML_RELDIR *)
-# DEAL_II_DOCREADME_RELDIR *)
-# DEAL_II_EXAMPLES_RELDIR *)
# DEAL_II_EXECUTABLE_RELDIR *)
# DEAL_II_INCLUDE_RELDIR *)
# DEAL_II_LIBRARY_RELDIR *)
# DEAL_II_PROJECT_CONFIG_RELDIR *)
+# DEAL_II_SHARE_RELDIR *)
+# DEAL_II_CMAKE_MACROS_RELDIR *)
+# DEAL_II_DOCREADME_RELDIR *)
+# DEAL_II_DOCHTML_RELDIR *)
+# DEAL_II_EXAMPLES_RELDIR *)
#
# DEAL_II_BUILD_TYPES
# DEAL_II_LIST_SUFFIXES
SET_IF_EMPTY(DEAL_II_DEBUG_SUFFIX ".g")
SET_IF_EMPTY(DEAL_II_RELEASE_SUFFIX "")
-IF(DEAL_II_COMPONENT_COMPAT_FILES)
- #
- # The good, old directory structure:
- #
- SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "cmake/macros")
- SET_IF_EMPTY(DEAL_II_COMMON_RELDIR "common")
- SET_IF_EMPTY(DEAL_II_DOCHTML_RELDIR "doc")
- SET_IF_EMPTY(DEAL_II_DOCREADME_RELDIR "")
- SET_IF_EMPTY(DEAL_II_EXAMPLES_RELDIR "examples")
- SET_IF_EMPTY(DEAL_II_EXECUTABLE_RELDIR "bin")
- SET_IF_EMPTY(DEAL_II_INCLUDE_RELDIR "include")
- SET_IF_EMPTY(DEAL_II_LIBRARY_RELDIR "lib")
- SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}")
-ELSE()
- #
- # IF DEAL_II_COMPONENT_COMPAT_FILES=off, we assume that we have to
- # obey the FSHS...
- #
- SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "share/${DEAL_II_PACKAGE_NAME}/cmake/Macros")
- SET_IF_EMPTY(DEAL_II_COMMON_RELDIR "share/${DEAL_II_PACKAGE_NAME}/common")
- SET_IF_EMPTY(DEAL_II_DOCREADME_RELDIR "share/doc/${DEAL_II_PACKAGE_NAME}")
- SET_IF_EMPTY(DEAL_II_DOCHTML_RELDIR "${DEAL_II_DOCREADME_RELDIR}/html")
- SET_IF_EMPTY(DEAL_II_EXAMPLES_RELDIR "share/doc/${DEAL_II_PACKAGE_NAME}/examples")
- SET_IF_EMPTY(DEAL_II_EXECUTABLE_RELDIR "bin")
- SET_IF_EMPTY(DEAL_II_INCLUDE_RELDIR "include")
- SET_IF_EMPTY(DEAL_II_LIBRARY_RELDIR "lib${LIB_SUFFIX}")
- SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}")
-ENDIF()
+#
+# Try to obey the FSHS...
+#
+SET_IF_EMPTY(DEAL_II_EXECUTABLE_RELDIR "bin")
+SET_IF_EMPTY(DEAL_II_INCLUDE_RELDIR "include")
+SET_IF_EMPTY(DEAL_II_LIBRARY_RELDIR "lib${LIB_SUFFIX}")
+SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}")
+SET_IF_EMPTY(DEAL_II_SHARE_RELDIR "share/${DEAL_II_PACKAGE_NAME}")
+SET_IF_EMPTY(DEAL_II_CMAKE_MACROS_RELDIR "${DEAL_II_SHARE_RELDIR}/cmake/Macros")
+SET_IF_EMPTY(DEAL_II_DOCREADME_RELDIR "share/doc/${DEAL_II_PACKAGE_NAME}")
+SET_IF_EMPTY(DEAL_II_DOCHTML_RELDIR "${DEAL_II_DOCREADME_RELDIR}/html")
+SET_IF_EMPTY(DEAL_II_EXAMPLES_RELDIR "${DEAL_II_DOCREADME_RELDIR}/examples")
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
LIST(APPEND DEAL_II_BUILD_TYPES "DEBUG")
cmake -DDEAL_II_WITH_MPI=ON <...>
</pre>
The same holds for all variables starting with <code>COMPONENT_</code>
- and all individual component names: <code>COMPAT_FILES</code>,
+ and all individual component names:
<code>DOCUMENTATION</code>, <code>EXAMPLES</code>,
<code>MESH_CONVERTER</code> and <code>PARAMETER_GUI</code> (which
will be expanded to the full <code>DEAL_II_COMPONENT_*</code> variable name).
# and reruns the configure and generate phases of CMake
# rebuild_cache - rerun the configure and generate phases of CMake
#
-# compat_files - build and install component 'compat_files'
# documentation - build and install component 'documentation'
# examples - build and install component 'examples'
# library - build and install component 'library'
# [...]
#
# Component configuration:
-# DEAL_II_COMPONENT_COMPAT_FILES
# ( DEAL_II_COMPONENT_DOCUMENTATION = OFF )
# DEAL_II_COMPONENT_EXAMPLES
# DEAL_II_COMPONENT_MESH_CONVERTER
component (most notably the documentation) you can use one of the
following top level targets:
<pre class="cmake">
-compat_files - builds and installs the 'compat_files' component
documentation - builds and installs the 'documentation' component
examples - builds and installs the 'examples' component
library - builds and installs the 'library' component
<acronym>deal.II</acronym> will be configured, built and installed:
<ul>
- <li>
- <p>
- <code>DEAL_II_COMPONENT_COMPAT_FILES</code>
- (default <code>ON</code>):
- </p>
- <p>
- Enable legacy directory structure and the installation of
- compatibility files and tools for the old build system. This
- adds a component <code>compat_files</code> to the build
- system.
- </p>
-
<li>
<p>
<code>DEAL_II_COMPONENT_DOCUMENTATION</code>
CMAKE_INSTALL_PREFIX
</pre>
- Please note that depending on whether
- <code>DEAL_II_COMPONENT_COMPAT_FILES</code> is set, there will be
- a different default directory structure:
- <ul>
- <li>
- With <code>DEAL_II_COMPONENT_COMPAT_FILES=ON</code>:
-<pre class="cmake">
-${CMAKE_INSTALL_PREFIX}/
- bin
- cmake/macros
- common
- common/scripts
- doc
- examples
- include
- lib
- lib/cmake/deal.II
-</pre>
-
- <li>
- With <code>DEAL_II_COMPONENT_COMPAT_FILES=OFF</code>:
+ The default directory structure is:
<pre class="cmake">
${CMAKE_INSTALL_PREFIX}/
bin
lib${LIB_SUFFIX}/cmake/deal.II
share/deal.II/
share/deal.II/cmake/macros
- share/deal.II/examples
+ share/doc/deal.II/
share/doc/deal.II/html
+ share/doc/deal.II/examples
</pre>
</ul>
</p>
<p>
- The default directory structure can be changed by by setting the
+ The default directory structure can be changed by setting the
following variables:
<pre class="cmake">
-DEAL_II_CMAKE_MACROS_RELDIR
-DEAL_II_COMMON_RELDIR
-DEAL_II_DOCHTML_RELDIR
-DEAL_II_DOCREADME_RELDIR
-DEAL_II_EXAMPLES_RELDIR
DEAL_II_EXECUTABLE_RELDIR
DEAL_II_INCLUDE_RELDIR
DEAL_II_LIBRARY_RELDIR
DEAL_II_PROJECT_CONFIG_RELDIR
+DEAL_II_SHARE_RELDIR
+DEAL_II_CMAKE_MACROS_RELDIR
+DEAL_II_DOCREADME_RELDIR
+DEAL_II_DOCHTML_RELDIR
+DEAL_II_EXAMPLES_RELDIR
</pre>
</p>
-
<a name="advanced"></a>
<h2>Initial cache file and advanced options</h2>
</li>
<li><a href="#cmakeauto">Autopilot style <code>CMakeLists.txt</code></li>
<li><a href="#dealiiconfig"><code>deal.IIConfig.cmake</code></a></li>
- <li><a href="#legacy">Legacy <code>Make.global_options</code></a></li>
</ol>
</div>
DEAL_II_PATH
DEAL_II_CMAKE_MACROS_RELDIR
-DEAL_II_COMMON_RELDIR
+DEAL_II_SHARE_RELDIR
DEAL_II_DOCREADME_RELDIR
DEAL_II_DOCHTML_RELDIR
DEAL_II_EXAMPLES_RELDIR
DEAL_II_WITH_ZLIB
</pre>
- <a name="legacy"></a>
- <h2> Legacy Make.global_options </h2>
-
- <p>
- Before version 8.0, <acronym>deal.II</acronym> used the
- traditional <code>autoconf/make</code> configuration and build
- system. The interaction between these two programs, as well as
- propagation of information from <acronym>deal.II</acronym> to user
- programs happened through a number of files that were generated within
- the <acronym>deal.II</acronym> directory tree.
- The CMake build system sets up the following compatibility files (if
- <code>DEAL_II_COMPONENT_COMPAT_FILES</code> is set, which is default):
-<pre>
-${CMAKE_INSTALL_PREFIX}/
- common/Make.global_options
- common/scripts/expand_instantiations
- common/scripts/make_dependencies
-</pre>
-
- Therefore, it should be sufficient to set <code>D</code> in the old
- user Makefiles to:
-<pre>
-D=/path/install/dir
-</pre>
- where <code>/path/install/dir</code> is the directory set up via
- <code>CMAKE_INSTALL_PREFIX</code> (the path
- <acronym>deal.II</acronym> was installed to).
- </p>
-
<hr />
<div class="right">
<a href="http://validator.w3.org/check?uri=referer" target="_top">
# Component configuration:
#
#
-# SET(DEAL_II_COMPONENT_COMPAT_FILES ON CACHE BOOL
-# "Enable installation of the example steps. This adds a COMPONENT \"compat_files\" to the build system."
-# )
-#
# SET(DEAL_II_COMPONENT_DOCUMENTATION OFF CACHE BOOL
# "Enable configuration, build and installation of the html documentation. This adds a COMPONENT \"documentation\" to the build system."
# )
GET_CMAKE_PROPERTY(_variables VARIABLES)
FOREACH(_var ${_variables})
IF( _var MATCHES "^(TEST|DEAL_II|ALLOW|WITH|FORCE|COMPONENT)_" OR
- _var MATCHES "^(COMPAT_FILES|DOCUMENTATION|EXAMPLES|MESH_CONVERTER|PARAMETER_GUI)" OR
+ _var MATCHES "^(DOCUMENTATION|EXAMPLES|MESH_CONVERTER|PARAMETER_GUI)" OR
_var MATCHES "^(ARPACK|BOOST|OPENCASCADE|MUPARSER|HDF5|METIS|MPI)_" OR
_var MATCHES "^(NETCDF|P4EST|PETSC|SLEPC|THREADS|TBB|TRILINOS)_" OR
_var MATCHES "^(UMFPACK|ZLIB|LAPACK|MUPARSER)_" OR