ctest_build.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ctest_build
  2. -----------
  3. Perform the :ref:`CTest Build Step` as a :ref:`Dashboard Client`.
  4. ::
  5. ctest_build([BUILD <build-dir>] [APPEND]
  6. [CONFIGURATION <config>]
  7. [FLAGS <flags>]
  8. [PROJECT_NAME <project-name>]
  9. [TARGET <target-name>]
  10. [NUMBER_ERRORS <num-err-var>]
  11. [NUMBER_WARNINGS <num-warn-var>]
  12. [RETURN_VALUE <result-var>]
  13. [CAPTURE_CMAKE_ERROR <result-var>]
  14. )
  15. Build the project and store results in ``Build.xml``
  16. for submission with the :command:`ctest_submit` command.
  17. The :variable:`CTEST_BUILD_COMMAND` variable may be set to explicitly
  18. specify the build command line. Otherwise the build command line is
  19. computed automatically based on the options given.
  20. The options are:
  21. ``BUILD <build-dir>``
  22. Specify the top-level build directory. If not given, the
  23. :variable:`CTEST_BINARY_DIRECTORY` variable is used.
  24. ``APPEND``
  25. Mark ``Build.xml`` for append to results previously submitted to a
  26. dashboard server since the last :command:`ctest_start` call.
  27. Append semantics are defined by the dashboard server in use.
  28. This does *not* cause results to be appended to a ``.xml`` file
  29. produced by a previous call to this command.
  30. ``CONFIGURATION <config>``
  31. Specify the build configuration (e.g. ``Debug``). If not
  32. specified the ``CTEST_BUILD_CONFIGURATION`` variable will be checked.
  33. Otherwise the ``-C <cfg>`` option given to the :manual:`ctest(1)`
  34. command will be used, if any.
  35. ``FLAGS <flags>``
  36. Pass additional arguments to the underlying build command.
  37. If not specified the ``CTEST_BUILD_FLAGS`` variable will be checked.
  38. This can, e.g., be used to trigger a parallel build using the
  39. ``-j`` option of make. See the :module:`ProcessorCount` module
  40. for an example.
  41. ``PROJECT_NAME <project-name>``
  42. Ignored. This was once used but is no longer needed.
  43. ``TARGET <target-name>``
  44. Specify the name of a target to build. If not specified the
  45. ``CTEST_BUILD_TARGET`` variable will be checked. Otherwise the
  46. default target will be built. This is the "all" target
  47. (called ``ALL_BUILD`` in :ref:`Visual Studio Generators`).
  48. ``NUMBER_ERRORS <num-err-var>``
  49. Store the number of build errors detected in the given variable.
  50. ``NUMBER_WARNINGS <num-warn-var>``
  51. Store the number of build warnings detected in the given variable.
  52. ``RETURN_VALUE <result-var>``
  53. Store the return value of the native build tool in the given variable.
  54. ``CAPTURE_CMAKE_ERROR <result-var>``
  55. Store in the ``<result-var>`` variable -1 if there are any errors running
  56. the command and prevent ctest from returning non-zero if an error occurs.
  57. ``QUIET``
  58. Suppress any CTest-specific non-error output that would have been
  59. printed to the console otherwise. The summary of warnings / errors,
  60. as well as the output from the native build tool is unaffected by
  61. this option.