/
CMakeLists.txt
135 lines (107 loc) · 3.84 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
126
127
128
129
130
131
132
133
134
135
cmake_minimum_required(VERSION 3.5)
project(cpeditor LANGUAGES CXX VERSION 6.1.4)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(WIN32)
SET(GUI_TYPE WIN32)
endif()
find_package(Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt5 COMPONENTS Network REQUIRED)
add_subdirectory(third_party/QCodeEditor)
set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
add_subdirectory(third_party/singleapplication)
add_subdirectory(third_party/QtFindReplaceDialog/dialogs)
add_subdirectory(third_party/lsp-cpp)
configure_file(version.hpp.in ${CMAKE_BINARY_DIR}/generated/version.hpp)
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
FIND_PACKAGE(Git)
IF(GIT_FOUND)
EXECUTE_PROCESS(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE "COMMIT_HASH"
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
add_definitions(-DGIT_COMMIT_HASH="${COMMIT_HASH}")
MESSAGE( STATUS "Git commit hash: ${COMMIT_HASH}")
ENDIF(GIT_FOUND)
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
add_executable(cpeditor
${GUI_TYPE}
include/Core/Checker.hpp
include/Core/Compiler.hpp
include/Core/Runner.hpp
include/Core/Formatter.hpp
include/Core/SettingsManager.hpp
include/Core/MessageLogger.hpp
include/Core/EventLogger.hpp
src/Core/Checker.cpp
src/Core/Compiler.cpp
src/Core/Runner.cpp
src/Core/Formatter.cpp
src/Core/SettingsManager.cpp
src/Core/MessageLogger.cpp
src/Core/EventLogger.cpp
include/Telemetry/UpdateNotifier.hpp
src/Telemetry/UpdateNotifier.cpp
include/Widgets/DiffViewer.hpp
include/Widgets/TestCaseEdit.hpp
include/Widgets/TestCase.hpp
include/Widgets/TestCases.hpp
src/Widgets/DiffViewer.cpp
src/Widgets/TestCaseEdit.cpp
src/Widgets/TestCase.cpp
src/Widgets/TestCases.cpp
include/Extensions/CompanionServer.hpp
include/Extensions/CFTool.hpp
include/Extensions/EditorTheme.hpp
src/Extensions/CompanionServer.cpp
src/Extensions/CFTool.cpp
src/Extensions/EditorTheme.cpp
include/mainwindow.hpp
include/preferencewindow.hpp
include/appwindow.hpp
src/mainwindow.cpp
src/preferencewindow.cpp
src/appwindow.cpp
include/Util.hpp
src/Util.cpp
third_party/diff_match_patch/diff_match_patch.h
third_party/diff_match_patch/diff_match_patch.cpp
src/main.cpp
ui/mainwindow.ui
ui/preferencewindow.ui
ui/appwindow.ui
${CMAKE_BINARY_DIR}/generated/version.hpp
resources/resources.qrc
assets/appicon.rc)
include_directories("third_party/QCodeEditor/include")
include_directories("third_party/diff_match_patch")
include_directories("third_party/QtFindReplaceDialog")
include_directories("third_party/lsp-cpp/include")
include_directories("include/")
include_directories("generated/")
target_link_libraries(cpeditor PRIVATE Qt5::Widgets)
target_link_libraries(cpeditor PRIVATE Qt5::Network)
target_link_libraries(cpeditor PRIVATE QCodeEditor)
target_link_libraries(cpeditor PRIVATE SingleApplication)
target_link_libraries(cpeditor PRIVATE QtFindReplaceDialog)
target_link_libraries(cpeditor PRIVATE LSPClient)
if(APPLE)
set_target_properties(cpeditor
PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}
MACOSX_BUNDLE_GUI_IDENTIFIER "org.coder3101.cpeditor"
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_LONG_VERSION_STRING ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
MACOSX_BUNDLE_ICON_FILE "cpeditor.icns"
MACOSX_BUNDLE_COPYRIGHT "GNU GPL v3"
RESOURCE ".ci/mac/cpeditor.icns"
)
endif()