Skip to content
Snippets Groups Projects
Commit b3cbc262 authored by Ansgar Burchardt's avatar Ansgar Burchardt Committed by ansgar
Browse files

Add CMake support (only working for me so far).

[[Imported from SVN: r12693]]
parent 1dffb46a
No related branches found
No related tags found
No related merge requests found
Showing
with 194 additions and 0 deletions
project("dune-contact" 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()
find_package(PkgConfig)
set(ENV{PKG_CONFIG_PATH} "/home/data/ansgar/dis/build/snout-gcc-4.8.1/install/lib/pkgconfig")
pkg_check_modules(IPOPT REQUIRED ipopt)
#find_path(IPOPT_INCLUDE_DIR IpoptConfig.h
# HINTS "${PC_IPOPT_INCLUDEDIR}" "${PC_IPOPT_INCLUDEDIRS}")
find_library(IPOPT_LIBRARY ipopt
HINTS "${PC_IPOPT_LIBDIR}" "${PC_IPOPT_LIBRARY_DIRS}")
#set(IPOPT_LIBRARIES "${IPOPT_LIBRARY}")
#set(IPOPT_INCLUDE_DIRS "${IPOPT_INCLUDE_DIR}")
find_package_handle_standard_args(Ipopt DEFAULT_MSG
IPOPT_FOUND)
set(HAVE_IPOPT ${IPOPT_FOUND})
include_directories(${IPOPT_INCLUDE_DIRS})
find_library(DL_LIBRARY dl)
find_library(COINHSL_LIBRARY coinhsl)
function(add_ipopt_flags _targets)
foreach(_target ${_targets})
# set_property(TARGET ${_target}
# APPEND
# PROPERTY COMPILE_FLAGS ${IPOPT_CFLAGS})
target_link_libraries(${_target} ${COINHSL_LIBRARY} ${IPOPT_LIBRARY} ${DL_LIBRARY})
endforeach(_target ${_targets})
endfunction(add_ipopt_flags)
add_subdirectory("dune")
add_subdirectory("m4")
set(programs 1bcontact 2bcontact)
# het2bcontact nbcontact nbnonlincontact nonlincontact adaptmeasure 1badaptmeasure nladaptmeasure)
foreach(_program ${programs})
add_executable(${_program} ${_program}.cc)
add_dune_amiramesh_flags(${_program})
add_ipopt_flags(${_program})
add_dune_ug_flags(${_program})
add_dune_psurface_flags(${_program})
target_link_libraries(${_program} /home/data/ansgar/dis/build/snout-gcc-4.8.1/install/lib/libdunegridglue.so)
endforeach()
add_executable(prepare-boundary prepare-boundary.cc)
add_dune_ug_flags(prepare-boundary)
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
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
/* begin dune-contact */
/* Define to 1 if Ipopt is available. */
#cmakedefine HAVE_IPOPT 1
/* end dune-contact */
\ No newline at end of file
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@_LIBRARIES dunegridglue)
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
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()
add_subdirectory(contact)
add_subdirectory(assemblers)
add_subdirectory(common)
add_subdirectory(estimators)
add_subdirectory(projections)
add_subdirectory(solvers)
install(FILES
contact2b.hh
postprocessresidual.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact)
install(FILES
contactassembler.cc
contactassembler.hh
dualmortarcoupling.cc
dualmortarcoupling.hh
dualmortarcouplinghierarchy.cc
dualmortarcouplinghierarchy.hh
hettwobodyassembler.cc
hettwobodyassembler.hh
leafp2mortarcoupling.cc
leafp2mortarcoupling.hh
nbodyassembler.cc
nbodyassembler.hh
onebodyassembler.cc
onebodyassembler.hh
p2onebodyassembler.cc
p2onebodyassembler.hh
twobodyassembler.cc
twobodyassembler.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact/assemblers)
add_subdirectory(dual)
install(FILES
couplingpair.hh
markcontactarea.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact/common)
add_subdirectory(dualp1)
add_subdirectory(dualq1)
install(FILES
dualp1.hh
dualq1.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact/common/dual)
install(FILES
dualp1localbasis.hh
dualp1localcoefficients.hh
dualp1localinterpolation.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact/common/dual/dualp1)
install(FILES
dualq1localbasis.hh
dualq1localcoefficients.hh
dualq1localinterpolation.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact/common/dual/dualq1)
install(FILES
hierarchiccontactestimator.cc
hierarchiccontactestimator.hh
scontestimator.hh
zoukhsignoriniestimator.hh
zoukornhuberbasis.hh
zoukornhuberelement.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact/estimators)
install(FILES
analyticdirectionsprojection.hh
closestpointprojection.hh
contactprojection.hh
normalprojection.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact/projections)
install(FILES
contactobsrestrict.cc
contactobsrestrict.hh
contacttransfer.cc
contacttransfer.hh
dgtransfer.cc
dgtransfer.hh
nsnewtoncontacttransfer.cc
nsnewtoncontacttransfer.hh
nsnewtonmgstep.cc
nsnewtonmgstep.hh
trustregionstep.cc
trustregionstep.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/contact/solvers)
install(FILES
contact.m4
DESTINATION share/aclocal)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment