aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtNetwork
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2010-08-14 10:02:33 -0400
committerAnderson Lizardo <anderson.lizardo@openbossa.org>2010-08-26 11:07:02 -0400
commite5e44b6465e2755c70c8e13060de4c2ca799fd64 (patch)
treedc806580d8f580861082c815198f2bb7202df422 /PySide/QtNetwork
parentd53f699751047b18e7c729de3cdcc7eb45b32dd1 (diff)
Replace macro checks with actual symbol checking
This increases a little more the check time, but is also more precise. It is also required for cases where qfeatures.h incorrectly reports support for a feature, but the actual class is not compiled (the case for a couple of classes in Qt Simulator). Additionally, the macro has been made more concise, and is reused for both QtGui and QtNetwork. Reviewed-by: Luciano Wolf <luciano.wolf@openbossa.org> Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
Diffstat (limited to 'PySide/QtNetwork')
-rw-r--r--PySide/QtNetwork/CMakeLists.txt47
1 files changed, 5 insertions, 42 deletions
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index ca0599314..691cf76a6 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -1,38 +1,5 @@
project(QtNetwork)
-# Check QtNetwork support
-macro(CHECK_QT_NETWORK_MACRO macro_display_name qt_macro module_sources global_sources)
- if (DEFINED PYSIDE_${qt_macro})
- if (PYSIDE_${qt_macro})
- list(APPEND ${global_sources} ${${module_sources}})
- endif()
- else()
- set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test${qt_macro}.cxx)
- file(WRITE ${SRC_FILE}
- "#include <QtNetwork>\n"
- "int main() { \n"
- "#ifdef ${qt_macro}\n"
- "#error not supported.\n"
- "#endif\n"
- "}\n")
-
- try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
- ${SRC_FILE}
- CMAKE_FLAGS
- -DINCLUDE_DIRECTORIES:STRING=${QT_QTNETWORK_INCLUDE_DIR}\;${QT_INCLUDE_DIR}
- -DLINK_LIBRARIES:PATH=${QT_QTNETWORK_LIBRARY_RELEASE}
- OUTPUT_VARIABLE OUTPUT)
-
- set("PYSIDE_${qt_macro}" ${Q_WORKS} CACHE STRING "Has this Qt module been found by pyside?")
- if(Q_WORKS)
- message(STATUS "Testing support to ${macro_display_name} -- enabled")
- list(APPEND ${global_sources} ${${module_sources}})
- else()
- message(STATUS "Testing support to ${macro_display_name} -- disabled")
- endif()
- endif()
-endmacro()
-
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} GREATER 6)
set (QtNetwork_47_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkconfiguration_wrapper.cpp
@@ -74,15 +41,11 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qurlinfo_wrapper.cpp
${QtNetwork_47_SRC}
)
-set(OPENSSL_SOURCES
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslcipher_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslkey_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslconfiguration_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslerror_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslsocket_wrapper.cpp
-)
-
-CHECK_QT_NETWORK_MACRO("Network OPENSSL" QT_NO_OPENSSL OPENSSL_SOURCES QtNetwork_SRC)
+check_qt_class(QtNetwork QSslCipher QtNetwork_SRC)
+check_qt_class(QtNetwork QSslConfiguration QtNetwork_SRC)
+check_qt_class(QtNetwork QSslError QtNetwork_SRC)
+check_qt_class(QtNetwork QSslKey QtNetwork_SRC)
+check_qt_class(QtNetwork QSslSocket QtNetwork_SRC)
set(QtNetwork_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtNetwork_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}