diff options
author | gregory guy <gregory-tde@laposte.net> | 2020-04-24 12:18:37 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-04-27 02:45:51 +0200 |
commit | 5cdb5457400812f7d9d2a92c6ee4922c4af627c7 (patch) | |
tree | 118841fa26d59800eeb57e71b12f10551a925888 /ConfigureChecks.cmake | |
parent | e43a3c98104250fe06959b5352d17bff6e611bfb (diff) | |
download | tqtinterface-5cdb5457400812f7d9d2a92c6ee4922c4af627c7.tar.gz tqtinterface-5cdb5457400812f7d9d2a92c6ee4922c4af627c7.zip |
Allow tqtinterface to build without OpenGL support.
This should close bug 2645.
Some cosmetics here and there.
Signed-off-by: gregory guy <gregory-tde@laposte.net>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 55 |
1 files changed, 51 insertions, 4 deletions
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 <cstdlib> +#include <ntqgl.h> +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 ) |