Merge branch 'master' into doubleclickaction
[qgit4/redivivus.git] / CMakeLists.txt
blobc7e9ce2607ec018b162dc6febacc29a431ada21b
2 # see http://qt-project.org/doc/qt-5/cmake-manual.html
4 # see also http://www.kdab.com/using-cmake-with-qt-5/
5 # see also http://stackoverflow.com/questions/16245147/unable-to-include-a-ui-form-header-of-qt5-in-cmake
6 # see also http://www.qtcentre.org/wiki/index.php?title=Compiling_Qt4_apps_with_CMake
8 cmake_minimum_required(VERSION 3.10.2)
10 project(qgit)
11 include(GNUInstallDirs)
13 # As moc files are generated in the binary dir, tell CMake
14 # to always look for includes there:
15 set(CMAKE_INCLUDE_CURRENT_DIR ON)
17 # Instruct CMake to run moc automatically when needed.
18 set(CMAKE_AUTOMOC ON)
20 set(QT_MIN_VERSION 5.11.0)
21 find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Widgets)
23 include_directories(
24     ${CMAKE_SOURCE_DIR}/src
27 set(CPP_SOURCES
28     src/annotate.cpp
29     src/cache.cpp
30     src/commitimpl.cpp
31     src/common.cpp
32     src/consoleimpl.cpp
33     src/customactionimpl.cpp
34     src/dataloader.cpp
35     src/domain.cpp
36     src/exceptionmanager.cpp
37     src/filecontent.cpp
38     src/FileHistory.cc
39     src/filelist.cpp
40     src/fileview.cpp
41     src/git.cpp
42     src/lanes.cpp
43     src/listview.cpp
44     src/inputdialog.cpp
45     src/mainimpl.cpp
46     src/myprocess.cpp
47     src/namespace_def.cpp
48     src/patchcontent.cpp
49     src/patchview.cpp
50     src/qgit.cpp
51     src/rangeselectimpl.cpp
52     src/revdesc.cpp
53     src/revsview.cpp
54     src/settingsimpl.cpp
55     src/smartbrowse.cpp
56     src/treeview.cpp
59 # UIS_HDRS will be used later in add_executable
60 qt5_wrap_ui(UIS_HDRS
61     src/commit.ui
62     src/console.ui
63     src/customaction.ui
64     src/fileview.ui
65     src/help.ui
66     src/mainview.ui
67     src/patchview.ui
68     src/rangeselect.ui
69     src/revsview.ui
70     src/settings.ui
73 # and finally an resource file
74 set(RESOURCE_FILES
75     src/icons.qrc
78 # this command will generate rules that will run rcc on all files from SAMPLE_RCS
79 # in result SAMPLE_RC_SRCS variable will contain paths to files produced by rcc
80 qt5_add_resources(RC_SRCS ${RESOURCE_FILES})
82 add_executable(qgit ${CPP_SOURCES} ${UIS_HDRS} ${RC_SRCS})
83 target_link_libraries(qgit Qt5::Widgets)
86 install(TARGETS qgit DESTINATION bin)
88 if (UNIX)
89     install(FILES src/resources/qgit.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps)
90     install(FILES qgit.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
91     install(FILES qgit.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
92 endif()
94 # kate: indent-width 4; replace-tabs on;
96 # notes:
97 # http://stackoverflow.com/questions/15054117/aligning-qgraphicsitems-to-a-grid-when-dragging-and-dropping