CMakeLists.txt 2.6 KB
Newer Older
1
find_package(Qt5Concurrent ${QT_MIN_VERSION} QUIET)
2
find_package(
3
  KF5 ${KF5_DEP_VERSION}
4
5
6
7
8
9
10
11
12
  QUIET
  COMPONENTS
    GuiAddons
    NewStuff
)

set_package_properties(KFGuiAddons PROPERTIES PURPOSE "Required to build the project addon")
set_package_properties(KF5NewStuff PROPERTIES PURPOSE "Required to build the project addon")

13
if(NOT KF5_FOUND OR NOT Qt5Concurrent_FOUND)
14
15
  return()
endif()
16

17
18
add_library(kateprojectplugin MODULE "")
target_compile_definitions(kateprojectplugin PRIVATE TRANSLATION_DOMAIN="kateproject")
19

20
target_link_libraries(
21
  kateprojectplugin
22
  PRIVATE
23
    Qt5::Concurrent
24
    KF5::GuiAddons
25
    KF5::I18n
26
    KF5::NewStuff
27
    KF5::TextEditor
Christoph Cullmann's avatar
Christoph Cullmann committed
28
)
29

30
31
32
33
34
35
target_include_directories(
    kateprojectplugin
    PUBLIC
    ${CMAKE_SOURCE_DIR}/shared
)

36
include(CheckFunctionExists)
37
check_function_exists(ctermid HAVE_CTERMID)
38

39
40
41
if(HAVE_CTERMID)
  target_compile_definitions(kateprojectplugin PRIVATE HAVE_CTERMID)
endif()
42

43
target_sources(
44
  kateprojectplugin
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  PRIVATE
    fileutil.cpp
    kateprojectplugin.cpp
    kateprojectpluginview.cpp
    kateproject.cpp
    kateprojectworker.cpp
    kateprojectitem.cpp
    kateprojectview.cpp
    kateprojectviewtree.cpp
    kateprojecttreeviewcontextmenu.cpp
    kateprojectinfoview.cpp
    kateprojectcompletion.cpp
    kateprojectindex.cpp
    kateprojectinfoviewindex.cpp
    kateprojectinfoviewterminal.cpp
    kateprojectinfoviewcodeanalysis.cpp
    kateprojectinfoviewnotes.cpp
    kateprojectconfigpage.cpp
    kateprojectcodeanalysistool.cpp
64
    branchesdialog.cpp
65
    branchcheckoutdialog.cpp
66
    branchesdialogmodel.cpp
67
68
    gitwidget.cpp
    gitstatusmodel.cpp
Waqar Ahmed's avatar
Waqar Ahmed committed
69
    gitcommitdialog.cpp
Waqar Ahmed's avatar
Waqar Ahmed committed
70
    stashdialog.cpp
71
    filehistorywidget.cpp
72
    ${CMAKE_SOURCE_DIR}/shared/quickdialog.cpp
Waqar Ahmed's avatar
Waqar Ahmed committed
73
    pushpulldialog.cpp
74
    comparebranchesview.cpp
Waqar Ahmed's avatar
Waqar Ahmed committed
75

76
77
78
79
    tools/kateprojectcodeanalysistoolcppcheck.cpp
    tools/kateprojectcodeanalysistoolflake8.cpp
    tools/kateprojectcodeanalysistoolshellcheck.cpp
    tools/kateprojectcodeanalysisselector.cpp
Waqar Ahmed's avatar
Waqar Ahmed committed
80
81
    tools/kateprojectcodeanalysistoolclazy.cpp
    tools/kateprojectcodeanalysistoolclazycurrent.cpp
Waqar Ahmed's avatar
Waqar Ahmed committed
82

Waqar Ahmed's avatar
Waqar Ahmed committed
83
    git/gitdiff.cpp
84
    git/gitutils.cpp
85
    git/gitstatus.cpp
Waqar Ahmed's avatar
Waqar Ahmed committed
86

87
    plugin.qrc
Michal Humpula's avatar
Michal Humpula committed
88
)
89

90
kcoreaddons_desktop_to_json(kateprojectplugin kateprojectplugin.desktop)
91
92
93

# ensure we are able to load plugins pre-install, too, directories must match!
set_target_properties(kateprojectplugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ktexteditor")
94
95
install(TARGETS kateprojectplugin DESTINATION ${KDE_INSTALL_PLUGINDIR}/ktexteditor)
install(FILES kateproject.example DESTINATION ${KDE_INSTALL_DATADIR}/kateproject)
Christoph Cullmann's avatar
Christoph Cullmann committed
96

97
98
if(BUILD_TESTING)
  add_subdirectory(autotests)
Heiko Becker's avatar
Heiko Becker committed
99
endif()