ctest_build([BUILD <build-dir>] [APPEND] [CONFIGURATION <config>] [FLAGS <flags>] [PROJECT_NAME <project-name>] [TARGET <target-name>] [NUMBER_ERRORS <num-err-var>] [NUMBER_WARNINGS <num-warn-var>] [RETURN_VALUE <result-var>] [CAPTURE_CMAKE_ERROR <result-var>] )
Build the project and store results in
for submission with the
CTEST_BUILD_COMMAND variable may be set to explicitly
specify the build command line. Otherwise the build command line is
computed automatically based on the options given.
The options are:
- Specify the top-level build directory. If not given, the
CTEST_BINARY_DIRECTORYvariable is used.
Build.xmlfor append to results previously submitted to a dashboard server since the last
ctest_start()call. Append semantics are defined by the dashboard server in use. This does not cause results to be appended to a
.xmlfile produced by a previous call to this command.
- Specify the build configuration (e.g.
Debug). If not specified the
CTEST_BUILD_CONFIGURATIONvariable will be checked. Otherwise the
-C <cfg>option given to the
ctest(1)command will be used, if any.
- Pass additional arguments to the underlying build command.
If not specified the
CTEST_BUILD_FLAGSvariable will be checked. This can, e.g., be used to trigger a parallel build using the
-joption of make. See the
ProcessorCountmodule for an example.
- Set the name of the project to build. This should correspond
to the top-level call to the
project()command. If not specified the
CTEST_PROJECT_NAMEvariable will be checked.
- Specify the name of a target to build. If not specified the
CTEST_BUILD_TARGETvariable will be checked. Otherwise the default target will be built. This is the “all” target (called
ALL_BUILDin Visual Studio Generators).
- Store the number of build errors detected in the given variable.
- Store the number of build warnings detected in the given variable.
- Store the return value of the native build tool in the given variable.
- Store in the
<result-var>variable -1 if there are any errors running the command and prevent ctest from returning non-zero if an error occurs.
- Suppress any CTest-specific non-error output that would have been printed to the console otherwise. The summary of warnings / errors, as well as the output from the native build tool is unaffected by this option.