On Tue, Feb 17, 2009 at 12:41 AM, Aaron Turner <synfina...@gmail.com> wrote:

> On Mon, Feb 16, 2009 at 9:28 PM, Philip Lowman <phi...@yhbt.com> wrote:
> > On Mon, Feb 16, 2009 at 10:23 PM, Aaron Turner <synfina...@gmail.com>
> wrote:
> >> For now, i'm just hacking around the issue with:
> >>
> >> check_include_file("runetype.h"     HAVE_RUNETYPE_H)
> >> IF(APPLE AND HAVE_RUNETYPE_H)
> >>    # OS X has wint_t, but check_type_size won't find it
> >>    SET(HAVE_WINT_T 1)
> >> ELSE(APPLE AND HAVE_RUNETYPE_H)
> >>    check_type_size("wint_t"            HAVE_WINT_T)
> >> ENDIF(APPLE AND HAVE_RUNTYPE_H)
> >>
> >> Long term, I'm going to write my own version of check_symbol_exists
> >> which uses a different test which is define/typedef agnostic.
> >
> > Please consider submitting it via the bugtracker when you're done.
>
> Will do.  Honestly, I'm a bit surprised this isn't already part of the
> basic Cmake library.  Having to write try_compile() or try_run() tests
> for this sort of thing is just silly- especially since you can't
> inline the source code like in Autoconf.


Not sure on the check_symbol_exists issue.

You should be able to inline source code in your CMakeLists.txt.  Here's an
example I wrote for OpenSceneGraph:

        INCLUDE(CheckCXXSourceCompiles)
        SET(CMAKE_REQUIRED_DEFINITIONS -DGLU_TESS_CALLBACK_TRIPLEDOT)
        SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include
${GLUT_INCLUDE_DIR} ${GL_INCLUDE_DIR})
        SET(CMAKE_REQUIRED_LIBRARIES ${GLUT_LIBRARY} ${GL_LIBRARY})
        CHECK_CXX_SOURCE_COMPILES(
            "#include <osg/GL>
            #include <osg/GLU>
            static void testcb(GLvoid *, void*) { }
            int main() {
               GLUtesselator *t = gluNewTess();
               gluTessCallback(t, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK)
testcb);
               return 0;
            }"

GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No)
        SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT

${GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No})


-- 
Philip Lowman
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to