forked from pbek/qmarkdowntextedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (39 loc) · 1.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.3)
project(qmarkdowntextedit)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package( Qt5Core REQUIRED )
find_package( Qt5Widgets REQUIRED )
find_package( Qt5Gui REQUIRED )
qt5_wrap_ui(ui_qtexteditsearchwidget.h qtexteditsearchwidget.ui)
set(RESOURCE_FILES
media.qrc
)
qt5_add_resources(RESOURCE_ADDED ${RESOURCE_FILES})
set(SOURCE_FILES
lib/peg-markdown-highlight/pmh_definitions.h
lib/peg-markdown-highlight/pmh_parser.c
lib/peg-markdown-highlight/pmh_parser.h
highlighter.cpp
highlighter.h
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
qmarkdowntextedit.cpp
qmarkdowntextedit.h
qtexteditsearchwidget.ui
qtexteditsearchwidget.cpp
qtexteditsearchwidget.h)
add_executable(qmarkdowntextedit ${SOURCE_FILES} ${RESOURCE_ADDED})
include_directories(${Qt5Widgets_INCLUDES})
# We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5.
add_definitions(${Qt5Widgets_DEFINITIONS})
# Executables fail to build with Qt 5 in the default configuration
# without -fPIE. We add that here.
set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
target_link_libraries(qmarkdowntextedit ${Qt5Widgets_LIBRARIES})