[CMake] Check for defined preprocessor symbol

Gregor Jasny gjasny at googlemail.com
Sun Feb 17 13:11:35 EST 2013


Hello,

I need a function to check for existing preprocessor symbols.
Something like

CHECK_C_PREPROCESSOR_SYMBOL_EXISTS("__i386__", X86)
CHECK_C_PREPROCESSOR_SYMBOL_EXISTS("__x86_64__", X64)

I guess a hack would be to (ab)use CHECK_TYPE_SIZE for this, but is the
a more elegant solution?

Thanks,
Gregor


More information about the CMake mailing list