summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-04-27 20:19:31 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-04-27 20:19:31 +0900
commitc753c65cf7616665d669ea169c875c60eab69e51 (patch)
treea0814b9cb714abec02c37ef21ff90afdd946817d /ConfigureChecks.cmake
parente9596b5b63d8c4303da0b50e63c0056899dafb27 (diff)
downloadtqtinterface-c753c65cf7616665d669ea169c875c60eab69e51.tar.gz
tqtinterface-c753c65cf7616665d669ea169c875c60eab69e51.zip
Dropped unused code.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake181
1 files changed, 53 insertions, 128 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 4188489..8cf8d08 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -13,42 +13,11 @@ macro( qt_message )
message( STATUS "${ARGN}" )
endmacro( )
-if( (WITH_QT3 OR USE_QT3) AND (WITH_QT4 OR USE_QT4) )
- tde_message_fatal( "Options WITH_QT3 and WITH_QT4 are mutually exclusive." )
-endif( )
-
-if( WITH_QT3 OR USE_QT3 )
- set( QT_VERSION "3" )
-elseif( WITH_QT4 OR USE_QT4 )
- set( QT_VERSION "4" )
- message( AUTHOR_WARNING
- " ------------------------------------------------------------- \n"
- " *** NOTE *** \n"
- " \n"
- " The code for the TQt interface based on Qt4 is not maintained \n"
- " and the result can cause unexpected problems.\n"
- " \n"
- " It is not recommended to build a TQt interface based on Qt4!\n"
- " ------------------------------------------------------------- \n"
- )
-endif()
-
-
-if( NOT DEFINED QT_VERSION )
- tde_message_fatal( "You must select a Qt version, like this:\n \n cmake -DQT_VERSION=3 [arguments...]\n or\n cmake -DUSE_QT3=ON [arguments...]" )
-endif( )
-
-
-if( NOT (QT_VERSION STREQUAL "3" OR QT_VERSION STREQUAL "4") )
- tde_message_fatal( "You have chosen an invalid version.\n QT_VERSION should be 3 or 4." )
-else( )
- qt_message( "Checking for Qt${QT_VERSION}..." )
-endif( )
-
+set( QT_VERSION "3" )
# qt prefix directory
if( NOT DEFINED QT_PREFIX_DIR )
- if( NOT $ENV{TQTDIR} STREQUAL "" AND QT_VERSION STREQUAL "3" )
+ if( NOT $ENV{TQTDIR} STREQUAL "" )
set( QT_PREFIX_DIR "$ENV{TQTDIR}" )
qt_message( " QT_PREFIX_DIR is set to TQTDIR" )
else( )
@@ -72,35 +41,17 @@ if( NOT DEFINED TQT_INCLUDE_DIR )
endif( )
qt_message( " TQT_INCLUDE_DIR: ${TQT_INCLUDE_DIR}" )
-# detect native tqt
-if( EXISTS "${TQT_INCLUDE_DIR}/ntqglobal.h" )
- set( HAVE_REAL_TQT ON CACHE BOOL "Native TQt3 detected" )
- qt_message( "Native TQt3 detected" )
-else( )
- qt_message( "Qt3 detected" )
-endif( )
# qt library path
if( NOT DEFINED TQT_LIBRARY_DIR )
set( TQT_LIBRARY_DIR "${QT_PREFIX_DIR}/lib${LIB_SUFFIX}" )
- if( QT_VERSION STREQUAL "4" )
- if( NOT EXISTS "${TQT_LIBRARY_DIR}/libQtGui.so" )
- if( EXISTS "${TQT_LIBRARY_DIR}/qt4/libQtGui.so" )
- set( TQT_LIBRARY_DIR "${QT_PREFIX_DIR}/lib${LIB_SUFFIX}/qt4" )
- endif( )
- endif( )
- endif( )
endif( )
qt_message( " TQT_LIBRARY_DIR: ${TQT_LIBRARY_DIR}" )
# qt library name
if( NOT DEFINED TQT_LIBRARIES )
- if( QT_VERSION STREQUAL "3" )
- set( TQT_LIBRARIES qt-mt )
- elseif( QT_VERSION STREQUAL "4" )
- set( TQT_LIBRARIES QtCore QtGui )
- endif( )
+ set( TQT_LIBRARIES qt-mt )
endif( )
@@ -117,11 +68,7 @@ if( DEFINED MOC_EXECUTABLE )
tde_message_fatal( "moc was NOT found.\n MOC_EXECUTABLE may not be set correctly." )
endif( )
else( )
- if( QT_VERSION STREQUAL "3" )
- find_program( MOC_EXECUTABLE NAMES tqmoc moc-qt3 moc HINTS "${QT_BINARY_DIR}" )
- elseif( QT_VERSION STREQUAL "4" )
- find_program( MOC_EXECUTABLE NAMES moc-qt4 moc HINTS "${QT_BINARY_DIR}" )
- endif( )
+ find_program( MOC_EXECUTABLE NAMES tqmoc moc-qt3 moc HINTS "${QT_BINARY_DIR}" )
if( NOT MOC_EXECUTABLE )
tde_message_fatal( "moc was NOT found.\n Please check if your Qt${QT_VERSION} is correctly installed." )
endif( )
@@ -144,96 +91,74 @@ endif( )
qt_message( " MOC_EXECUTABLE: ${MOC_EXECUTABLE} (using Qt ${CMAKE_MATCH_1})" )
if( QT_VERSION STREQUAL "3" AND NOT "${CMAKE_MATCH_1}" VERSION_LESS "4" )
- tde_message_fatal( "Strange, you want Qt3, but your moc using Qt4." )
-elseif( QT_VERSION STREQUAL "4" AND "${CMAKE_MATCH_1}" VERSION_LESS "4" )
- tde_message_fatal( "Strange, you want Qt4, but your moc using Qt3." )
+ tde_message_fatal( "Strange, you want TQt3, but your moc using Qt>=4." )
endif( )
# find uic (only for Qt3)
-if( QT_VERSION STREQUAL "3" )
- if( DEFINED UIC_EXECUTABLE )
- if( IS_DIRECTORY "${UIC_EXECUTABLE}" OR NOT EXISTS "${UIC_EXECUTABLE}" )
- tde_message_fatal( "uic was NOT found.\n MOC_EXECUTABLE may not be set correctly" )
- endif( )
- else( )
- find_program( UIC_EXECUTABLE NAMES tquic uic-qt3 uic HINTS "${QT_BINARY_DIR}" )
- if( NOT UIC_EXECUTABLE )
- tde_message_fatal( "uic was NOT found.\n Please check if your Qt${QT_VERSION} is correctly installed." )
- endif( )
- endif( )
- qt_message( " UIC_EXECUTABLE: ${UIC_EXECUTABLE}" )
+if( DEFINED UIC_EXECUTABLE )
+ if( IS_DIRECTORY "${UIC_EXECUTABLE}" OR NOT EXISTS "${UIC_EXECUTABLE}" )
+ tde_message_fatal( "uic was NOT found.\n MOC_EXECUTABLE may not be set correctly" )
+ endif( )
+else( )
+ find_program( UIC_EXECUTABLE NAMES tquic uic-qt3 uic HINTS "${QT_BINARY_DIR}" )
+ if( NOT UIC_EXECUTABLE )
+ tde_message_fatal( "uic was NOT found.\n Please check if your Qt${QT_VERSION} is correctly installed." )
+ endif( )
endif( )
+qt_message( " UIC_EXECUTABLE: ${UIC_EXECUTABLE}" )
# definitions
-if( QT_VERSION STREQUAL "3" )
- if( HAVE_REAL_TQT )
- set( QT_DEFINITIONS "-DTQT_NO_ASCII_CAST -DTQT_NO_STL -DTQT_NO_COMPAT -DTQT_NO_TRANSLATION -DTQT_THREAD_SUPPORT -D_REENTRANT" )
- else( )
- set( QT_DEFINITIONS "-DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_THREAD_SUPPORT -D_REENTRANT" )
- endif( )
-elseif( QT_VERSION STREQUAL "4" )
- set( QT_DEFINITIONS "-DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_THREAD_SUPPORT -D_REENTRANT" )
-endif( )
+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} )
-# check if Qt3 is usable
-if( QT_VERSION STREQUAL "3" )
- check_cxx_source_compiles("
- #include <qapplication.h>
- int main(int argc, char **argv) { QApplication app(argc, argv); return 0; } "
- HAVE_USABLE_QT${QT_VERSION} )
- if( NOT HAVE_USABLE_QT${QT_VERSION} )
- # Unset the Qt detection variable
- unset( HAVE_USABLE_QT${QT_VERSION} CACHE )
- # Reset libraries
- set( TQT_LIBRARIES tqt-mt )
- set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIR} ${TQT_LIBRARIES} )
- qt_message( "Looking for native TQt3..." )
- check_cxx_source_compiles("
- #include <ntqapplication.h>
- int main(int argc, char **argv) { TQApplication app(argc, argv); return 0; } "
- HAVE_USABLE_QT${QT_VERSION} )
- endif( )
-# check if Qt4 is usable
-elseif( QT_VERSION STREQUAL "4" )
- check_cxx_source_compiles("
- #include <QtGui/QApplication>
- int main(int argc, char **argv) { QApplication app(argc, argv); return 0; } "
- HAVE_USABLE_QT${QT_VERSION} )
-endif( )
+# check if TQt3 is usable
+check_cxx_source_compiles("
+ #include <qapplication.h>
+ int main(int argc, char **argv) { QApplication app(argc, argv); return 0; } "
+ HAVE_USABLE_QT${QT_VERSION} )
+ if( NOT HAVE_USABLE_QT${QT_VERSION} )
+ # Unset the Qt detection variable
+ unset( HAVE_USABLE_QT${QT_VERSION} CACHE )
+ # Reset libraries
+ set( TQT_LIBRARIES tqt-mt )
+ set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIR} ${TQT_LIBRARIES} )
+ qt_message( "Looking for native TQt3..." )
+ check_cxx_source_compiles("
+ #include <ntqapplication.h>
+ int main(int argc, char **argv) { TQApplication app(argc, argv); return 0; } "
+ HAVE_USABLE_QT${QT_VERSION} )
+ endif( )
if( NOT HAVE_USABLE_QT${QT_VERSION} )
tde_message_fatal( "Unable to build a simple Qt${QT_VERSION} test." )
endif( )
# check if Qt3 is patched for compatibility with TQt
-if( QT_VERSION STREQUAL "3" )
- check_cxx_source_compiles("
- #include <qobjectlist.h>
- #include <qobject.h>
- int main(int, char**) { QObject::objectTreesListObject(); return 0; } "
- HAVE_PATCHED_QT3 )
- if( NOT HAVE_PATCHED_QT3 )
- # Unset the Qt detection variable
- unset( HAVE_PATCHED_QT3 CACHE )
- # Reset libraries
- set( TQT_LIBRARIES tqt-mt )
- set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIR} ${TQT_LIBRARIES} )
- qt_message( "Looking for patched native TQt3..." )
- check_cxx_source_compiles("
- #include <ntqobjectlist.h>
- #include <ntqobject.h>
- int main(int, char**) { TQObject::objectTreesListObject(); return 0; } "
- HAVE_PATCHED_QT3 )
- endif( )
- if( NOT HAVE_PATCHED_QT3 )
- tde_message_fatal( "Your Qt3 is not patched for compatibility with tqtinterface." )
- endif( )
+check_cxx_source_compiles("
+ #include <qobjectlist.h>
+ #include <qobject.h>
+ int main(int, char**) { QObject::objectTreesListObject(); return 0; } "
+ HAVE_PATCHED_QT3 )
+ if( NOT HAVE_PATCHED_QT3 )
+ # Unset the Qt detection variable
+ unset( HAVE_PATCHED_QT3 CACHE )
+ # Reset libraries
+ set( TQT_LIBRARIES tqt-mt )
+ set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIR} ${TQT_LIBRARIES} )
+ qt_message( "Looking for patched native TQt3..." )
+ check_cxx_source_compiles("
+ #include <ntqobjectlist.h>
+ #include <ntqobject.h>
+ int main(int, char**) { TQObject::objectTreesListObject(); return 0; } "
+ HAVE_PATCHED_QT3 )
+ endif( )
+if( NOT HAVE_PATCHED_QT3 )
+ tde_message_fatal( "Your Qt3 is not patched for compatibility with tqtinterface." )
endif( )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )