ProcessorCount: Mark find_program vars as advanced (#13236)

After each find_program call, mark_as_advanced each find result
variable to avoid polluting the cache with non-advanced variables
This commit is contained in:
David Cole 2012-08-17 10:53:37 -04:00
parent 186e9bdc22
commit 3f9fa5cc7f
1 changed files with 7 additions and 0 deletions

View File

@ -57,6 +57,7 @@ function(ProcessorCount var)
# Mac, FreeBSD, OpenBSD (systems with sysctl): # Mac, FreeBSD, OpenBSD (systems with sysctl):
find_program(ProcessorCount_cmd_sysctl sysctl find_program(ProcessorCount_cmd_sysctl sysctl
PATHS /usr/sbin /sbin) PATHS /usr/sbin /sbin)
mark_as_advanced(ProcessorCount_cmd_sysctl)
if(ProcessorCount_cmd_sysctl) if(ProcessorCount_cmd_sysctl)
execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu
ERROR_QUIET ERROR_QUIET
@ -69,6 +70,7 @@ function(ProcessorCount var)
if(NOT count) if(NOT count)
# Linux (systems with getconf): # Linux (systems with getconf):
find_program(ProcessorCount_cmd_getconf getconf) find_program(ProcessorCount_cmd_getconf getconf)
mark_as_advanced(ProcessorCount_cmd_getconf)
if(ProcessorCount_cmd_getconf) if(ProcessorCount_cmd_getconf)
execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN
ERROR_QUIET ERROR_QUIET
@ -82,6 +84,7 @@ function(ProcessorCount var)
# HPUX (systems with machinfo): # HPUX (systems with machinfo):
find_program(ProcessorCount_cmd_machinfo machinfo find_program(ProcessorCount_cmd_machinfo machinfo
PATHS /usr/contrib/bin) PATHS /usr/contrib/bin)
mark_as_advanced(ProcessorCount_cmd_machinfo)
if(ProcessorCount_cmd_machinfo) if(ProcessorCount_cmd_machinfo)
execute_process(COMMAND ${ProcessorCount_cmd_machinfo} execute_process(COMMAND ${ProcessorCount_cmd_machinfo}
ERROR_QUIET ERROR_QUIET
@ -97,6 +100,7 @@ function(ProcessorCount var)
# IRIX (systems with hinv): # IRIX (systems with hinv):
find_program(ProcessorCount_cmd_hinv hinv find_program(ProcessorCount_cmd_hinv hinv
PATHS /sbin) PATHS /sbin)
mark_as_advanced(ProcessorCount_cmd_hinv)
if(ProcessorCount_cmd_hinv) if(ProcessorCount_cmd_hinv)
execute_process(COMMAND ${ProcessorCount_cmd_hinv} execute_process(COMMAND ${ProcessorCount_cmd_hinv}
ERROR_QUIET ERROR_QUIET
@ -112,6 +116,7 @@ function(ProcessorCount var)
# AIX (systems with lsconf): # AIX (systems with lsconf):
find_program(ProcessorCount_cmd_lsconf lsconf find_program(ProcessorCount_cmd_lsconf lsconf
PATHS /usr/sbin) PATHS /usr/sbin)
mark_as_advanced(ProcessorCount_cmd_lsconf)
if(ProcessorCount_cmd_lsconf) if(ProcessorCount_cmd_lsconf)
execute_process(COMMAND ${ProcessorCount_cmd_lsconf} execute_process(COMMAND ${ProcessorCount_cmd_lsconf}
ERROR_QUIET ERROR_QUIET
@ -126,6 +131,7 @@ function(ProcessorCount var)
if(NOT count) if(NOT count)
# QNX (systems with pidin): # QNX (systems with pidin):
find_program(ProcessorCount_cmd_pidin pidin) find_program(ProcessorCount_cmd_pidin pidin)
mark_as_advanced(ProcessorCount_cmd_pidin)
if(ProcessorCount_cmd_pidin) if(ProcessorCount_cmd_pidin)
execute_process(COMMAND ${ProcessorCount_cmd_pidin} info execute_process(COMMAND ${ProcessorCount_cmd_pidin} info
ERROR_QUIET ERROR_QUIET
@ -140,6 +146,7 @@ function(ProcessorCount var)
if(NOT count) if(NOT count)
# Sun (systems where uname -X emits "NumCPU" in its output): # Sun (systems where uname -X emits "NumCPU" in its output):
find_program(ProcessorCount_cmd_uname uname) find_program(ProcessorCount_cmd_uname uname)
mark_as_advanced(ProcessorCount_cmd_uname)
if(ProcessorCount_cmd_uname) if(ProcessorCount_cmd_uname)
execute_process(COMMAND ${ProcessorCount_cmd_uname} -X execute_process(COMMAND ${ProcessorCount_cmd_uname} -X
ERROR_QUIET ERROR_QUIET