Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Tests / CustomCommand / wrapper.cxx
blob93cb079fe4f4a02a98596d62e685d741113851af
1 #include <stdio.h>
2 #include <string.h>
4 int main(int argc, char *argv[])
6 if ( argc < 3 )
8 fprintf(stderr, "Usage: %s <file1> <file2>\n", argv[0]);
9 return 1;
11 FILE *fp = fopen(argv[1],"w");
12 fprintf(fp,"extern int wrapped_help();\n");
13 fprintf(fp,"int wrapped() { return wrapped_help(); }\n");
14 fclose(fp);
15 fp = fopen(argv[2],"w");
16 fprintf(fp,"int wrapped_help() { return 5; }\n");
17 fclose(fp);
18 #ifdef CMAKE_INTDIR
19 /* The VS6 IDE passes a leading ".\\" in its variable expansion. */
20 # if defined(_MSC_VER) && _MSC_VER == 1200
21 # define CFG_DIR ".\\" CMAKE_INTDIR
22 # else
23 # define CFG_DIR CMAKE_INTDIR
24 # endif
25 const char* cfg = (argc >= 4)? argv[3] : "";
26 if(strcmp(cfg, CFG_DIR) != 0)
28 fprintf(stderr,
29 "Did not receive expected configuration argument:\n"
30 " expected [" CFG_DIR "]\n"
31 " received [%s]\n", cfg);
32 return 1;
34 #endif
35 return 0;