diff options
author | Michael Wild <themiwi@users.sourceforge.net> | 2010-10-08 07:16:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-03-15 19:07:30 (GMT) |
commit | abbaa123aa0bc7c1d712a7cde018dfbdcccf0c43 (patch) | |
tree | 51001eb965723df570cf2efa65c03d723ba3afe8 /Tests/CMakeTests | |
parent | 0554e5e50f6eb3117b4e207f4b01876dbe5a75a4 (diff) | |
download | CMake-abbaa123aa0bc7c1d712a7cde018dfbdcccf0c43.zip CMake-abbaa123aa0bc7c1d712a7cde018dfbdcccf0c43.tar.gz CMake-abbaa123aa0bc7c1d712a7cde018dfbdcccf0c43.tar.bz2 |
Add module ProcessorCount.cmake (#11302)
Credit goes to David Cole ( http://www.kitware.com/blog/home/post/63 ).
Also add a script-based test of the new module.
Signed-off-by: Michael Wild <themiwi@users.sourceforge.net>
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r-- | Tests/CMakeTests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/CMakeTests/ProcessorCountTest.cmake.in | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index cceef3b..5cb50c9 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -27,6 +27,7 @@ AddCMakeTest(String "") AddCMakeTest(Math "") AddCMakeTest(CMakeMinimumRequired "") AddCMakeTest(CompilerIdVendor "") +AddCMakeTest(ProcessorCount "") AddCMakeTest(FileDownload "") set_property(TEST CMake.FileDownload PROPERTY diff --git a/Tests/CMakeTests/ProcessorCountTest.cmake.in b/Tests/CMakeTests/ProcessorCountTest.cmake.in new file mode 100644 index 0000000..0815fd8 --- /dev/null +++ b/Tests/CMakeTests/ProcessorCountTest.cmake.in @@ -0,0 +1,9 @@ +include(ProcessorCount) + +ProcessorCount(processor_count) +message("processor_count='${processor_count}'") + +if(processor_count EQUAL 0) + message(FATAL_ERROR "could not determine number of processors +- Additional code needed in ProcessorCount.cmake?") +endif() |