View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014208CMakeCMakepublic2013-06-07 09:352013-10-28 13:40
ReporterNils Gladitz 
Assigned ToBrad King 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.11 
Target VersionCMake 2.8.12Fixed in VersionCMake 2.8.12 
Summary0014208: Provide build system information query command
Descriptionkwsys provides system information query functions in SystemInformation.cxx.

CTest queries and transmits system information to CDash but there doesn't seem to be any way for me to access that information from CMake itself.

A query command like e.g. get_system_information(TOTAL_VIRTUAL_MEMORY <output_variable>) would be nice.

Personally I'd like to see how much memory the system has available so I can estimate an upper limit of tests that I can run in parallel.

It could also render the rather complicated implementation of ProcessorCount.cmake obsolete.
TagsNo tags attached.
Attached Filespatch file icon 0001-implemented-new-cmake_host_system_information-comman.patch [^] (11,160 bytes) 2013-06-07 16:52 [Show Content]
patch file icon 0001-implemented-cmake_host_system_information-with-exten.patch [^] (12,532 bytes) 2013-06-14 17:12 [Show Content]
patch file icon 0001-implemented-cmake_host_system_information-with-exten2.patch [^] (12,600 bytes) 2013-06-15 01:40 [Show Content]

 Relationships

  Notes
(0033250)
Brad King (manager)
2013-06-07 09:40

This is a good proposal. Perhaps the command should be called

 cmake_host_system_information

because it can only collect information from the host running CMake and can never say anything about a target platform (e.g. during cross compiling).
(0033257)
Nils Gladitz (developer)
2013-06-07 16:55

I've given the implementation a try and attached a patch.

I only implemented a small subset of the information provided by cmsys::SystemInformation for which I could think of use cases or which didn't already seem to be covered but I guess it could be extended as demand arises.
(0033279)
Brad King (manager)
2013-06-13 09:06

Thanks for working on a patch.

+ " cmake_host_system_information(<key> <variable>)\n"

I'd like to design an API that is more extensible in the future. Perhaps

 cmake_host_system_information(RESULT <var> QUERY <key>...)

where <key>... can be zero or more keys whose results will be stored as a list in <var>. Other ideas?
(0033280)
Nils Gladitz (developer)
2013-06-13 10:55

I can't think of a use case for lists and can't think of potential extensions for this but I am not strongly opposed.

What might be convenient for some uses would be a format string or variable substitution scheme similar to configure_file e.g. cmake_host_system_information(RESULT MY_VAR FORMAT "<HOSTNAME> has <NUMBER_OF_PHYSICAL_CORES> physical cores")

Though I could just as well manually concatenate those and would probably prefer to keep the command single purpose.
(0033281)
Brad King (manager)
2013-06-13 10:58

The format mode would be a good candidate for future expansion but need not be implemented now. However, it serves as an example for why we want an extensible interface.
(0033313)
Nils Gladitz (developer)
2013-06-14 17:13

I've uploaded a new patch that should implement the suggested interface.
(0033316)
Nils Gladitz (developer)
2013-06-15 01:41

Updated documentation to match the new interface.
(0033323)
Brad King (manager)
2013-06-19 08:50

Patch applied, thanks!

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb71a3a0 [^]

 Issue History
Date Modified Username Field Change
2013-06-07 09:35 Nils Gladitz New Issue
2013-06-07 09:40 Brad King Note Added: 0033250
2013-06-07 09:40 Brad King Status new => backlog
2013-06-07 16:52 Nils Gladitz File Added: 0001-implemented-new-cmake_host_system_information-comman.patch
2013-06-07 16:55 Nils Gladitz Note Added: 0033257
2013-06-13 09:06 Brad King Note Added: 0033279
2013-06-13 10:55 Nils Gladitz Note Added: 0033280
2013-06-13 10:58 Brad King Note Added: 0033281
2013-06-14 17:12 Nils Gladitz File Added: 0001-implemented-cmake_host_system_information-with-exten.patch
2013-06-14 17:13 Nils Gladitz Note Added: 0033313
2013-06-15 01:40 Nils Gladitz File Added: 0001-implemented-cmake_host_system_information-with-exten2.patch
2013-06-15 01:41 Nils Gladitz Note Added: 0033316
2013-06-19 08:50 Brad King Note Added: 0033323
2013-06-19 08:50 Brad King Assigned To => Brad King
2013-06-19 08:50 Brad King Status backlog => resolved
2013-06-19 08:50 Brad King Resolution open => fixed
2013-06-19 08:50 Brad King Fixed in Version => CMake 2.8.12
2013-06-19 08:50 Brad King Target Version => CMake 2.8.12
2013-10-28 13:40 Nils Gladitz Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team