Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
c690311b
Commit
c690311b
authored
Dec 30, 2005
by
Andy Cedilnik
Browse files
ENH: Add a way to compare two files
parent
bb618a7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/cmake.cxx
View file @
c690311b
...
@@ -718,6 +718,7 @@ void CMakeCommandUsage(const char* program)
...
@@ -718,6 +718,7 @@ void CMakeCommandUsage(const char* program)
<<
" copy file destination - copy file to destination (either file or directory)
\n
"
<<
" copy file destination - copy file to destination (either file or directory)
\n
"
<<
" copy_if_different in-file out-file - copy file if input has changed
\n
"
<<
" copy_if_different in-file out-file - copy file if input has changed
\n
"
<<
" copy_directory source destination - copy directory 'source' content to directory 'destination'
\n
"
<<
" copy_directory source destination - copy directory 'source' content to directory 'destination'
\n
"
<<
" compare_files file1 file2 - check if file1 is same as file2
\n
"
<<
" echo [string]... - displays arguments as text
\n
"
<<
" echo [string]... - displays arguments as text
\n
"
<<
" remove file1 file2 ... - remove the file(s)
\n
"
<<
" remove file1 file2 ... - remove the file(s)
\n
"
<<
" tar [cxt][vfz] file.tar file/dir1 file/dir2 ... - create a tar.
\n
"
<<
" tar [cxt][vfz] file.tar file/dir1 file/dir2 ... - create a tar.
\n
"
...
@@ -777,6 +778,19 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
...
@@ -777,6 +778,19 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
return
0
;
return
0
;
}
}
// Compare files
if
(
args
[
1
]
==
"compare_files"
&&
args
.
size
()
==
4
)
{
if
(
cmSystemTools
::
FilesDiffer
(
args
[
2
].
c_str
(),
args
[
3
].
c_str
()))
{
std
::
cerr
<<
"Files
\"
"
<<
args
[
2
].
c_str
()
<<
"
\"
to
\"
"
<<
args
[
3
].
c_str
()
<<
"
\"
are different.
\n
"
;
return
1
;
}
return
0
;
}
// Echo string
// Echo string
else
if
(
args
[
1
]
==
"echo"
)
else
if
(
args
[
1
]
==
"echo"
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment