[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.41 1.42 wrapper.cxx 1.5 1.6
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Jun 4 12:11:02 EDT 2008
Update of /cvsroot/CMake/CMake/Tests/CustomCommand
In directory public:/mounts/ram/cvs-serv19260/Tests/CustomCommand
Modified Files:
CMakeLists.txt wrapper.cxx
Log Message:
ENH: Add test for make variable replacement in a custom command with the VERBATIM option.
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/CMakeLists.txt,v
retrieving revision 1.41
retrieving revision 1.42
diff -C 2 -d -r1.41 -r1.42
*** CMakeLists.txt 2 Jun 2008 20:45:07 -0000 1.41
--- CMakeLists.txt 4 Jun 2008 16:10:59 -0000 1.42
***************
*** 43,46 ****
--- 43,48 ----
COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/wrapper
${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
)
Index: wrapper.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/wrapper.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -C 2 -d -r1.5 -r1.6
*** wrapper.cxx 13 Apr 2006 19:28:57 -0000 1.5
--- wrapper.cxx 4 Jun 2008 16:10:59 -0000 1.6
***************
*** 1,3 ****
--- 1,4 ----
#include <stdio.h>
+ #include <string.h>
int main(int argc, char *argv[])
***************
*** 15,18 ****
--- 16,30 ----
fprintf(fp,"int wrapped_help() { return 5; }\n");
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;
}
More information about the Cmake-commits
mailing list