diff --git a/scripts/cmake/CheckHeaderCompilation.cmake b/scripts/cmake/CheckHeaderCompilation.cmake index 377ca95b451..199b6090a9f 100644 --- a/scripts/cmake/CheckHeaderCompilation.cmake +++ b/scripts/cmake/CheckHeaderCompilation.cmake @@ -83,6 +83,9 @@ function(_check_header_compilation target) endif() get_target_property(_target_defs ${target} COMPILE_DEFINITIONS) + if(OGS_USE_PETSC) + list(APPEND _target_defs USE_PETSC) + endif() foreach(def ${_target_defs}) # strip generator expressions if(${def} MATCHES "\\$<.*")