-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
125 lines (103 loc) · 4.17 KB
/
CMakeLists.txt
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
cmake_minimum_required(VERSION 3.10)
project(qtcreator-plugin-sphinx)
set( QTC_PLUGIN_NAME Sphinx )
option(WITH_TESTS "Build Tests" ON)
option(WITH_DEBUG_CMAKE "Enabled CMake project debugging functionality (e.g. source file disk checking)" OFF)
option(BUILD_WITH_PCH "Build with precompiled headers" OFF)
# Force C++ standard, do not fall back, do not use compiler extensions
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Set up Qt stuff:
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC OFF)
set( CMAKE_INSTALL_MESSAGE "LAZY" ) # one of NEVER, LAZY, ALWAYS
find_package(QtCreator COMPONENTS Core TextEditor ProjectExplorer REQUIRED)
#find_package(QT NAMES Qt6 Qt5 COMPONENTS Test XmlPatterns LinguistTools Widgets REQUIRED)
find_package(Qt5 COMPONENTS Test LinguistTools Widgets REQUIRED)
add_feature_info("Build tests" ${WITH_TESTS} "")
set( QTC_PLUGIN_REVISION 222)
add_qtc_plugin( ${QTC_PLUGIN_NAME}
PLUGIN_DEPENDS QtCreator::Core QtCreator::TextEditor QtCreator::ProjectExplorer
DEPENDS Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Test QtCreator::qlitehtml
SOURCES
editor/SphinxCodeModel.cpp
qtcreator-sphinx-plugin.cpp
qtcreator-sphinx-plugin-projectsettings.cpp
editor/SphinxOutputParser.cpp
editor/SphinxHtmlPage.cpp
editor/SphinxPreviewPage.cpp
editor/SphinxRightPaneWidget.cpp
editor/SphinxDocument.cpp
editor/SphinxEditor.cpp
editor/SphinxEditorFactory.cpp
editor/SphinxEditorWidget.cpp
editor/SphinxHighlighter.cpp
editor/SphinxFormatter.cpp
editor/SphinxFormatActions.cpp
editor/SphinxIndenter.cpp
editor/SphinxCodeStylePreferencesFactory.cpp
editor/SphinxCompletionAssist.cpp
editor/SphinxRstcheckHighlighter.cpp
editor/SphinxRest2Html.cpp
options/SphinxOptionsPage.cpp
options/SphinxOptionsWidget.cpp
options/SphinxSettings.cpp
editor/SphinxCodeModel.h
editor/SphinxWidgetHelpers.h
editor/SphinxWidgetHelpers.cpp
qtcreator-sphinx-plugin.h
qtcreator-sphinx-plugin_global.h
qtcreator-sphinx-pluginconstants.h
qtcreator-sphinx-plugin-projectsettings.h
editor/SphinxOutputParser.h
editor/SphinxHtmlPage.h
editor/SphinxPreviewPage.h
editor/SphinxRightPaneWidget.h
editor/SphinxDocument.h
editor/SphinxEditor.h
editor/SphinxEditorFactory.h
editor/SphinxHighlighter.h
editor/SphinxEditorWidget.h
editor/SphinxFormatter.h
editor/SphinxFormatActions.h
editor/SphinxIndenter.h
editor/SphinxCodeStylePreferencesFactory.h
editor/SphinxCompletionAssist.h
editor/SphinxRstcheckHighlighter.h
editor/SphinxRest2Html.h
editor/SphinxRegularExpressions.h
editor/SphinxRegularExpressions.cpp
options/SphinxOptionsPage.h
options/SphinxOptionsWidget.h
options/SphinxSettings.h
qtcreator-sphinx-plugin.qrc
)
add_translation_targets( ${QTC_PLUGIN_NAME} INSTALL_DESTINATION "${IDE_DATA_PATH}/translations" LANGUAGES "de" TARGETS ${QTC_PLUGIN_NAME} )
extend_qtc_plugin( ${QTC_PLUGIN_NAME}
CONDITION WITH_TESTS
SOURCES
tests/tst_formatter.cpp
tests/tst_formatter.h
tests/tst_completion.cpp
tests/tst_completion.h
tests/tst_rightpane.cpp
tests/tst_rightpane.h
DEPENDS Qt6::Test
)
enable_testing()
INSTALL( DIRECTORY "share/qtcreator/sphinx" DESTINATION "${IDE_DATA_PATH}" PATTERN "__pycache__" EXCLUDE )
INSTALL( FILES "share/qtcreator/snippets/sphinx.xml" DESTINATION "${IDE_DATA_PATH}/snippets" )
string( REPLACE "${IDE_CMAKE_INSTALL_PATH}/${IDE_CASED_ID}" "" qtc_DIR "${QtCreator_DIR}" )
function( qtc_add_plugin_test plugin)
string( REPLACE "${IDE_CMAKE_INSTALL_PATH}/${IDE_CASED_ID}" "" qtc_DIR "${QtCreator_DIR}" )
add_test (NAME test_plugin_${plugin}_install
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${qtc_DIR} -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
)
set( qtc_app "${qtc_DIR}/${IDE_APP_PATH}/${IDE_APP_TARGET}" )
add_test( NAME test_plugin_${plugin} COMMAND ${qtc_app} -test ${plugin} )
set_tests_properties( test_plugin_${plugin} PROPERTIES FIXTURES_REQUIRED test_plugin_${plugin}_install )
endfunction()
qtc_add_plugin_test( ${QTC_PLUGIN_NAME} )