@@ -68,8 +68,8 @@ def configure(self, variables=None, build_script_folder=None, cli_args=None,
6868 :ref:`CMakeToolchain<conan-cmake-toolchain>` to get:
6969
7070 - The generator, to append ``-G="xxx"``.
71- - The path to the toolchain and append ``-DCMAKE_TOOLCHAIN_FILE=/path/conan_toolchain.cmake``
72- - The declared ``cache variables`` and append ``-Dxxx``.
71+ - Toolchain path to append ``-DCMAKE_TOOLCHAIN_FILE=/path/conan_toolchain.cmake``
72+ - The declared ``cache variables`` to append ``-Dxxx``.
7373
7474 and call ``cmake``.
7575
@@ -83,9 +83,9 @@ def configure(self, variables=None, build_script_folder=None, cli_args=None,
8383 ``self.folders.source`` at the ``layout()`` method.
8484 :param cli_args: List of arguments ``[arg1, arg2, ...]`` that will be passed
8585 as extra CLI arguments to pass to cmake invocation
86- :param subfolder: (Experimental): The name of a subfolder to be created inside the ``build_folder``
87- and the ``package_folder``. If not provided, files will be placed
88- in the ``build_folder`` and the ``package_folder`` root.
86+ :param subfolder: (Experimental): subfolder to be created inside the ``build_folder`` and
87+ the ``package_folder``. If not provided, files will be
88+ placed in the ``build_folder`` and ``package_folder`` root.
8989 :param stdout: Use it to redirect stdout to this stream
9090 :param stderr: Use it to redirect stderr to this stream
9191 """
@@ -186,23 +186,25 @@ def build(self, build_type=None, target=None, cli_args=None, build_tool_args=Non
186186 for a multi-configuration generator (e.g. Visual Studio, XCode).
187187 This value will be ignored for single-configuration generators, they will
188188 use the one defined in the toolchain file during the install step.
189- :param target: The name of a single build target as a string, or names of multiple build targets in a
190- list of strings to be passed to the ``--target`` argument.
189+ :param target: The name of a single build target as a string, or names of multiple build
190+ targets in a list of strings to be passed to the ``--target`` argument.
191191 :param cli_args: A list of arguments ``[arg1, arg2, ...]`` that will be passed to the
192192 ``cmake --build ... arg1 arg2`` command directly.
193193 :param build_tool_args: A list of arguments ``[barg1, barg2, ...]`` for the underlying
194194 build system that will be passed to the command
195195 line after the ``--`` indicator: ``cmake --build ... -- barg1 barg2``
196- :param subfolder: (Experimental): The name of a subfolder to be created inside the ``build_folder``
197- and the ``package_folder``. If not provided, files will be placed
198- in the ``build_folder`` and the ``package_folder`` root.
196+ :param subfolder: (Experimental): subfolder to be created inside the ``build_folder`` and
197+ the ``package_folder``. If not provided, files will be
198+ placed in the ``build_folder`` and ``package_folder`` root.
199199 :param stdout: Use it to redirect stdout to this stream
200200 :param stderr: Use it to redirect stderr to this stream
201201 """
202202 self ._conanfile .output .info ("Running CMake.build()" )
203- self ._build (build_type , target , cli_args , build_tool_args , subfolder = subfolder , stdout = stdout , stderr = stderr )
203+ self ._build (build_type , target , cli_args , build_tool_args , subfolder = subfolder ,
204+ stdout = stdout , stderr = stderr )
204205
205- def install (self , build_type = None , component = None , cli_args = None , stdout = None , stderr = None , subfolder = None ):
206+ def install (self , build_type = None , component = None , cli_args = None , stdout = None , stderr = None ,
207+ subfolder = None ):
206208 """
207209 Equivalent to running ``cmake --install``
208210
@@ -213,9 +215,9 @@ def install(self, build_type=None, component=None, cli_args=None, stdout=None, s
213215 not build type.
214216 :param cli_args: A list of arguments ``[arg1, arg2, ...]`` for the underlying build system
215217 that will be passed to the command line: ``cmake --install ... arg1 arg2``
216- :param subfolder: (Experimental): The name of a subfolder to be created inside the ``build_folder``
217- and the ``package_folder``. If not provided, files will be placed
218- in the ``build_folder`` and the ``package_folder`` root.
218+ :param subfolder: (Experimental): subfolder to be created inside the ``build_folder`` and
219+ the ``package_folder``. If not provided, files will be
220+ placed in the ``build_folder`` and ``package_folder`` root.
219221 :param stdout: Use it to redirect stdout to this stream
220222 :param stderr: Use it to redirect stderr to this stream
221223 """
@@ -236,10 +238,12 @@ def install(self, build_type=None, component=None, cli_args=None, stdout=None, s
236238 arg_list .extend (["--component" , component ])
237239 arg_list .extend (self ._compilation_verbosity_arg )
238240
239- deprecated_install_strip = self ._conanfile .conf .get ("tools.cmake:install_strip" , check_type = bool )
241+ deprecated_install_strip = self ._conanfile .conf .get ("tools.cmake:install_strip" ,
242+ check_type = bool )
240243 if deprecated_install_strip :
241- self ._conanfile .output .warning ("The 'tools.cmake:install_strip' configuration is deprecated, "
242- "use 'tools.build:install_strip' instead." , warn_tag = "deprecated" )
244+ self ._conanfile .output .warning ("The 'tools.cmake:install_strip' configuration is "
245+ "deprecated, use 'tools.build:install_strip' instead." ,
246+ warn_tag = "deprecated" )
243247
244248 do_strip = self ._conanfile .conf .get ("tools.build:install_strip" , check_type = bool )
245249 if do_strip or deprecated_install_strip :
@@ -287,7 +291,8 @@ def ctest(self, cli_args=None, env="", stdout=None, stderr=None):
287291 """
288292 Equivalent to running ctest ...
289293
290- :param cli_args: List of arguments ``[arg1, arg2, ...]`` to be passed as extra ctest command line arguments
294+ :param cli_args: List of arguments ``[arg1, arg2, ...]`` to be passed as extra ctest
295+ command line arguments
291296 :param env: the environment files to activate, by default conanbuild + conanrun
292297 :param stdout: Use it to redirect stdout to this stream
293298 :param stderr: Use it to redirect stderr to this stream
@@ -304,11 +309,19 @@ def ctest(self, cli_args=None, env="", stdout=None, stderr=None):
304309 if njobs :
305310 arg_list .append (f"--parallel { njobs } " )
306311
312+ arg_list .extend (cli_args or [])
313+
307314 verbosity = self ._conanfile .conf .get ("tools.build:verbosity" , choices = ("quiet" , "verbose" ))
308315 if verbosity :
316+ # https://cmake.org/cmake/help/latest/manual/ctest.1.html
317+ # Options such as --verbose, --extra-verbose, and --debug are
318+ # ignored if --quiet is specified.
309319 arg_list .append (f"--{ verbosity } " )
310320
311- arg_list .extend (cli_args or [])
321+ extra_args = self ._conanfile .conf .get ("tools.cmake:ctest_args" , check_type = list )
322+ if extra_args :
323+ arg_list .extend (extra_args )
324+
312325 arg_list = " " .join (filter (None , arg_list ))
313326 command = f"ctest { arg_list } "
314327
0 commit comments