BUG: Fix new custom command with make-var expansion test on VS6. The VS6 IDE adds some extra characters to the variable value during expansion.

This commit is contained in:
Brad King 2008-06-05 10:01:16 -04:00
parent a9a33a5c5e
commit 3ecfb5f7e8
1 changed files with 8 additions and 2 deletions

View File

@ -16,12 +16,18 @@ int main(int argc, char *argv[])
fprintf(fp,"int wrapped_help() { return 5; }\n"); fprintf(fp,"int wrapped_help() { return 5; }\n");
fclose(fp); fclose(fp);
#ifdef CMAKE_INTDIR #ifdef CMAKE_INTDIR
/* The VS6 IDE passes a leading ".\\" in its variable expansion. */
# if defined(_MSC_VER) && _MSC_VER == 1200
# define CFG_DIR ".\\" CMAKE_INTDIR
# else
# define CFG_DIR CMAKE_INTDIR
# endif
const char* cfg = (argc >= 4)? argv[3] : ""; const char* cfg = (argc >= 4)? argv[3] : "";
if(strcmp(cfg, CMAKE_INTDIR) != 0) if(strcmp(cfg, CFG_DIR) != 0)
{ {
fprintf(stderr, fprintf(stderr,
"Did not receive expected configuration argument:\n" "Did not receive expected configuration argument:\n"
" expected [" CMAKE_INTDIR "]\n" " expected [" CFG_DIR "]\n"
" received [%s]\n", cfg); " received [%s]\n", cfg);
return 1; return 1;
} }