Make qlitehtml a dynamic library

So it can be re-used by other plugins.

Fixes: QTCREATORBUG-24330
Change-Id: Ic9ff865f96c01a37584b02d1125717a307cc79ed
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-09-22 17:35:59 +02:00
parent 049941df44
commit bf536a0441
3 changed files with 49 additions and 9 deletions

View File

@@ -27,13 +27,15 @@ find_package(Qt5 COMPONENTS Widgets REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
add_library(qlitehtml STATIC
add_qtc_library(qlitehtml
PUBLIC_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS Qt5::Widgets litehtml
PROPERTIES
POSITION_INDEPENDENT_CODE ON
SOURCES
container_qpainter.cpp container_qpainter.h
qlitehtml_global.h
qlitehtmlwidget.cpp qlitehtmlwidget.h
)
target_include_directories(qlitehtml PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(qlitehtml PRIVATE Qt5::Widgets litehtml)
set_target_properties(qlitehtml PROPERTIES POSITION_INDEPENDENT_CODE ON)

View File

@@ -0,0 +1,36 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <qglobal.h>
#if defined(QLITEHTML_LIBRARY)
# define QLITEHTML_EXPORT Q_DECL_EXPORT
#elif defined(QLITEHTML_STATIC_LIBRARY) // Abuse single files for manual tests
# define QLITEHTML_EXPORT
#else
# define QLITEHTML_EXPORT Q_DECL_IMPORT
#endif

View File

@@ -25,6 +25,8 @@
#pragma once
#include "qlitehtml_global.h"
#include <QAbstractScrollArea>
#include <QTextDocument>
@@ -32,7 +34,7 @@
class QLiteHtmlWidgetPrivate;
class QLiteHtmlWidget : public QAbstractScrollArea
class QLITEHTML_EXPORT QLiteHtmlWidget : public QAbstractScrollArea
{
Q_OBJECT
public: