[CMake] CheckTypeSize and non-standard headers

Aaron Turner synfinatic at gmail.com
Mon Feb 16 19:30:24 EST 2009


More testing seems to indicate that check_symbol_exists won't find any
typedef defined in headers.

Looking a the CheckSymbolExists.cmake file, the following .c is
generated as a test:

#include <runetype.h>
void cmakeRequireSymbol(int dummy,...) {
    (void)dummy;
}

int main() {
#ifndef wint_t
    cmakeRequireSymbol(0, &wint_t);
#endif
    return 0;
}

Unfortunately, you can't use #ifndef to test for the existence of a
typedef, hence you get a compile failure and the result of the test is
false.

Is there another check which is typedef/define agnostic?  I'm sure I
could write my own, but this seems like it should be included in the
standard cmake library.


-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
    -- Benjamin Franklin


More information about the CMake mailing list