Version 2.6
[qgit4/redivivus.git] / CMakeLists.txt
blobddccd04f23d7fd27bc6cff36286104a05fd5e5e8
2 # see http://www.kdab.com/using-cmake-with-qt-5/
3 # see http://stackoverflow.com/questions/16245147/unable-to-include-a-ui-form-header-of-qt5-in-cmake
4 # see http://www.qtcentre.org/wiki/index.php?title=Compiling_Qt4_apps_with_CMake
6 cmake_minimum_required(VERSION 2.8.7)
8 # Tell CMake to run moc when necessary:
9 set(CMAKE_AUTOMOC ON)
10 # As moc files are generated in the binary dir, tell CMake
11 # to always look for includes there:
12 set(CMAKE_INCLUDE_CURRENT_DIR ON)
14 # Widgets finds its own dependencies (QtGui and QtCore).
15 find_package(Qt5Widgets REQUIRED)
17 # The Qt5Widgets_INCLUDES also includes the include directories for
18 # dependencies QtCore and QtGui
19 include_directories(${Qt5Widgets_INCLUDES}) # TODO: needed?
21 # We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5.
22 add_definitions(${Qt5Widgets_DEFINITIONS})
24 # Executables fail to build with Qt 5 in the default configuration
25 # without -fPIE. We add that here.
26 set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
28 include_directories(
29     .
30     ${CMAKE_SOURCE_DIR}/src
33 set(CPP_SOURCES
34     src/annotate.cpp
35     src/cache.cpp
36     src/commitimpl.cpp
37     src/common.cpp
38     src/consoleimpl.cpp
39     src/customactionimpl.cpp
40     src/dataloader.cpp
41     src/domain.cpp
42     src/exceptionmanager.cpp
43     src/filecontent.cpp
44     src/FileHistory.cc
45     src/filelist.cpp
46     src/fileview.cpp
47     src/git.cpp
48     src/lanes.cpp
49     src/listview.cpp
50     src/mainimpl.cpp
51     src/myprocess.cpp
52     src/namespace_def.cpp
53     src/patchcontent.cpp
54     src/patchview.cpp
55     src/qgit.cpp
56     src/rangeselectimpl.cpp
57     src/revdesc.cpp
58     src/revsview.cpp
59     src/settingsimpl.cpp
60     src/smartbrowse.cpp
61     src/treeview.cpp
64 # UIS_HDRS will be used later in add_executable
65 QT5_WRAP_UI(UIS_HDRS
66     src/commit.ui
67     src/console.ui
68     src/customaction.ui
69     src/fileview.ui
70     src/help.ui
71     src/mainview.ui
72     src/patchview.ui
73     src/rangeselect.ui
74     src/revsview.ui
75     src/settings.ui
78 # and finally an resource file
79 SET(RESOURCE_FILES
80     ./src/icons.qrc
83 # this command will generate rules that will run rcc on all files from SAMPLE_RCS
84 # in result SAMPLE_RC_SRCS variable will contain paths to files produced by rcc
85 QT5_ADD_RESOURCES(RC_SRCS ${RESOURCE_FILES})
88 add_executable(qgit ${CPP_SOURCES} ${UIS_HDRS} ${RC_SRCS})
90 # The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
91 target_link_libraries(qgit ${Qt5Widgets_LIBRARIES})
93 install(TARGETS qgit DESTINATION bin)
95 # kate: indent-width 4; replace-tabs on;
97 # notes:
98 # http://stackoverflow.com/questions/15054117/aligning-qgraphicsitems-to-a-grid-when-dragging-and-dropping