[cmake-commits] king committed CMakeLists.txt 1.19 1.20
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Apr 25 17:22:09 EDT 2007
Update of /cvsroot/CMake/CMake/Tests/StringFileTest
In directory public:/mounts/ram/cvs-serv16388/Tests/StringFileTest
Modified Files:
CMakeLists.txt
Log Message:
ENH: Added FILE(STRINGS) command.
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/StringFileTest/CMakeLists.txt,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- CMakeLists.txt 23 Oct 2006 21:14:20 -0000 1.19
+++ CMakeLists.txt 25 Apr 2007 21:22:07 -0000 1.20
@@ -4,6 +4,18 @@
# Read file test
FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile)
+# FILE(STRINGS) test
+FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings
+ LIMIT_COUNT 1 LIMIT_INPUT 1024 LIMIT_OUTPUT 1024
+ LENGTH_MINIMUM 10 LENGTH_MAXIMUM 23 REGEX include NEWLINE_CONSUME)
+SET(infile_strings_goal "#include \"includefile\"\n")
+IF("${infile_strings}" STREQUAL "${infile_strings_goal}")
+ MESSAGE("FILE(STRINGS) correctly read [${infile_strings}]")
+ELSE("${infile_strings}" STREQUAL "${infile_strings_goal}")
+ MESSAGE(SEND_ERROR
+ "FILE(STRINGS) incorrectly read [${infile_strings}]")
+ENDIF("${infile_strings}" STREQUAL "${infile_strings_goal}")
+
# String test
STRING(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great")
STRING(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake")
More information about the Cmake-commits
mailing list