From 37dac5c85ea005d27da2eaebfdafbd10278653d4 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt <burchardt@igpm.rwth-aachen.de> Date: Fri, 17 Jan 2014 10:07:32 +0000 Subject: [PATCH] Add partial cmake support (still missing tests). [[Imported from SVN: r12683]] --- CMakeLists.txt | 13 +++++++++++++ cmake/pkg/dune-elasticity-config.cmake.in | 20 ++++++++++++++++++++ dune-elasticity-config.cmake.in | 20 ++++++++++++++++++++ dune-elasticity-version.cmake.in | 8 ++++++++ dune-elasticity.pc.in | 15 +++++++++++++++ dune/CMakeLists.txt | 1 + dune/elasticity/CMakeLists.txt | 4 ++++ dune/elasticity/assemblers/CMakeLists.txt | 8 ++++++++ dune/elasticity/common/CMakeLists.txt | 3 +++ dune/elasticity/estimators/CMakeLists.txt | 3 +++ dune/elasticity/materials/CMakeLists.txt | 4 ++++ m4/CMakeLists.txt | 4 ++++ 12 files changed, 103 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cmake/pkg/dune-elasticity-config.cmake.in create mode 100644 dune-elasticity-config.cmake.in create mode 100644 dune-elasticity-version.cmake.in create mode 100644 dune-elasticity.pc.in create mode 100644 dune/CMakeLists.txt create mode 100644 dune/elasticity/CMakeLists.txt create mode 100644 dune/elasticity/assemblers/CMakeLists.txt create mode 100644 dune/elasticity/common/CMakeLists.txt create mode 100644 dune/elasticity/estimators/CMakeLists.txt create mode 100644 dune/elasticity/materials/CMakeLists.txt create mode 100644 m4/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9a62ee5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +project("dune-elasticity" CXX) +cmake_minimum_required(VERSION 2.8.6) + +find_package(dune-common) +list(APPEND CMAKE_MODULE_PATH ${dune-common_MODULE_PATH}) +include(DuneMacros) + +dune_project() + +add_subdirectory("dune") +add_subdirectory("m4") + +finalize_dune_project(GENERATE_CONFIG_H_CMAKE) diff --git a/cmake/pkg/dune-elasticity-config.cmake.in b/cmake/pkg/dune-elasticity-config.cmake.in new file mode 100644 index 0000000..43ed3a9 --- /dev/null +++ b/cmake/pkg/dune-elasticity-config.cmake.in @@ -0,0 +1,20 @@ +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 "${_prefix}/@DUNE_INSTALL_MODULEDIR@") +endif(NOT @DUNE_MOD_NAME@_FOUND) \ No newline at end of file diff --git a/dune-elasticity-config.cmake.in b/dune-elasticity-config.cmake.in new file mode 100644 index 0000000..43ed3a9 --- /dev/null +++ b/dune-elasticity-config.cmake.in @@ -0,0 +1,20 @@ +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 "${_prefix}/@DUNE_INSTALL_MODULEDIR@") +endif(NOT @DUNE_MOD_NAME@_FOUND) \ No newline at end of file diff --git a/dune-elasticity-version.cmake.in b/dune-elasticity-version.cmake.in new file mode 100644 index 0000000..a1c2199 --- /dev/null +++ b/dune-elasticity-version.cmake.in @@ -0,0 +1,8 @@ +set(PACKAGE_VERSION "@DUNE_MOD_VERSION@") + +if(NOT "${PACKAGE_FIND_VERSION}" VERSION_GREATER "@DUNE_MOD_VERSION@") + set (PACKAGE_VERSION_COMPATIBLE 1) # compatible with older + if ("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "@DUNE_MOD_VERSION@") + set(PACKAGE_VERSION_EXACT 1) #exact match for this version + endif() +endif() diff --git a/dune-elasticity.pc.in b/dune-elasticity.pc.in new file mode 100644 index 0000000..5cc5b2f --- /dev/null +++ b/dune-elasticity.pc.in @@ -0,0 +1,15 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +CXX=@CXX@ +CC=@CC@ +DEPENDENCIES=@REQUIRES@ + +Name: @PACKAGE_NAME@ +Version: @VERSION@ +Description: Dune (Distributed and Unified Numerics Environment) elasticity module +URL: http://dune-project.org/ +Requires: ${DEPENDENCIES} +Libs: +Cflags: -I${includedir} diff --git a/dune/CMakeLists.txt b/dune/CMakeLists.txt new file mode 100644 index 0000000..b9de387 --- /dev/null +++ b/dune/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(elasticity) diff --git a/dune/elasticity/CMakeLists.txt b/dune/elasticity/CMakeLists.txt new file mode 100644 index 0000000..0b3da84 --- /dev/null +++ b/dune/elasticity/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory(assemblers) +add_subdirectory(common) +add_subdirectory(estimators) +add_subdirectory(materials) diff --git a/dune/elasticity/assemblers/CMakeLists.txt b/dune/elasticity/assemblers/CMakeLists.txt new file mode 100644 index 0000000..60b0eef --- /dev/null +++ b/dune/elasticity/assemblers/CMakeLists.txt @@ -0,0 +1,8 @@ +install(FILES + neohookeassembler.cc + neohookeassembler.hh + neohookefunctionalassembler.hh + neohookeoperatorassembler.hh + ogdenassembler.cc + ogdenassembler.hh + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/elasticity/assemblers) diff --git a/dune/elasticity/common/CMakeLists.txt b/dune/elasticity/common/CMakeLists.txt new file mode 100644 index 0000000..e090d8c --- /dev/null +++ b/dune/elasticity/common/CMakeLists.txt @@ -0,0 +1,3 @@ +install(FILES + elasticityhelpers.hh + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/elasticity/common) diff --git a/dune/elasticity/estimators/CMakeLists.txt b/dune/elasticity/estimators/CMakeLists.txt new file mode 100644 index 0000000..f1a8796 --- /dev/null +++ b/dune/elasticity/estimators/CMakeLists.txt @@ -0,0 +1,3 @@ +install(FILES + zienkiewiczzhuestimator.hh + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/elasticity/estimators) diff --git a/dune/elasticity/materials/CMakeLists.txt b/dune/elasticity/materials/CMakeLists.txt new file mode 100644 index 0000000..1a1c218 --- /dev/null +++ b/dune/elasticity/materials/CMakeLists.txt @@ -0,0 +1,4 @@ +install(FILES + geomexactstvenantkirchhoffmaterial.hh + neohookeanmaterial.hh + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/elasticity/materials) diff --git a/m4/CMakeLists.txt b/m4/CMakeLists.txt new file mode 100644 index 0000000..168cd94 --- /dev/null +++ b/m4/CMakeLists.txt @@ -0,0 +1,4 @@ +install(FILES + dune-elasticity.m4 + DESTINATION share/aclocal) + -- GitLab