Comment out unused (for now) variable isTag
[qgit4/redivivus.git] / CMakeLists.txt
blob47205897b0bb8c181a231b44ae405bfb0962990d
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)
10 project(qgit)
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.
17 set(CMAKE_AUTOMOC ON)
19 option(UseQt5 "Use Qt5?" ON)
20 if (UseQt5)
21   find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
22   set(QT_LIBRARIES Qt5::Widgets)
24   macro(qt_wrap_ui)
25     qt5_wrap_ui(${ARGN})
26   endmacro()
27   macro(qt_add_resources)
28     qt5_add_resources(${ARGN})
29   endmacro()
30 else()
31   find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui)
32   include(${QT_USE_FILE})
34   macro(qt_wrap_ui)
35     qt4_wrap_ui(${ARGN})
36   endmacro()
37   macro(qt_add_resources)
38     qt4_add_resources(${ARGN})
39   endmacro()
40 endif()
42 include_directories(
43     ${CMAKE_SOURCE_DIR}/src
46 set(CPP_SOURCES
47     src/annotate.cpp
48     src/cache.cpp
49     src/commitimpl.cpp
50     src/common.cpp
51     src/consoleimpl.cpp
52     src/customactionimpl.cpp
53     src/dataloader.cpp
54     src/domain.cpp
55     src/exceptionmanager.cpp
56     src/filecontent.cpp
57     src/FileHistory.cc
58     src/filelist.cpp
59     src/fileview.cpp
60     src/git.cpp
61     src/lanes.cpp
62     src/listview.cpp
63     src/inputdialog.cpp
64     src/mainimpl.cpp
65     src/myprocess.cpp
66     src/namespace_def.cpp
67     src/patchcontent.cpp
68     src/patchview.cpp
69     src/qgit.cpp
70     src/rangeselectimpl.cpp
71     src/revdesc.cpp
72     src/revsview.cpp
73     src/settingsimpl.cpp
74     src/smartbrowse.cpp
75     src/treeview.cpp
78 # UIS_HDRS will be used later in add_executable
79 QT_WRAP_UI(UIS_HDRS
80     src/commit.ui
81     src/console.ui
82     src/customaction.ui
83     src/fileview.ui
84     src/help.ui
85     src/mainview.ui
86     src/patchview.ui
87     src/rangeselect.ui
88     src/revsview.ui
89     src/settings.ui
92 # and finally an resource file
93 SET(RESOURCE_FILES
94     src/icons.qrc
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;
109 # notes:
110 # http://stackoverflow.com/questions/15054117/aligning-qgraphicsitems-to-a-grid-when-dragging-and-dropping