forked from BlurryLight/qtcreator-wakatime
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
74 lines (59 loc) · 1.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
cmake_minimum_required(VERSION 3.16)
# Remove when sharing with others.
list(APPEND CMAKE_PREFIX_PATH "${QTC_BUILD_PATH}")
project(Wakatime VERSION 0.1.1)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 17)
# for setting up quazip
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# for setting the vcpkg path to be used
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE})
# use static openssl
set(OPENSSL_USE_STATIC_LIBS ON)
find_package(OpenSSL REQUIRED)
find_package(QtCreator COMPONENTS Core ProjectExplorer TextEditor REQUIRED)
set(WAKA_SOURCES
waka_plugin.cpp
waka_options.cpp
waka_options_page.cpp
waka_options_widget.cpp
cligetter.cpp
)
set(WAKA_HEADERS
waka_plugin.h
waka_options.h
waka_constants.h
waka_global.h
waka_options_page.h
waka_options_widget.h
cligetter.h
)
set(WAKA_FORMS
waka_options.ui)
set(WAKA_RESOURCES
waka.qrc)
add_qtc_plugin(${PROJECT_NAME}
PLUGIN_DEPENDS
QtCreator::Core
QtCreator::TextEditor
QtCreator::ProjectExplorer
DEPENDS
QtCreator::ExtensionSystem
QtCreator::Utils
OpenSSL::SSL
SOURCES
README.md
${WAKA_HEADERS}
${WAKA_SOURCES}
${WAKA_FORMS}
${WAKA_RESOURCES}
)
message(STATUS "USING QT_VERSION: ${IDE_QT_VERSION_MIN}")
# set the definition for the version, important for breaking changes in 4.14 between 4.15
string(COMPARE LESS ${IDE_VERSION} "4.15.0" IDE_LESS_4_15_VERSION)
target_compile_definitions(${PROJECT_NAME} PUBLIC IDE_LESS_4_15_VERSION=${IDE_LESS_4_15_VERSION})
message(STATUS "QTCREATOR_VERSION LESS_THAN 4.15.0: ${IDE_LESS_15_VERSION} WITH VERSION ${IDE_VERSION}")
# add information about version
target_compile_definitions(${PROJECT_NAME} PUBLIC WAKATIME_PLUGIN_VERSION="${CMAKE_PROJECT_VERSION}")