https://github.com/Kitware/CMake
Raw File
Tip revision: 105cb4ee02adcb3754a388b71db54ff8a01b1313 authored by Brad King on 13 February 2024, 14:07:34 UTC
CMake 3.29.0-rc1
Tip revision: 105cb4e
CheckVariableExists.c
#ifdef CHECK_VARIABLE_EXISTS

extern int CHECK_VARIABLE_EXISTS;

#  ifdef __CLASSIC_C__
int main()
{
  int ac;
  char* av[];
#  else
int main(int ac, char* av[])
{
#  endif
  if (ac > 1000) {
    return *av[0];
  }
  return CHECK_VARIABLE_EXISTS;
}

#else /* CHECK_VARIABLE_EXISTS */

#  error "CHECK_VARIABLE_EXISTS has to specify the variable"

#endif /* CHECK_VARIABLE_EXISTS */
back to top