Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
077ab577
Commit
077ab577
authored
Mar 08, 2019
by
Bartosz Kosiorek
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: add short version of '--target <tgt>...' option
parent
071f5e15
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
Help/manual/cmake.1.rst
Help/manual/cmake.1.rst
+1
-1
Help/release/dev/cmake-short-target-option.rst
Help/release/dev/cmake-short-target-option.rst
+6
-0
Source/cmakemain.cxx
Source/cmakemain.cxx
+5
-3
Tests/RunCMake/CommandLine/RunCMakeTest.cmake
Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+1
-1
No files found.
Help/manual/cmake.1.rst
View file @
077ab577
...
...
@@ -276,7 +276,7 @@ following options:
The :envvar:`CMAKE_BUILD_PARALLEL_LEVEL` environment variable, if set,
specifies a default parallel level when this option is not given.
``--target <tgt>...``
``--target
<tgt>..., -t
<tgt>...``
Build ``<tgt>`` instead of default targets. May be specified multiple times.
``--config <cfg>``
...
...
Help/release/dev/cmake-short-target-option.rst
0 → 100644
View file @
077ab577
cmake-short-target-option
----------------------------
* The :manual:`cmake(1)` ``--target`` parameter gained shorter
version ``-t``, e.g. ``cmake --build . -t Library1 Library2`` is
equivalant to ``cmake --build . --target Library1 Library2``.
Source/cmakemain.cxx
View file @
077ab577
...
...
@@ -58,12 +58,13 @@ static const char* cmDocumentationUsageNote[][2] = {
" = Build in parallel using the given number of jobs. \n" \
" If <jobs> is omitted the native build tool's \n" \
" default number is used.\n" \
" The CMAKE_BUILD_PARALLEL_LEVEL environment " \
"variable\n" \
" specifies a default parallel level when this " \
"option\n" \
" is not given.\n" \
" --target <tgt>
= Build <tgt> instead of default targets.\n"
\
"
May be specified multiple times.\n"
\
" --target <tgt>
..., -t <tgt>... \n"
\
"
= Build <tgt> instead of default targets.\n"
\
" --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \
" --clean-first = Build target 'clean' first, then build.\n" \
" (To clean only, use --target 'clean'.)\n" \
...
...
@@ -429,7 +430,8 @@ static int do_build(int ac, char const* const* av)
dir
.
clear
();
}
doing
=
DoingNone
;
}
else
if
(
strcmp
(
av
[
i
],
"--target"
)
==
0
)
{
}
else
if
((
strcmp
(
av
[
i
],
"--target"
)
==
0
)
||
(
strcmp
(
av
[
i
],
"-t"
)
==
0
))
{
doing
=
DoingTarget
;
}
else
if
(
strcmp
(
av
[
i
],
"--config"
)
==
0
)
{
doing
=
DoingConfig
;
...
...
Tests/RunCMake/CommandLine/RunCMakeTest.cmake
View file @
077ab577
...
...
@@ -106,7 +106,7 @@ function(run_BuildDir)
run_cmake_command
(
BuildDir--build
${
CMAKE_COMMAND
}
-E chdir ..
${
CMAKE_COMMAND
}
--build BuildDir-build --target CustomTarget
)
run_cmake_command
(
BuildDir--build-multiple-targets
${
CMAKE_COMMAND
}
-E chdir ..
${
CMAKE_COMMAND
}
--build BuildDir-build -
-targe
t CustomTarget2 --target CustomTarget3
)
${
CMAKE_COMMAND
}
--build BuildDir-build -t CustomTarget2 --target CustomTarget3
)
run_cmake_command
(
BuildDir--build-multiple-targets-jobs
${
CMAKE_COMMAND
}
-E chdir ..
${
CMAKE_COMMAND
}
--build BuildDir-build --target CustomTarget CustomTarget2 -j2 --target CustomTarget3
)
run_cmake_command
(
BuildDir--build-multiple-targets-with-clean-first
${
CMAKE_COMMAND
}
-E chdir ..
...
...
Brad King
@brad.king
mentioned in commit
accbf41d
·
Mar 14, 2019
mentioned in commit
accbf41d
mentioned in commit accbf41da54ee9cbbedd040676e02ee57d47b73b
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