ENH: Add test for make variable replacement in a custom command with the VERBATIM option.
This commit is contained in:
parent
7fc72e6471
commit
306e3e573f
|
@ -42,6 +42,8 @@ ADD_CUSTOM_COMMAND(
|
||||||
MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/wrapped.h
|
MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/wrapped.h
|
||||||
COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/wrapper
|
COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/wrapper
|
||||||
${PROJECT_BINARY_DIR}/wrapped.c ${PROJECT_BINARY_DIR}/wrapped_help.c
|
${PROJECT_BINARY_DIR}/wrapped.c ${PROJECT_BINARY_DIR}/wrapped_help.c
|
||||||
|
${CMAKE_CFG_INTDIR} # this argument tests passing of the configuration
|
||||||
|
VERBATIM # passing of configuration should work in this mode
|
||||||
)
|
)
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -14,5 +15,16 @@ int main(int argc, char *argv[])
|
||||||
fp = fopen(argv[2],"w");
|
fp = fopen(argv[2],"w");
|
||||||
fprintf(fp,"int wrapped_help() { return 5; }\n");
|
fprintf(fp,"int wrapped_help() { return 5; }\n");
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
#ifdef CMAKE_INTDIR
|
||||||
|
const char* cfg = (argc >= 4)? argv[3] : "";
|
||||||
|
if(strcmp(cfg, CMAKE_INTDIR) != 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr,
|
||||||
|
"Did not receive expected configuration argument:\n"
|
||||||
|
" expected [" CMAKE_INTDIR "]\n"
|
||||||
|
" received [%s]\n", cfg);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue