diff --git a/cmake/modules/FindParMETIS.cmake b/cmake/modules/FindParMETIS.cmake index 010d9c7f36368364bd303ede9191902e242d07ef..ec5bb6b88ce3636988ecae3ea4db68e9d4a5f29c 100644 --- a/cmake/modules/FindParMETIS.cmake +++ b/cmake/modules/FindParMETIS.cmake @@ -98,9 +98,10 @@ if(PARMETIS_FOUND) "Library directory: ${PARMETIS_LIBRARIES}\n\n") endif(PARMETIS_FOUND) -# register all ParMETIS related flags +#add all parmetis related flags to ALL_PKG_FLAGS, this must happen regardless of a target using add_dune_parmetis_flags if(PARMETIS_FOUND) - dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_PARMETIS=1" - LIBRARIES "${PARMETIS_LIBRARIES}" - INCLUDE_DIRS "${PARMETIS_INCLUDE_DIRS}") + foreach(dir ${PARMETIS_INCLUDE_DIRS}) + set_property(GLOBAL APPEND PROPERTY ALL_PKG_FLAGS "-I${dir}") + endforeach() + set_property(GLOBAL APPEND PROPERTY ALL_PKG_LIBS "${PARMETIS_LIBRARIES}") endif()