Changeset 14625


Ignore:
Timestamp:
Dec 17, 2015, 6:10:43 PM (6 years ago)
Author:
mikedld
Message:

Move DBus/COM checks up to where Qt is being searched for

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r14624 r14625  
    223223
    224224    set(QT_TARGETS)
     225    set(ENABLE_QT_COM_INTEROP OFF)
     226    set(ENABLE_QT_DBUS_INTEROP OFF)
     227
    225228    if(USE_QT5)
    226229        set(QT5_REQUIRED_MODULES Core Gui Widgets Network LinguistTools)
     
    244247                endif()
    245248            endforeach()
     249            if(Qt5AxContainer_FOUND AND Qt5AxServer_FOUND)
     250                set(ENABLE_QT_COM_INTEROP ON)
     251            endif()
     252            if(Qt5DBus_FOUND)
     253                set(ENABLE_QT_DBUS_INTEROP ON)
     254            endif()
    246255        endif()
    247256    else()
     
    265274                endif()
    266275            endforeach()
     276            if(QT_QAXCONTAINER_FOUND AND QT_QAXSERVER_FOUND)
     277                set(ENABLE_QT_COM_INTEROP ON)
     278            endif()
     279            if(QT_QTDBUS_FOUND)
     280                set(ENABLE_QT_DBUS_INTEROP ON)
     281            endif()
     282        endif()
     283    endif()
     284
     285    if(ENABLE_QT_COM_INTEROP)
     286        find_program(MIDL_EXECUTABLE midl)
     287        if(NOT MIDL_EXECUTABLE)
     288            set(ENABLE_QT_COM_INTEROP OFF)
    267289        endif()
    268290    endif()
    269291
    270292    set(QT_FOUND ON)
    271     if(NOT QT_TARGETS)
     293    if(NOT QT_TARGETS OR NOT (ENABLE_QT_COM_INTEROP OR ENABLE_QT_DBUS_INTEROP))
    272294        if(QT_IS_REQUIRED)
    273             message(FATAL_ERROR "Unable to find Qt libraries.")
     295            message(FATAL_ERROR "Unable to find required Qt libraries.")
    274296        endif()
    275297        set(QT_FOUND OFF)
  • trunk/qt/CMakeLists.txt

    r14624 r14625  
    2121        qt4_add_translation(${ARGN})
    2222    endmacro()
    23 endif()
    24 
    25 set(ENABLE_COM_INTEROP OFF)
    26 if(MSVC AND ((Qt5AxContainer_FOUND AND Qt5AxServer_FOUND) OR (QT_QAXCONTAINER_FOUND AND QT_QAXSERVER_FOUND)))
    27     set(ENABLE_COM_INTEROP ON)
    28 endif()
    29 
    30 set(ENABLE_DBUS_INTEROP OFF)
    31 if(Qt5DBus_FOUND OR QT_QTDBUS_FOUND)
    32     set(ENABLE_DBUS_INTEROP ON)
    33 endif()
    34 
    35 if(NOT ENABLE_COM_INTEROP AND NOT ENABLE_DBUS_INTEROP)
    36     message(FATAL_ERROR "Neither D-Bus nor COM interop is possible")
    3723endif()
    3824
     
    8672)
    8773
    88 if (NOT ENABLE_COM_INTEROP)
     74if (NOT ENABLE_QT_COM_INTEROP)
    8975    set_source_files_properties(ComInteropHelper.cc PROPERTIES HEADER_FILE_ONLY ON)
    9076endif()
    91 if (NOT ENABLE_DBUS_INTEROP)
     77if (NOT ENABLE_QT_DBUS_INTEROP)
    9278    set_source_files_properties(DBusInteropHelper.cc PROPERTIES HEADER_FILE_ONLY ON)
    9379endif()
     
    214200    "qtr.ico")
    215201
    216 if(ENABLE_COM_INTEROP)
    217     find_program(MIDL_EXECUTABLE midl)
     202if(ENABLE_QT_COM_INTEROP)
    218203    add_custom_command(
    219204        OUTPUT
     
    249234    "TRANSLATIONS_DIR=\"${CMAKE_INSTALL_FULL_DATADIR}/${TR_NAME}/translations\""
    250235    QT_NO_CAST_FROM_ASCII
    251     $<$<BOOL:${ENABLE_COM_INTEROP}>:ENABLE_COM_INTEROP>
    252     $<$<BOOL:${ENABLE_DBUS_INTEROP}>:ENABLE_DBUS_INTEROP>)
     236    $<$<BOOL:${ENABLE_QT_COM_INTEROP}>:ENABLE_COM_INTEROP>
     237    $<$<BOOL:${ENABLE_QT_DBUS_INTEROP}>:ENABLE_DBUS_INTEROP>)
    253238
    254239if(MSVC)
Note: See TracChangeset for help on using the changeset viewer.