diff options
author | Brad King <brad.king@kitware.com> | 2023-01-18 15:47:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-01-18 15:48:35 (GMT) |
commit | 427538b78e65ece37b135a86189c4251f1c4ccb8 (patch) | |
tree | 2feb1fb29329dad0d28d68c2e2febc2e935933a3 | |
parent | bdb4a4136b5f3b2233d958f8ce3decd0d981c1f4 (diff) | |
parent | 93624e4c3d7dbf3e1a2ad60566ec012624116409 (diff) | |
download | CMake-427538b78e65ece37b135a86189c4251f1c4ccb8.zip CMake-427538b78e65ece37b135a86189c4251f1c4ccb8.tar.gz CMake-427538b78e65ece37b135a86189c4251f1c4ccb8.tar.bz2 |
Merge topic 'docpc'
93624e4c3d Help:ProcessorCount: recommend cmake_host_system_information
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8077
-rw-r--r-- | Modules/ProcessorCount.cmake | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake index bda23ab..47e266d 100644 --- a/Modules/ProcessorCount.cmake +++ b/Modules/ProcessorCount.cmake @@ -22,9 +22,17 @@ This function is guaranteed to return a positive integer (>=1) if it succeeds. It returns 0 if there's a problem determining the processor count. +More generally accurate physical CPU count can be obtained via +:command:`cmake_host_system_information`: + +.. code-block:: cmake + + cmake_host_system_information(RESULT N + QUERY NUMBER_OF_PHYSICAL_CORES) + Example use, in a ctest -S dashboard script: -:: +.. code-block:: cmake include(ProcessorCount) ProcessorCount(N) @@ -33,8 +41,6 @@ Example use, in a ctest -S dashboard script: set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) endif() - - This function is intended to offer an approximation of the value of the number of compute cores available on the current machine, such that you may use that value for parallel building and parallel |