I erroneously had this code:

 CHECK_INCLUDE_FILE(winsock2.h HAVE_WINSOCK2_H)
 IF(HAVE_WINSOCK2_H)
   ADD_DEFINITIONS(HAVE_WINSOCK2_H)
 ENDIF(HAVE_WINSOCK2_H)

and of course CMakeSetup took it just fine because it thought I knew what I was doing. When 'make' got around to .c compilation, gcc spewed a whole slew of really bizarre errors about HAVE_WINSOCK2_H not being a valid file. Of course I should have used a -D

 CHECK_INCLUDE_FILE(winsock2.h HAVE_WINSOCK2_H)
 IF(HAVE_WINSOCK2_H)
   ADD_DEFINITIONS(-DHAVE_WINSOCK2_H)
 ENDIF(HAVE_WINSOCK2_H)

but it makes me think, if the purpose of the function is to add definitions, why not check whether those definitions are vaguely well formed? Would it be difficult? I mean, for any given generator, we know what -D or /D flags it takes.


Cheers,
Brandon Van Every


_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to