Skip to content
Snippets Groups Projects
Commit e7869e80 authored by Florian Maushart's avatar Florian Maushart Committed by Brad King
Browse files

cmake_host_system_information: Add more keywords

Extend the `cmake_host_system_information()` command to add processor
identification keywords.
parent c095e90f
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ syn keyword cmakeKWbuild_name contained
\ CMAKE_CXX_COMPILER
syn keyword cmakeKWcmake_host_system_information contained
\ AVAILABLE_PHYSICAL_MEMORY AVAILABLE_VIRTUAL_MEMORY FQDN HOSTNAME NUMBER_OF_LOGICAL_CORES NUMBER_OF_PHYSICAL_CORES QUERY RESULT TOTAL_PHYSICAL_MEMORY TOTAL_VIRTUAL_MEMORY
\ AVAILABLE_PHYSICAL_MEMORY AVAILABLE_VIRTUAL_MEMORY FQDN HOSTNAME NUMBER_OF_LOGICAL_CORES NUMBER_OF_PHYSICAL_CORES QUERY RESULT TOTAL_PHYSICAL_MEMORY TOTAL_VIRTUAL_MEMORY IS_64BIT HAS_FPU HAS_MMX HAS_MMX_PLUS HAS_SSE HAS_SSE2 HAS_SSE_FP HAS_SSE_MMX HAS_AMD_3DNOW HAS_AMD_3DNOW_PLUS HAS_IA64 HAS_SERIAL_NUMBER PROCESSOR_SERIAL_NUMBER PROCESSOR_NAME OS_NAME OS_RELEASE OS_VERSION OS_PLATFORM
syn keyword cmakeKWcmake_minimum_required contained
\ FATAL_ERROR VERSION
......
......@@ -13,13 +13,34 @@ queried. The list of queried values is stored in ``<variable>``.
``<key>`` can be one of the following values:
::
NUMBER_OF_LOGICAL_CORES = Number of logical cores.
NUMBER_OF_PHYSICAL_CORES = Number of physical cores.
HOSTNAME = Hostname.
FQDN = Fully qualified domain name.
TOTAL_VIRTUAL_MEMORY = Total virtual memory in megabytes.
AVAILABLE_VIRTUAL_MEMORY = Available virtual memory in megabytes.
TOTAL_PHYSICAL_MEMORY = Total physical memory in megabytes.
AVAILABLE_PHYSICAL_MEMORY = Available physical memory in megabytes.
============================= ================================================
Key Description
============================= ================================================
``NUMBER_OF_LOGICAL_CORES`` Number of logical cores
``NUMBER_OF_PHYSICAL_CORES`` Number of physical cores
``HOSTNAME`` Hostname
``FQDN`` Fully qualified domain name
``TOTAL_VIRTUAL_MEMORY`` Total virtual memory in megabytes
``AVAILABLE_VIRTUAL_MEMORY`` Available virtual memory in megabytes
``TOTAL_PHYSICAL_MEMORY`` Total physical memory in megabytes
``AVAILABLE_PHYSICAL_MEMORY`` Available physical memory in megabytes
``IS_64BIT`` One if processor is 64Bit
``HAS_FPU`` One if processor has floating point unit
``HAS_MMX`` One if processor supports MMX instructions
``HAS_MMX_PLUS`` One if porcessor supports Ext. MMX instructions
``HAS_SSE`` One if porcessor supports SSE instructions
``HAS_SSE2`` One if porcessor supports SSE2 instructions
``HAS_SSE_FP`` One if porcessor supports SSE FP instructions
``HAS_SSE_MMX`` One if porcessor supports SSE MMX instructions
``HAS_AMD_3DNOW`` One if porcessor supports 3DNow instructions
``HAS_AMD_3DNOW_PLUS`` One if porcessor supports 3DNow+ instructions
``HAS_IA64`` One if IA64 processor emulating x86
``HAS_SERIAL_NUMBER`` One if processor has serial number
``PROCESSOR_SERIAL_NUMBER`` Processor serial number
``PROCESSOR_NAME`` Human readable processor name
``PROCESSOR_DESCRIPTION`` Human readable full processor description
``OS_NAME`` See :variable:`CMAKE_HOST_SYSTEM_NAME`
``OS_RELEASE`` The OS sub-type e.g. on Windows ``Professional``
``OS_VERSION`` The OS build ID
``OS_PLATFORM`` See :variable:`CMAKE_HOST_SYSTEM_PROCESSOR`
============================= ================================================
cmake_host_system_information-extend
------------------------------------
* The :command:`cmake_host_system_information` command learned more keys
to get information about the processor capabilities and the host OS
version.
......@@ -76,6 +76,55 @@ bool cmCMakeHostSystemInformationCommand::GetValue(
value = this->ValueToString(info.GetTotalPhysicalMemory());
} else if (key == "AVAILABLE_PHYSICAL_MEMORY") {
value = this->ValueToString(info.GetAvailablePhysicalMemory());
} else if (key == "IS_64BIT") {
value = this->ValueToString(info.Is64Bits());
} else if (key == "HAS_FPU") {
value = this->ValueToString(
info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_FPU));
} else if (key == "HAS_MMX") {
value = this->ValueToString(
info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_MMX));
} else if (key == "HAS_MMX_PLUS") {
value = this->ValueToString(info.DoesCPUSupportFeature(
cmsys::SystemInformation::CPU_FEATURE_MMX_PLUS));
} else if (key == "HAS_SSE") {
value = this->ValueToString(
info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_SSE));
} else if (key == "HAS_SSE2") {
value = this->ValueToString(
info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_SSE2));
} else if (key == "HAS_SSE_FP") {
value = this->ValueToString(info.DoesCPUSupportFeature(
cmsys::SystemInformation::CPU_FEATURE_SSE_FP));
} else if (key == "HAS_SSE_MMX") {
value = this->ValueToString(info.DoesCPUSupportFeature(
cmsys::SystemInformation::CPU_FEATURE_SSE_MMX));
} else if (key == "HAS_AMD_3DNOW") {
value = this->ValueToString(info.DoesCPUSupportFeature(
cmsys::SystemInformation::CPU_FEATURE_AMD_3DNOW));
} else if (key == "HAS_AMD_3DNOW_PLUS") {
value = this->ValueToString(info.DoesCPUSupportFeature(
cmsys::SystemInformation::CPU_FEATURE_AMD_3DNOW_PLUS));
} else if (key == "HAS_IA64") {
value = this->ValueToString(
info.DoesCPUSupportFeature(cmsys::SystemInformation::CPU_FEATURE_IA64));
} else if (key == "HAS_SERIAL_NUMBER") {
value = this->ValueToString(info.DoesCPUSupportFeature(
cmsys::SystemInformation::CPU_FEATURE_SERIALNUMBER));
} else if (key == "PROCESSOR_NAME") {
value = this->ValueToString(info.GetExtendedProcessorName());
} else if (key == "PROCESSOR_DESCRIPTION") {
value = info.GetCPUDescription();
} else if (key == "PROCESSOR_SERIAL_NUMBER") {
value = this->ValueToString(info.GetProcessorSerialNumber());
} else if (key == "OS_NAME") {
value = this->ValueToString(info.GetOSName());
} else if (key == "OS_RELEASE") {
value = this->ValueToString(info.GetOSRelease());
} else if (key == "OS_VERSION") {
value = this->ValueToString(info.GetOSVersion());
} else if (key == "OS_PLATFORM") {
value = this->ValueToString(info.GetOSPlatform());
#ifdef HAVE_VS_SETUP_HELPER
} else if (key == "VS_15_DIR") {
cmVSSetupAPIHelper vsSetupAPIHelper;
......
......@@ -22,6 +22,25 @@ try_and_print(TOTAL_VIRTUAL_MEMORY)
try_and_print(AVAILABLE_VIRTUAL_MEMORY)
try_and_print(TOTAL_PHYSICAL_MEMORY)
try_and_print(AVAILABLE_PHYSICAL_MEMORY)
try_and_print(IS_64BIT)
try_and_print(HAS_FPU)
try_and_print(HAS_MMX)
try_and_print(HAS_MMX_PLUS)
try_and_print(HAS_SSE)
try_and_print(HAS_SSE2)
try_and_print(HAS_SSE_FP)
try_and_print(HAS_SSE_MMX)
try_and_print(HAS_AMD_3DNOW)
try_and_print(HAS_AMD_3DNOW_PLUS)
try_and_print(HAS_IA64)
try_and_print(HAS_SERIAL_NUMBER)
try_and_print(PROCESSOR_SERIAL_NUMBER)
try_and_print(PROCESSOR_NAME)
try_and_print(PROCESSOR_DESCRIPTION)
try_and_print(OS_NAME)
try_and_print(OS_RELEASE)
try_and_print(OS_VERSION)
try_and_print(OS_PLATFORM)
include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment