Skip to content
Snippets Groups Projects
Commit c263ee16 authored by Markus Blatt's avatar Markus Blatt
Browse files

[Merge][CMake] Merge support for CMake from CMake branch.

[[Imported from SVN: r1916]]
parents 14411c28 bda5892b
No related branches found
No related tags found
No related merge requests found
Showing
with 332 additions and 4 deletions
Makefile
Makefile.in
config.*
config.guess
config.h.in
config.log
config.status
config.h
config.lt
config.sub
configure
dependencies.m4
aclocal.m4
......@@ -19,3 +25,5 @@ dune-istl-?.?
ltmain.sh
am
.libs
config.guess
config.h.in
# set up project
project("dune-istl" C CXX)
# general stuff
cmake_minimum_required(VERSION 2.8.6)
#find dune-common and set the module path
find_package(dune-common)
list(APPEND CMAKE_MODULE_PATH ${dune-common_MODULE_PATH}
"${PROJECT_SOURCE_DIR}/cmake/modules")
#include the dune macros
include(DuneMacros)
# start a dune project with information from dune.module
dune_project()
add_subdirectory("cmake/modules")
add_subdirectory("m4")
add_subdirectory("dune")
add_subdirectory("doc")
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
# $Id$
# we need the module file to be able to build via dunecontrol
EXTRA_DIST=dune.module
EXTRA_DIST= CMakeLists.txt dune.module dune-istl-config.cmake.in dune-istl-version.cmake.in
# don't follow the full GNU-standard
# we need automake 1.9 or newer
AUTOMAKE_OPTIONS = foreign 1.9
SUBDIRS = dune doc m4
SUBDIRS = cmake dune doc m4
# use configured compiler for "make distcheck"
# doxygen is difficult to convince to build in a special directory...
......@@ -15,3 +15,7 @@ DISTCHECK_CONFIGURE_FLAGS = --with-dune-common="$(DUNE_COMMON_ROOT)" CXX="$(CXX)
include $(top_srcdir)/am/global-rules
include $(top_srcdir)/am/top-rules
# Distribute and install config.h.cmake
configdir = $(datadir)/dune-istl
dist_config_DATA = config.h.cmake
Makefile.in
Makefile
SUBDIRS= modules pkg
Makefile.in
Makefile
set(modules DuneIstlMacros.cmake
FindSuperLU.cmake)
install(FILES ${modules} DESTINATION
${DUNE_INSTALL_MODULEDIR})
include(FindBoostFusion)
include(FindParMETIS)
message("PARMETIS_FOUND=${PARMETIS_FOUND}")
message("ParMETIS_FOUND=${ParMETIS_FOUND}")
include(FindSuperLU)
#
# Module that checks whether SuperLU is available and usable.
# SuperLU must be a version released after the year 2005.
#
# Variables used by this module which you may want to set:
# SUPERLU_PREFIX Path list to search for SuperLU
#
# Sets the follwing variable:
#
# SUPERLU_FOUND True if SuperLU available and usable.
# SUPERLU_MIN_VERSION_4_3 True if SuperLU version >= 4.3.
# SUPERLU_WITH_VERSION Human readable string containing version information.
# SUPERLU_INCLUDE_DIRS Path to the SuperLU include dirs.
# SUPERLU_LIBRARIES Name to the SuperLU library.
#
# adds SuperLU flags to the targets
function(add_dune_superlu_flags _targets)
if(SUPERLU_FOUND)
foreach(_target ${_targets})
target_link_libraries(${_target} ${SUPERLU_DUNE_LIBRARIES})
get_target_property(_props ${_target} COMPILE_FLAGS)
string(REPLACE "_props-NOTFOUND" "" _props "${_props}")
set_target_properties(${_target} PROPERTIES COMPILE_FLAGS
"${_props} ${SUPERLU_DUNE_COMPILE_FLAGS} -DENABLE_SUPERLU=1")
endforeach(_target ${_targets})
endif(SUPERLU_FOUND)
endfunction(add_dune_superlu_flags)
# look for BLAS
find_package(BLAS QUIET REQUIRED)
if(NOT BLAS_FOUND)
message(WARNING "SuperLU requires BLAS which was not found, skipping the test.")
return()
endif(NOT BLAS_FOUND)
# look for header files, only at positions given by the user
find_path(SUPERLU_INCLUDE_DIR
NAMES supermatrix.h
PATHS ${SUPERLU_PREFIX}
PATH_SUFFIXES "superlu" "include/superlu" "include" "SRC"
NO_DEFAULT_PATH
)
# look for header files, including default paths
find_path(SUPERLU_INCLUDE_DIR
NAMES supermatrix.h
PATH_SUFFIXES "superlu" "include/superlu" "include" "SRC"
)
# look for library, only at positions given by the user
find_library(SUPERLU_LIBRARY
NAMES "superlu_4.3" "superlu_4.2" "superlu_4.1" "superlu_4.0" "superlu_3.1" "superlu_3.0" "superlu"
PATHS ${SUPERLU_PREFIX}
PATH_SUFFIXES "lib" "lib32" "lib64"
NO_DEFAULT_PATH
)
# look for library files, including default paths
find_library(SUPERLU_LIBRARY
NAMES "superlu_4.3" "superlu_4.2" "superlu_4.1" "superlu_4.0" "superlu_3.1" "superlu_3.0" "superlu"
PATH_SUFFIXES "lib" "lib32" "lib64"
)
# check version specific macros
include(CheckCSourceCompiles)
include(CMakePushCheckState)
cmake_push_check_state()
# we need if clauses here because variable is set variable-NOTFOUND
# if the searches above were not successful
# Without them CMake print errors like:
# "CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
# Please set them or make sure they are set and tested correctly in the CMake files:"
#
if(SUPERLU_INCLUDE_DIR)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${SUPERLU_INCLUDE_DIR})
endif(SUPERLU_INCLUDE_DIR)
if(SUPERLU_LIBRARY)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${SUPERLU_LIBRARY})
endif(SUPERLU_LIBRARY)
if(BLAS_LIBRARIES)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${BLAS_LIBRARIES})
endif(BLAS_LIBRARIES)
# check whether "mem_usage_t.expansions" was found in "slu_ddefs.h"
CHECK_C_SOURCE_COMPILES("
#include <slu_ddefs.h>
int main(void)
{
mem_usage_t mem;
return mem.expansions;
}"
HAVE_MEM_USAGE_T_EXPANSIONS)
# check whether version is at least 4.3
CHECK_C_SOURCE_COMPILES("
#include <slu_ddefs.h>
int main(void)
{
return SLU_DOUBLE;
}"
SUPERLU_MIN_VERSION_4_3)
cmake_pop_check_state()
if(SUPERLU_MIN_VERSION_4_3)
set(SUPERLU_WITH_VERSION "SuperLU >= 4.3" CACHE STRING
"Human readable string containing SuperLU version information.")
else()
set(SUPERLU_WITH_VERSION "SuperLU <= 4.2, post 2005" CACHE STRING
"Human readable string containing SuperLU version information.")
endif(SUPERLU_MIN_VERSION_4_3)
# behave like a CMake module is supposed to behave
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
"SuperLU"
DEFAULT_MSG
SUPERLU_INCLUDE_DIR
SUPERLU_LIBRARY
)
mark_as_advanced(SUPERLU_INCLUDE_DIR SUPERLU_LIBRARY)
# if both headers and library are found, store results
if(SUPERLU_FOUND)
set(SUPERLU_INCLUDE_DIRS ${SUPERLU_INCLUDE_DIR})
set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARY})
# log result
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determing location of ${SUPERLU_WITH_VERSION} succeded:\n"
"Include directory: ${SUPERLU_INCLUDE_DIRS}\n"
"Library directory: ${SUPERLU_LIBRARIES}\n\n")
set(SUPERLU_DUNE_COMPILE_FLAGS "-I${SUPERLU_INCLUDE_DIRS}"
CACHE STRING "Compile flags used by DUNE when compiling SuperLU programs")
set(SUPERLU_DUNE_LIBRARIES ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}
CACHE STRING "Libraries used by DUNE when linking SuperLU programs")
else(SUPERLU_FOUND)
# log errornous result
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determing location of SuperLU failed:\n"
"Include directory: ${SUPERLU_INCLUDE_DIRS}\n"
"Library directory: ${SUPERLU_LIBRARIES}\n\n")
endif(SUPERLU_FOUND)
# set HAVE_SUPERLU for config.h
set(HAVE_SUPERLU SUPERLU_FOUND)
MODULES = DuneIstlMacros.cmake \
FindSuperLU.cmake
modulesdir= $(datadir)/cmake/modules
dist_modules_DATA = ${MODULES}
include $(top_srcdir)/am/global-rules
EXTRA_DIST = CMakeLists.txt
Makefile.in
Makefile
EXTRA_DIST = dune-istl-config.cmake.in
if(NOT @DUNE_MOD_NAME@_FOUND)
#compute installation prefix relative to this file
get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_prefix "${_dir}/../../.." ABSOLUTE)
#import the target
#include("${_prefix}/lib/cmake/@DUNE_MOD_NAME@-targets.cmake")
#report other information
set(@DUNE_MOD_NAME@_PREFIX "${_prefix}")
set(@DUNE_MOD_NAME@_INCLUDE_DIRS "${_prefix}/include")
set(@DUNE_MOD_NAME@_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
set(@DUNE_MOD_NAME@_DEPENDS "@DUNE_DEPENDS@")
set(@DUNE_MOD_NAME@_SUGGESTS "@DUNE_SUGGESTS@")
set(@DUNE_MOD_NAME@_MODULE_PATH "@DUNE_INSTALL_MODULEDIR@")
endif(NOT @DUNE_MOD_NAME@_FOUND)
\ No newline at end of file
/* begin dune-istl
put the definitions for config.h specific to
your project here. Everything above will be
overwritten
*/
/* begin private */
/* Name of package */
#define PACKAGE "@DUNE_MOD_NAME"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "@DUNE_MAINTAINER@"
/* Define to the full name of this package. */
#define PACKAGE_NAME "@DUNE_MOD_NAME@"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "@DUNE_MOD_NAME@ @DUNE_MOD_VERSION@"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "@DUNE_MOD_NAME@"
/* Define to the home page for this package. */
#define PACKAGE_URL "@DUNE_MOD_URL@"
/* Define to the version of this package. */
#define PACKAGE_VERSION "@DUNE_MOD_VERSION@"
/* end private */
/* define if the Boost::Fusion headers are available */
#cmakedefine HAVE_BOOST_FUSION
/* Define to ENABLE_BOOST if the Boost library is available */
#cmakedefine HAVE_BOOST ENABLE_BOOST
/* Define to ENABLE_PARMETIS if you have the Parmetis library.
This is only true if MPI was found
by configure _and_ if the application uses the PARMETIS_CPPFLAGS */
#cmakedefine HAVE_PARMETIS ENABLE_PARMETIS
/* Define to ENABLE_SUPERLU if the SuperLU library is available */
#cmakedefine HAVE_SUPERLU ENABLE_SUPERLU
/* define to 1 because older versions of SuperLU are no longer supported*/
#define SUPERLU_POST_2005_VERSION 1
/* Define to 1 if 'expansions' is a member of 'mem_usage_t'. */
#cmakedefine HAVE_MEM_USAGE_T_EXPANSIONS @HAVE_MEM_USAGE_T_EXPANSIONS@
/* define to 1 if SuperLU header slu_ddefs.h contains SLU_DOUBLE */
#cmakedefine SUPERLU_MIN_VERSION_4_3 @SUPERLU_MIN_VERSION_4_3@
/* Define to the version of dune-istl */
#define DUNE_ISTL_VERSION "${DUNE_ISTL_VERSION}"
/* Define to the major version of dune-istl */
#define DUNE_ISTL_VERSION_MAJOR ${DUNE_ISTL_VERSION_MAJOR}
/* Define to the minor version of dune-istl */
#define DUNE_ISTL_VERSION_MINOR ${DUNE_ISTL_VERSION_MINOR}
/* Define to the revision of dune-istl */
#define DUNE_ISTL_VERSION_REVISION ${DUNE_ISTL_VERSION_REVISION}
/* end dune-istl
Everything below here will be overwritten
*/
......@@ -18,6 +18,9 @@ AC_SUBST([AM_LDFLAGS], '$(DUNE_LDFLAGS) $(DUNE_LIBS)')
# write output
AC_CONFIG_FILES([Makefile
cmake/Makefile
cmake/modules/Makefile
cmake/pkg/Makefile
doc/doxygen/Makefile
doc/doxygen/Doxyfile
doc/Makefile
......
add_subdirectory("doxygen")
dune_add_latex_document(istl.tex FATHER_TARGET doc
BIB_FILES istl.bib DEFAULT_SAFEPDF IMAGES blockstructure.eps)
create_doc_install(istl.pdf
${CMAKE_INSTALL_DOCDIR} istl_safepdf)
......@@ -6,7 +6,7 @@ TEXSOURCES = istl.tex istl.bib
EPSFILES = blockstructure.eps
if BUILD_DOCS
DOCFILES = istl.pdf
EXTRA_DIST = $(DOCFILES)
EXTRA_DIST = CMakeLists.txt $(DOCFILES)
EXTRAINSTALL = $(DOCFILES)
endif
......
# shortcut for creating the Doxyfile.in and Doxyfile
add_doxygen_target()
......@@ -6,3 +6,5 @@ CURDIR=doc/doxygen
include $(top_srcdir)/am/doxygen
include $(top_srcdir)/am/global-rules
EXTRA_DIST = CMakeLists.txt
if(NOT @DUNE_MOD_NAME@_FOUND)
#import the target
#include("@CMAKE_BINARY_DIR@/@DUNE_MOD_NAME@-targets.cmake")
#report other information
set(@DUNE_MOD_NAME@_PREFIX "@CMAKE_SOURCE_DIR@")
set(@DUNE_MOD_NAME@_INCLUDE_DIRS "@CMAKE_SOURCE_DIR@")
set(@DUNE_MOD_NAME@_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
set(@DUNE_MOD_NAME@_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
set(@DUNE_MOD_NAME@_LIBRARIES "")
set(@DUNE_MOD_NAME@_DEPENDS "@DUNE_DEPENDS@")
set(@DUNE_MOD_NAME@_SUGGESTS "@DUNE_SUGGESTS@")
set(@DUNE_MOD_NAME@_MODULE_PATH "@CMAKE_SOURCE_DIR@/cmake/modules")
endif(NOT @DUNE_MOD_NAME@_FOUND)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment