+_job_count=4
+
+_nproc () {
+ if command -v 'nproc' >/dev/null
+ then
+ nproc
+ else
+ case "$(uname -s)" in
+ 'Linux')
+ egrep "^processor" /proc/cpuinfo | wc -l
+ ;;
+ 'FreeBSD')
+ sysctl -n hw.ncpu
+ ;;
+ 'Darwin')
+ sysctl -n hw.logicalcpu \
+ || sysctl -n hw.ncpu
+ ;;
+ 'MSYS_NT-'*|'CYGWIN_NT-'*|'MINGW'*'_NT-'*)
+ if command -v 'wmic' >/dev/null
+ then
+ wmic cpu get NumberOfLogicalProcessors/Format:List \
+ | grep -m1 '=' | cut -f2 -d'='
+ else
+ echo "${NUMBER_OF_PROCESSORS:-${_job_count}}"
+ fi
+ ;;
+ *)
+ echo "${_job_count}"
+ ;;
+ esac
+ fi
+}
+
+job_count="$(_nproc)" 2>/dev/null
+job_count="${job_count:-${_job_count}}"
+
+declare -a cmake_user_opts
+while [ ! -z "${1}" ]