diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-28 12:51:09 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-10-01 09:11:39 +0000 |
commit | ebaceac469f19c51da390c7028d28e17ef991df4 (patch) | |
tree | 07e2ea02a5e45bae23201d890a8086279207cf41 /sources/pyside2/cmake | |
parent | 2f548c62d50b49e193c9f7575fa6a4601b697609 (diff) |
PySide2: Replace macro check_qt_class by the Qt configure system
Query the feature properties of the configure system to check whether
a class is present instead of running a compile test in QtGui and
QtNetwork.
Remove the macro invocation from QtWigets since the results
(QtWidgets_OPTIONAL_SRC, QtWidgets_DROPPED_ENTRIES) were not used.
Change-Id: I06e03fe1eef85f2340ab4cdb130b8b31b08f7f14
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/cmake')
-rw-r--r-- | sources/pyside2/cmake/Macros/PySideModules.cmake | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake index 36488912d..816190612 100644 --- a/sources/pyside2/cmake/Macros/PySideModules.cmake +++ b/sources/pyside2/cmake/Macros/PySideModules.cmake @@ -134,77 +134,6 @@ macro(create_pyside_module endforeach() endmacro() -#macro(check_qt_class_with_namespace module namespace class optional_source_files dropped_entries [namespace] [module]) -macro(check_qt_class module class optional_source_files dropped_entries) - if (${ARGC} GREATER 4) - set (namespace ${ARGV4}) - string(TOLOWER ${namespace} _namespace) - else () - set (namespace "") - endif () - if (${ARGC} GREATER 5) - set (include_file ${ARGV5}) - else () - set (include_file ${class}) - endif () - string(TOLOWER ${class} _class) - # Remove the "Qt" prefix. - string(SUBSTRING ${module} 2 -1 _module_no_qt_prefix) - if (_namespace) - set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide2/${module}/${_namespace}_${_class}_wrapper.cpp) - else () - set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide2/${module}/${_class}_wrapper.cpp) - endif () - if (DEFINED PYSIDE_${class}) - if (PYSIDE_${class}) - list(APPEND ${optional_source_files} ${_cppfile}) - else() - list(APPEND ${dropped_entries} PySide2.${module}.${class}) - endif() - else() - if (NOT ${namespace} STREQUAL "" ) - set (NAMESPACE_USE "using namespace ${namespace};") - else () - set (NAMESPACE_USE "") - endif () - set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test${class}.cxx) - file(WRITE ${SRC_FILE} - "#include <${include_file}>\n" - "${NAMESPACE_USE}\n" - "int main() { sizeof(${class}); }\n" - ) - - # Because Qt is built with -fPIC (by default), the compile tests also have to have that. - get_property(ADDITIONAL_FLAGS TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_OPTIONS) - - # Don't add version tagging, because for some reason linker fails with: - # (.qtversion[qt_version_tag]+0x0): undefined reference to `qt_version_tag' - # Force usage of the C++11 standard. CMAKE_CXX_STANDARD does not work with try_compile - # but the issue has a fix in CMake 3.9. Thus we use a terrible workaround, we pass the C++ - # standard flag the way CheckCXXSourceCompiles.cmake does it. - - set(ADDITIONAL_FLAGS "${ADDITIONAL_FLAGS} -DQT_NO_VERSION_TAGGING ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}") - - try_compile(Q_WORKS ${CMAKE_BINARY_DIR} - ${SRC_FILE} - CMAKE_FLAGS - "-DINCLUDE_DIRECTORIES=${QT_INCLUDE_DIR};${Qt5${_module_no_qt_prefix}_INCLUDE_DIRS}" - "-DCOMPILE_DEFINITIONS:STRING=${ADDITIONAL_FLAGS}" - OUTPUT_VARIABLE OUTPUT) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCheckQtClassTest.log ${OUTPUT}) - - set("PYSIDE_${class}" ${Q_WORKS} CACHE STRING "Has ${class} class been found?") - if(Q_WORKS) - message(STATUS "Checking for ${class} in ${module} -- found") - list(APPEND ${optional_source_files} ${_cppfile}) - else() - message(STATUS "Checking for ${class} in ${module} -- not found") - list(APPEND ${dropped_entries} PySide2.${module}.${class}) - endif() - endif() -endmacro() - - # Only add subdirectory if the associated Qt module is found. # As a side effect, this macro now also defines the variable ${name}_GEN_DIR # and must be called for every subproject. |