How to find third-party header files in /Applications on MacOS?

What CMAKE_ variable should I include in the PATHS argument to find_file(), such that /Applications will be searched on MacOS?

For example: I’m running MacOS 10.13.6 (“High Sierra”), and I’ve installed a third-party application (GMT-6.1.1) and headers via a downloaded .dmg file into /Applications. My own application must be compiled with GMT headers, which are in this directory:

/Applications//GMT-6.1.1.app/Contents/Resources/include/gmt/

Of course I want to avoid hard-coding “/Applications” in my cmake scripts…

I would do something like:

set(_gmt_roots ${GMT_APP_ROOTS} /Applications) # document this variable
set(_gmt_versions ${GMT_APP_VERSIONS} 6.1.1) # document this variable
set(_gmt_prefixes)
foreach (_gmt_version IN LISTS _gmt_versions)
  foreach (_gmt_root IN LISTS _gmt_roots)
    list(APPEND _gmt_prefixes "${_gmt_root}/GMT-${_gmt_version}.app/Contents/Resources/include")
  endforeach ()
endforeach ()
unset(_gmt_versions)
unset(_gmt_version)
unset(_gmt_root)
unset(_gmt_roots)

find_file(GMT_INCLUDE_DIR
  NAMES gmt/someheader.h
  PATHS ${_gmt_prefixes}
  DOC "…")
mark_as_advanced(GMT_INCLUDE_DIR)
unset(_gmt_prefixes)

Note that you might want other roots or prefix logic based on the platform you’re on.