diff options
author | Brad King <brad.king@kitware.com> | 2013-12-03 14:30:31 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-12-03 14:30:31 (GMT) |
commit | 1af0c41278567fa67e19d120b46058118f7a0d44 (patch) | |
tree | 8f42fff01ba089e8140ff31025c53a286147c7f6 /Modules | |
parent | 2e8ce4d5162daddbc7c667723b47344a29bb318e (diff) | |
parent | eef42a0de6764628187263aca4a6cbabb6592501 (diff) | |
download | CMake-1af0c41278567fa67e19d120b46058118f7a0d44.zip CMake-1af0c41278567fa67e19d120b46058118f7a0d44.tar.gz CMake-1af0c41278567fa67e19d120b46058118f7a0d44.tar.bz2 |
Merge topic 'Haiku-CPU-count'
eef42a0 ProcessorCount: make it work on Haiku
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ProcessorCount.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake index 22ee776..0fe0b32 100644 --- a/Modules/ProcessorCount.cmake +++ b/Modules/ProcessorCount.cmake @@ -182,6 +182,20 @@ function(ProcessorCount var) endif() endif() + if(NOT count) + # Haiku + find_program(ProcessorCount_cmd_sysinfo sysinfo) + if(ProcessorCount_cmd_sysinfo) + execute_process(COMMAND ${ProcessorCount_cmd_sysinfo} + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + OUTPUT_VARIABLE sysinfo_X_output) + string(REGEX MATCHALL "\nCPU #[0-9]+:" procs "\n${sysinfo_X_output}") + list(LENGTH procs count) + #message("ProcessorCount: trying sysinfo '${ProcessorCount_cmd_sysinfo}'") + endif() + endif() + # Since cygwin builds of CMake do not define WIN32 anymore, but they still # run on Windows, and will still have this env var defined: # |