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 2.8.11)
12 # As moc files are generated in the binary dir, tell CMake
13 # to always look for includes there:
14 set(CMAKE_INCLUDE_CURRENT_DIR ON)
16 # Instruct CMake to run moc automatically when needed.
19 option(UseQt5 "Use Qt5?" ON)
21 find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
22 set(QT_LIBRARIES Qt5::Widgets)
27 macro(qt_add_resources)
28 qt5_add_resources(${ARGN})
31 find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui)
32 include(${QT_USE_FILE})
37 macro(qt_add_resources)
38 qt4_add_resources(${ARGN})
43 ${CMAKE_SOURCE_DIR}/src
52 src/customactionimpl.cpp
55 src/exceptionmanager.cpp
70 src/rangeselectimpl.cpp
78 # UIS_HDRS will be used later in add_executable
92 # and finally an resource file
97 # this command will generate rules that will run rcc on all files from SAMPLE_RCS
98 # in result SAMPLE_RC_SRCS variable will contain paths to files produced by rcc
99 QT_ADD_RESOURCES(RC_SRCS ${RESOURCE_FILES})
101 add_executable(qgit ${CPP_SOURCES} ${UIS_HDRS} ${RC_SRCS})
102 target_link_libraries(qgit ${QT_LIBRARIES})
105 install(TARGETS qgit DESTINATION bin)
107 # kate: indent-width 4; replace-tabs on;
110 # http://stackoverflow.com/questions/15054117/aligning-qgraphicsitems-to-a-grid-when-dragging-and-dropping