https://github.com/Kitware/CMake
Raw File
Tip revision: ebea30a1edced8d74c42b35c129a3f32d553115c authored by Brad King on 04 February 2020, 14:02:13 UTC
CMake 3.15.7
Tip revision: ebea30a
BundleTest.cxx
#include <stdio.h>

#include <CoreFoundation/CoreFoundation.h>

extern int foo(char* exec);

int main(int argc, char* argv[])
{
  printf("Started with: %d arguments\n", argc);

  // Call a CoreFoundation function... but pull in the link dependency on
  // "-framework
  // CoreFoundation" via CMake's dependency chaining mechanism. This code
  // exists to
  // verify that the chaining mechanism works with "-framework blah" style
  // link dependencies.
  //
  CFBundleRef br = CFBundleGetMainBundle();
  (void)br;

  return foo(argv[0]);
}
back to top