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."

This commit is contained in:
Robert Osfield 2008-05-08 12:55:01 +00:00
parent 973f104704
commit 47814e50a4

View File

@ -98,26 +98,6 @@ INCLUDE_DIRECTORIES(
#ADD_DEFINITIONS(-D)
# Platform specific definitions
IF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT OFF)
IF (CMAKE_SYSTEM MATCHES "AIX.*")
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT ON)
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")
IF (APPLE)
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT ON)
ENDIF(APPLE)
ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build build with (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT})
IF (OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT)
ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
IF(WIN32)
@ -254,7 +234,31 @@ ELSE(DESIRED_QT_VERSION)
ENDIF(DESIRED_QT_VERSION)
#
# Test to determine if we want the "tripledot" form of the GLU tesselator callback.
#
IF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
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;
}"
DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build build with (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT})
IF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT)
ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
# Platform specific:
# (We can approach this one of two ways. We can try to FIND everything