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)
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.
20 set(QT_MIN_VERSION 5.11.0)
21 find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Widgets)
24 ${CMAKE_SOURCE_DIR}/src
33 src/customactionimpl.cpp
36 src/exceptionmanager.cpp
51 src/rangeselectimpl.cpp
59 # UIS_HDRS will be used later in add_executable
73 # and finally an resource file
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)
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)
94 # kate: indent-width 4; replace-tabs on;
97 # http://stackoverflow.com/questions/15054117/aligning-qgraphicsitems-to-a-grid-when-dragging-and-dropping