From 5cdb5457400812f7d9d2a92c6ee4922c4af627c7 Mon Sep 17 00:00:00 2001 From: gregory guy Date: Fri, 24 Apr 2020 12:18:37 +0200 Subject: Allow tqtinterface to build without OpenGL support. This should close bug 2645. Some cosmetics here and there. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gregory guy Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 55 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) (limited to 'ConfigureChecks.cmake') diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 8cf8d08..f76d691 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( ) @@ -109,10 +119,6 @@ endif( ) qt_message( " UIC_EXECUTABLE: ${UIC_EXECUTABLE}" ) -# definitions -set( QT_DEFINITIONS "-DTQT_NO_ASCII_CAST -DTQT_NO_STL -DTQT_NO_COMPAT -DTQT_NO_TRANSLATION -DTQT_THREAD_SUPPORT -D_REENTRANT" ) - - tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) set( CMAKE_REQUIRED_INCLUDES ${TQT_INCLUDE_DIR} ) set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIR} ${TQT_LIBRARIES} ) @@ -162,3 +168,44 @@ if( NOT HAVE_PATCHED_QT3 ) endif( ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) + + +##### check for OpenGL + +execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} ${TQT_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 ${TQT_INCLUDE_DIR} ) +set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIR} ${TQT_LIBRARIES} ) + +check_cxx_source_compiles(" +#include +#include +int main( int, char** ) +{ + (void) new TQGLWidget( (TQWidget*)0, \"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 ) -- cgit v1.2.1