forked from Megaxela/QCodeEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
95 lines (82 loc) · 2.24 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
cmake_minimum_required(VERSION 3.6)
project(QCodeEditor)
set(CMAKE_CXX_STANDARD 11)
option(BUILD_EXAMPLE "Example building required" Off)
if (${BUILD_EXAMPLE})
message(STATUS "QCodeEditor example will be built.")
add_subdirectory(example)
endif()
set(RESOURCES_FILE
resources/qcodeeditor_resources.qrc
)
set(INCLUDE_FILES
include/QHighlightRule
include/QCodeEditor
include/QCXXHighlighter
include/QLineNumberArea
include/QStyleSyntaxHighlighter
include/QSyntaxStyle
include/QGLSLCompleter
include/QGLSLHighlighter
include/QLanguage
include/QXMLHighlighter
include/QJSONHighlighter
include/QFramedTextAttribute
include/internal/QHighlightRule.hpp
include/internal/QCodeEditor.hpp
include/internal/QCXXHighlighter.hpp
include/internal/QLineNumberArea.hpp
include/internal/QStyleSyntaxHighlighter.hpp
include/internal/QSyntaxStyle.hpp
include/internal/QGLSLCompleter.hpp
include/internal/QGLSLHighlighter.hpp
include/internal/QLanguage.hpp
include/internal/QXMLHighlighter.hpp
include/internal/QJSONHighlighter.hpp
include/internal/QFramedTextAttribute.hpp
)
set(SOURCE_FILES
src/internal/QCodeEditor.cpp
src/internal/QLineNumberArea.cpp
src/internal/QCXXHighlighter.cpp
src/internal/QSyntaxStyle.cpp
src/internal/QStyleSyntaxHighlighter.cpp
src/internal/QGLSLCompleter.cpp
src/internal/QGLSLHighlighter.cpp
src/internal/QLanguage.cpp
src/internal/QXMLHighlighter.cpp
src/internal/QJSONHighlighter.cpp
src/internal/QFramedTextAttribute.cpp
)
# Create code for QObjects
set(CMAKE_AUTOMOC On)
# Create code from resource files
set(CMAKE_AUTORCC ON)
# Find includes in corresponding build directories
find_package(Qt5Core CONFIG REQUIRED)
find_package(Qt5Widgets CONFIG REQUIRED)
find_package(Qt5Gui CONFIG REQUIRED)
add_library(QCodeEditor STATIC
${RESOURCES_FILE}
${SOURCE_FILES}
${INCLUDE_FILES}
)
target_include_directories(QCodeEditor PUBLIC
include
)
target_compile_options(QCodeEditor
PRIVATE
-ansi
-pedantic
-Wall
-Wextra
-Weffc++
-Woverloaded-virtual
-Winit-self
-Wunreachable-code
)
target_link_libraries(QCodeEditor
Qt5::Core
Qt5::Widgets
Qt5::Gui
)