CMake march hardware : <p>What is the CMake way to enable the equivalent of GCC's <code>-march=</code>, particularly <code>-march=native</code>? Is there really nothing better than <code>CHECK_CXX_COMPILER_FLAG</code>, such as:</p>

<pre><code>include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
</code></pre>
