There is more

For a more fine-grained processor instruction set detection, consider this module: https://github.com/VcDevel/Vc/blob/master/cmake/OptimizeForArchitecture.cmake. We would also like to note that, sometimes, the host building the code may not be the same as the host running the code. This is often the case on compute clusters where the login node architecture may differ from the architecture found on compute nodes. One way to solve this is to submit the configuration and compilation as a computation step and deploy it to the compute nodes.

We have not used all keys available in cmake_host_system_information. For this, please consult https://cmake.org/cmake/help/latest/command/cmake_host_system_information.html.

Get CMake Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.