summaryrefslogtreecommitdiffstats
path: root/src/assistant/CMakeLists.txt
blob: 17d3c3c8c697df3c45bc97c040148edc67260752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause

if(NOT TARGET Qt::Sql OR NOT TARGET Qt::PrintSupport)
    return()
endif()

qt_exclude_tool_directories_from_default_target(
    assistant
    qhelpgenerator
)

if(NOT TARGET Qt::Sql)
    return()
endif()
if(NOT QT_FEATURE_assistant)
    return()
endif()
add_subdirectory(help)
add_subdirectory(assistant)
add_subdirectory(qhelpgenerator)

set(QLITEHTML_BIN_PATH ${INSTALL_BINDIR})
set(QLITEHTML_LIBRARY_PATH ${INSTALL_LIBDIR})
set(QLITEHTML_LIBRARY_TYPE STATIC)
set(BUILD_SHARED_LIBS OFF)
set(BUILD_TESTING OFF)
if(QT_FEATURE_static_runtime AND MSVC)
    set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
add_subdirectory(qlitehtml/src EXCLUDE_FROM_ALL)
if(TARGET qlitehtml)
    qt_autogen_tools_initial_setup(qlitehtml)
    # The litehtml and gumbo targets will not be available here if they are not built by Qt
    # but found in the system, because they are imported only to the subdirectory scope
    # where find_package was called. But that's fine, we wouldn't be able to set compiler flags
    # on them anyway.
    if(TARGET litehtml)
        qt_internal_set_exceptions_flags(litehtml OFF)
        qt_disable_warnings(litehtml)
    endif()
    if(TARGET gumbo)
        qt_disable_warnings(gumbo)
    endif()
    qt_disable_warnings(qlitehtml)
    qt_handle_multi_config_output_dirs(qlitehtml)
    set_target_properties(qlitehtml PROPERTIES
        RUNTIME_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_BINDIR}"
        LIBRARY_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}"
        ARCHIVE_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}")
else()
    message(FATAL_ERROR "qlitehtml not found. Did you run git submodule update --init --recursive?")
endif()