Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
b8828ecb
Commit
b8828ecb
authored
Jul 11, 2019
by
Kyle Edwards
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake -E: Add true and false commands
parent
0a690fc4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
0 deletions
+29
-0
Help/manual/cmake.1.rst
Help/manual/cmake.1.rst
+6
-0
Help/release/dev/cmake-e-true-false.rst
Help/release/dev/cmake-e-true-false.rst
+5
-0
Source/cmcmd.cxx
Source/cmcmd.cxx
+12
-0
Tests/RunCMake/CommandLine/E_false-extraargs-result.txt
Tests/RunCMake/CommandLine/E_false-extraargs-result.txt
+1
-0
Tests/RunCMake/CommandLine/E_false-result.txt
Tests/RunCMake/CommandLine/E_false-result.txt
+1
-0
Tests/RunCMake/CommandLine/RunCMakeTest.cmake
Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+4
-0
No files found.
Help/manual/cmake.1.rst
View file @
b8828ecb
...
...
@@ -604,6 +604,12 @@ Available commands are:
.. note::
Path to where ``<new>`` symbolic link will be created has to exist beforehand.
``true``
Do nothing, with an exit code of 0.
``false``
Do nothing, with an exit code of 1.
Windows-specific Command-Line Tools
-----------------------------------
...
...
Help/release/dev/cmake-e-true-false.rst
0 → 100644
View file @
b8828ecb
cmake-e-true-false
------------------
* :manual:`cmake(1)` ``-E`` now supports ``true`` and ``false`` commands, which
do nothing while returning exit codes of 0 and 1, respectively.
Source/cmcmd.cxx
View file @
b8828ecb
...
...
@@ -114,6 +114,8 @@ void CMakeCommandUsage(const char* program)
<<
" touch <file>... - touch a <file>.
\n
"
<<
" touch_nocreate <file>... - touch a <file> but do not create it.
\n
"
<<
" create_symlink old new - create a symbolic link new -> old
\n
"
<<
" true - do nothing with an exit code of 0
\n
"
<<
" false - do nothing with an exit code of 1
\n
"
#if defined(_WIN32) && !defined(__CYGWIN__)
<<
"Available on Windows only:
\n
"
<<
" delete_regv key - delete registry value
\n
"
...
...
@@ -891,6 +893,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return
0
;
}
// Command to do nothing with an exit code of 0.
if
(
args
[
1
]
==
"true"
)
{
return
0
;
}
// Command to do nothing with an exit code of 1.
if
(
args
[
1
]
==
"false"
)
{
return
1
;
}
// Internal CMake shared library support.
if
(
args
[
1
]
==
"cmake_symlink_library"
&&
args
.
size
()
==
5
)
{
return
cmcmd
::
SymlinkLibrary
(
args
);
...
...
Tests/RunCMake/CommandLine/E_false-extraargs-result.txt
0 → 100644
View file @
b8828ecb
1
Tests/RunCMake/CommandLine/E_false-result.txt
0 → 100644
View file @
b8828ecb
1
Tests/RunCMake/CommandLine/RunCMakeTest.cmake
View file @
b8828ecb
...
...
@@ -26,6 +26,10 @@ run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append)
run_cmake_command
(
E_rename-no-arg
${
CMAKE_COMMAND
}
-E rename
)
run_cmake_command
(
E_server-arg
${
CMAKE_COMMAND
}
-E server --extra-arg
)
run_cmake_command
(
E_server-pipe
${
CMAKE_COMMAND
}
-E server --pipe=
)
run_cmake_command
(
E_true
${
CMAKE_COMMAND
}
-E true
)
run_cmake_command
(
E_true-extraargs
${
CMAKE_COMMAND
}
-E true ignored
)
run_cmake_command
(
E_false
${
CMAKE_COMMAND
}
-E false
)
run_cmake_command
(
E_false-extraargs
${
CMAKE_COMMAND
}
-E false ignored
)
run_cmake_command
(
E_touch_nocreate-no-arg
${
CMAKE_COMMAND
}
-E touch_nocreate
)
run_cmake_command
(
E_touch-nonexistent-dir
${
CMAKE_COMMAND
}
-E touch
"
${
RunCMake_BINARY_DIR
}
/touch-nonexistent-dir/foo"
)
...
...
Brad King
@brad.king
mentioned in commit
8212b088
·
Jul 12, 2019
mentioned in commit
8212b088
mentioned in commit 8212b0880d4b481496306535b58adcd9121fd71b
Toggle commit list
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