[CMake] Question about running C code from within cmake

Andrew Maclean andrew.amaclean at gmail.com
Sun Jun 2 18:38:20 EDT 2019


See: https://cmake.org/cmake/help/latest/module/ProcessorCount.html. There
is an example of its use there.

Windows also has a system variable called NUMBER_OF_PROCESSORS. Type "set"
on the command line and you will see it.



> ---------- Forwarded message ----------
> From: Steven Truppe <workbench at gmx.at>
> To: CMake MailingList <cmake at cmake.org>
> Cc:
> Bcc:
> Date: Sun, 2 Jun 2019 14:16:53 +0200
> Subject: [CMake] Question about running C code from within cmake
>
> Hi everyone,
>
>
> i'm trying to search for a way for win32 to get the cpu core count. i
> found the c code:
>
> SYSTEM_INFO sysinfo;GetSystemInfo(&sysinfo);int numCPU = sysinfo.dwNumberOfProcessors;
>
> Is there a way i can get the return value numCPU and create a variable out of it ? for apple and linux i allready have a
> solution only win32 is left.
>
> best regards!
>
>
>
> --
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190603/4fb862d8/attachment.html>


More information about the CMake mailing list