diff --git a/cmake/modules/AddSuperLUFlags.cmake b/cmake/modules/AddSuperLUFlags.cmake new file mode 100644 index 0000000000000000000000000000000000000000..66fc2c131ab3281ae5de6e227a0e98086a86cc15 --- /dev/null +++ b/cmake/modules/AddSuperLUFlags.cmake @@ -0,0 +1,21 @@ +# +# Module providing convenience methods for compile binaries with SuperLU support. +# +# Provides the following functions: +# +# add_dune_superlu_flags(target1 target2 ...) +# +# adds SuperLU flags to the targets for compilation and linking +# +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) + diff --git a/cmake/modules/DuneIstlMacros.cmake b/cmake/modules/DuneIstlMacros.cmake index 1bcd50d1f7328fba29ae8cd539323b4eb9bd27a5..d9d87a3748b8f62f5e3ba12008bbc528e51e47a1 100644 --- a/cmake/modules/DuneIstlMacros.cmake +++ b/cmake/modules/DuneIstlMacros.cmake @@ -1,3 +1,5 @@ find_package(BoostFusion) find_package(ParMETIS) +include(AddParMETISFlags) find_package(SuperLU) +include(AddSuperLUFlags) diff --git a/cmake/modules/FindSuperLU.cmake b/cmake/modules/FindSuperLU.cmake index 93ec31d5d629b14e3c165aa1ecb0454b0fe283b8..1ac9c427248ac209553cda5486545d05a8090a9c 100644 --- a/cmake/modules/FindSuperLU.cmake +++ b/cmake/modules/FindSuperLU.cmake @@ -15,19 +15,6 @@ # 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)