<div class="gmail_quote">On Tue, Feb 17, 2009 at 12:41 AM, Aaron Turner <span dir="ltr"><<a href="mailto:synfinatic@gmail.com">synfinatic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Mon, Feb 16, 2009 at 9:28 PM, Philip Lowman <<a href="mailto:philip@yhbt.com">philip@yhbt.com</a>> wrote:<br>
> On Mon, Feb 16, 2009 at 10:23 PM, Aaron Turner <<a href="mailto:synfinatic@gmail.com">synfinatic@gmail.com</a>> wrote:<br>
</div>>> For now, i'm just hacking around the issue with:<br><div class="Ih2E3d">
>><br>
>> check_include_file("runetype.h" HAVE_RUNETYPE_H)<br>
>> IF(APPLE AND HAVE_RUNETYPE_H)<br>
>> # OS X has wint_t, but check_type_size won't find it<br>
>> SET(HAVE_WINT_T 1)<br>
>> ELSE(APPLE AND HAVE_RUNETYPE_H)<br>
>> check_type_size("wint_t" HAVE_WINT_T)<br>
>> ENDIF(APPLE AND HAVE_RUNTYPE_H)<br>
>><br>
>> Long term, I'm going to write my own version of check_symbol_exists<br>
>> which uses a different test which is define/typedef agnostic.<br>
><br>
> Please consider submitting it via the bugtracker when you're done.<br>
<br>
</div>Will do. Honestly, I'm a bit surprised this isn't already part of the<br>
basic Cmake library. Having to write try_compile() or try_run() tests<br>
for this sort of thing is just silly- especially since you can't<br>
inline the source code like in Autoconf.</blockquote><div><br>Not sure on the check_symbol_exists issue.<br><br>You should be able to inline source code in your CMakeLists.txt. Here's an example I wrote for OpenSceneGraph:<br>
<br> INCLUDE(CheckCXXSourceCompiles)<br> SET(CMAKE_REQUIRED_DEFINITIONS -DGLU_TESS_CALLBACK_TRIPLEDOT)<br> SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include ${GLUT_INCLUDE_DIR} ${GL_INCLUDE_DIR})<br>
SET(CMAKE_REQUIRED_LIBRARIES ${GLUT_LIBRARY} ${GL_LIBRARY})<br> CHECK_CXX_SOURCE_COMPILES(<br> "#include <osg/GL><br> #include <osg/GLU><br> static void testcb(GLvoid *, void*) { }<br>
int main() {<br> GLUtesselator *t = gluNewTess();<br> gluTessCallback(t, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK) testcb);<br> return 0;<br> }"<br> GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No)<br>
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT<br> ${GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No})<br></div></div><br clear="all"><br>-- <br>Philip Lowman<br>