-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
134 lines (111 loc) · 3.38 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
cmake_minimum_required(VERSION 3.5)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
option(BUILD_CLAR OFF)
option(BUNDLE_LIBGIT2 ON)
option(BUILD_LIBGIT2CPP_EXAMPLES OFF)
add_subdirectory(3rd-party/libgit2cpp)
project(quokkagit VERSION 0.2.0)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(version)
add_executable(${PROJECT_NAME}
src/application.cpp
src/application.h
src/data/blamedata.h
src/data/diffentry.h
src/data/helpers.cpp
src/data/helpers.h
src/data/logentry.cpp
src/data/logentry.h
src/data/settings.cpp
src/data/settings.h
src/dialogs/aboutdialog.cpp
src/dialogs/aboutdialog.h
src/dialogs/aboutdialog.ui
src/dialogs/blamedialog.cpp
src/dialogs/blamedialog.h
src/dialogs/blamedialog.ui
src/dialogs/branchselectiondialog.cpp
src/dialogs/branchselectiondialog.h
src/dialogs/branchselectiondialog.ui
src/dialogs/debuglogdialog.cpp
src/dialogs/debuglogdialog.h
src/dialogs/debuglogdialog.ui
src/dialogs/settingsdialog.cpp
src/dialogs/settingsdialog.h
src/dialogs/settingsdialog.ui
src/menus/logcolumnvisibilitymenu.cpp
src/menus/logcolumnvisibilitymenu.h
src/menus/logcontextmenu.cpp
src/menus/logcontextmenu.h
src/models/blamemodel.cpp
src/models/blamemodel.h
src/models/filelogmodel.cpp
src/models/filelogmodel.h
src/models/filelogproxymodel.cpp
src/models/filelogproxymodel.h
src/models/logfilterproxymodel.cpp
src/models/logfilterproxymodel.h
src/models/logmodel.cpp
src/models/logmodel.h
src/main.cpp
src/tools/difftool.cpp
src/tools/difftool.h
src/tools/git2wrapper.cpp
src/tools/git2wrapper.h
src/widgets/mainwindow.cpp
src/widgets/mainwindow.h
src/widgets/mainwindow.ui
src/widgets/tablewidget.cpp
src/widgets/tablewidget.h
resources/resources.qrc
.travis.yml
)
find_package(Qt5 COMPONENTS Core Widgets)
target_include_directories(${PROJECT_NAME}
PRIVATE
src
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
git2cpp
Qt5::Widgets
Qt5::Core
)
include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Auto. CCACHE
if(UNIX)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
endif()
# Auto. distcc
if(UNIX)
find_program(DISTCC_FOUND distcc)
if(DISTCC_FOUND)
set(ENV{CCACHE_PREFIX} distcc)
endif(DISTCC_FOUND)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES resources/org.ballessay.quokkagit.desktop DESTINATION share/applications)
install(FILES resources/quokkagit.png DESTINATION share/icons/hicolor/256x256/apps)
install(FILES resources/quokkagit.appdata.xml DESTINATION share/metainfo)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
option(USE_ASAN "Build with address sanitizer" OFF)
if(USE_ASAN)
target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=address)
target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=address)
endif()