[CMake] cmake 2.5 with windows mobile

Alexander Neundorf a.neundorf-work at gmx.net
Tue Sep 30 18:07:08 EDT 2008


On Wednesday 17 September 2008, Andreas Pokorny wrote:
> Hello,
>
> Small correction, the magic switch ist /HEADERS, and I came up with
> EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} /c /nologo test.c )
> EXECUTE_PROCESS(COMMAND dumpbin /HEADERS test.obj OUTPUT_VARIABLE
> TEST_HEADERINFO )
>
> STRING(REGEX MATCH "machine \\(([^\\)]*)\\)" RESULT ${TEST_HEADERINFO})
> SET(CMAKE_CL_MACHINE_TYPE ${CMAKE_MATCH_1})
> MESSAGE(STATUS "${CMAKE_CL_MACHINE_TYPE}")
>
> Is there a better way?

EXECUTE_PROCESS() followed by STRING(REGEX) looks good.

Alex


More information about the CMake mailing list