Browse Source

FindOpenACC: Set OpenACC_FOUND when OpenACC is enabled for a language

Robert Maynard 3 years ago
parent
commit
9a6f74ffa2
1 changed files with 10 additions and 0 deletions
  1. 10 0
      Modules/FindOpenACC.cmake

+ 10 - 0
Modules/FindOpenACC.cmake

@@ -27,6 +27,13 @@ The module provides :prop_tgt:`IMPORTED` targets:
 Variables
 Variables
 ^^^^^^^^^
 ^^^^^^^^^
 
 
+The module defines the following variables:
+
+``OpenACC_FOUND``
+  .. versionadded:: 3.25
+
+  Variable indicating that OpenACC flags for at least one languages have been found.
+
 This module will set the following variables per language in your
 This module will set the following variables per language in your
 project, where ``<lang>`` is one of C, CXX, or Fortran:
 project, where ``<lang>`` is one of C, CXX, or Fortran:
 
 
@@ -270,6 +277,9 @@ foreach (LANG IN ITEMS C CXX Fortran)
       REQUIRED_VARS OpenACC_${LANG}_FLAGS
       REQUIRED_VARS OpenACC_${LANG}_FLAGS
       VERSION_VAR OpenACC_${LANG}_VERSION
       VERSION_VAR OpenACC_${LANG}_VERSION
     )
     )
+    if(OpenACC_${LANG}_FOUND)
+      set(OpenACC_FOUND TRUE)
+    endif()
   endif()
   endif()
 endforeach()
 endforeach()