Changeset 8283

Show
Ignore:
Timestamp:
05/08/08 14:55:01
Author:
robert
Message:

From Philip Lowman, "Attached is a patch to the toplevel CMakeLists.txt which adds an automated test for OSG_GLU_TESS_CALLBACK_TRIPLEDOT. This should help ease initial configuration on OS X systems."

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/CMakeLists.txt

    r8225 r8283  
    9898#ADD_DEFINITIONS(-D) 
    9999# Platform specific definitions 
    100  
    101 IF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT) 
    102  
    103     SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT OFF) 
    104  
    105     IF   (CMAKE_SYSTEM MATCHES "AIX.*") 
    106         SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT ON) 
    107     ENDIF(CMAKE_SYSTEM MATCHES "AIX.*") 
    108  
    109     IF   (APPLE) 
    110         SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT ON) 
    111     ENDIF(APPLE) 
    112      
    113 ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT) 
    114  
    115 OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build build with (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT}) 
    116  
    117 IF   (OSG_GLU_TESS_CALLBACK_TRIPLEDOT) 
    118     ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT) 
    119 ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT) 
    120100 
    121101 
     
    255235ENDIF(DESIRED_QT_VERSION) 
    256236 
    257  
     237
     238# Test to determine if we want the "tripledot" form of the GLU tesselator callback. 
     239
     240IF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT) 
     241    INCLUDE(CheckCXXSourceCompiles) 
     242    SET(CMAKE_REQUIRED_DEFINITIONS -DGLU_TESS_CALLBACK_TRIPLEDOT) 
     243    SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include ${GLUT_INCLUDE_DIR} ${GL_INCLUDE_DIR}) 
     244    SET(CMAKE_REQUIRED_LIBRARIES ${GLUT_LIBRARY} ${GL_LIBRARY}) 
     245    CHECK_CXX_SOURCE_COMPILES( 
     246    "#include <osg/GL> 
     247     #include <osg/GLU> 
     248     static void testcb(GLvoid *, void*) { } 
     249     int main() 
     250     { 
     251        GLUtesselator *t = gluNewTess(); 
     252        gluTessCallback(t, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK) testcb); 
     253        return 0; 
     254     }" 
     255    DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT) 
     256ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT) 
     257 
     258OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build build with (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT}) 
     259IF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT) 
     260    ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT) 
     261ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT) 
    258262 
    259263# Platform specific: