diff options
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 2f8204f..b603ac1 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -9,6 +9,16 @@ # ################################################# +##### setup architecture flags ################## + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + +tde_setup_largefiles( ) + + macro( qt_message ) message( STATUS "${ARGN}" ) endmacro( ) @@ -75,8 +85,12 @@ qt_message( " QT_INCLUDE_DIR: ${QT_INCLUDE_DIR}" ) # detect native tqt if( EXISTS "${QT_INCLUDE_DIR}/ntqglobal.h" ) set( HAVE_REAL_TQT ON CACHE BOOL "Native TQt3 detected" ) + set( TQGLWIDGET_NAME "TQGLWidget" ) + set( TQGL_INCLUDE "ntqgl.h" ) qt_message( "Native TQt3 detected" ) else( ) + set( TQGLWIDGET_NAME "QGLWidget" ) + set( TQGL_INCLUDE "qgl.h" ) qt_message( "Qt3 detected" ) endif( ) @@ -233,3 +247,44 @@ if( QT_VERSION STREQUAL "3" ) endif( ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) + + +##### check for OpenGL + +execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} ${QT_LIBRARIES} --variable=qt_config + OUTPUT_VARIABLE TQT_CONF_VARS + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +MESSAGE(STATUS "List of qt_config variables: ${TQT_CONF_VARS}") + +string( REGEX MATCH " opengl " OPENGL_ENABLED " ${TQT_CONF_VARS} " ) + +if( OPENGL_ENABLED ) + +check_include_file( "OpenGL/glu.h" HAVE_GLU_OPENGL ) +check_include_file( "GL/glu.h" HAVE_GLU_GL ) + +tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) +set( CMAKE_REQUIRED_INCLUDES ${QT_INCLUDE_DIR} ) +set( CMAKE_REQUIRED_LIBRARIES -L${QT_LIBRARY_DIR} ${QT_LIBRARIES} ) + +check_cxx_source_compiles(" +#include <cstdlib> +#include <${TQGL_INCLUDE}> +int main( int, char** ) +{ + (void) new ${TQGLWIDGET_NAME}( NULL, \"qgl\" ) ; + return EXIT_SUCCESS ; +}" +TQGLWIDGET ) + +tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) + +if( ( HAVE_GLU_OPENGL OR HAVE_GLU_GL ) AND TQGLWIDGET ) + set( HAVE_OPENGL 1 ) + else() + tde_message_fatal( "OpenGL has been requested, but neither the OpenGL headers or tqt3 with OpenGL support have been found on your system" ) +endif() +endif( OPENGL_ENABLED ) |