-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
64 lines (50 loc) · 1.68 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
52
53
54
55
56
57
58
59
60
61
62
63
64
cmake_minimum_required(VERSION 3.8.2)
project(qtdarkstyle)
# Find includes in the build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Turn on automatic invocation of the MOC, UIC & RCC
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
message("This is great : ${AUTOUIC_EXECUTABLE}")
# There may be a way to tell up front if Qt5 is going to be found, but I haven't found
# a foolproof way to do it yet, so settle for the default error message for now.
#if(NOT CMAKE_PREFIX_PATH AND NOT Qt5Widgets_DIR)
# message(WARNING "CMAKE_PREFIX_PATH is not defined, so find_package may not work. Set the CMAKE_PREFIX_PATH "
# "environment variable to the install prefix of Qt 5, either on the command line as "
# "-DCMAKE_PREFIX_PATH=\"path/to/Qt5/lib/cmake\" or with set(CMAKE_PREFIX_PATH path/to/Qt5/lib/cmake)")
#endif(NOT CMAKE_PREFIX_PATH AND NOT Qt5Widgets_DIR)
# Add a compiler flag
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
# Make this a GUI application on Windows
if(WIN32)
set(CMAKE_WIN32_EXECUTABLE ON)
endif()
# Find the QtWidgets library
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets)
set(HEADERS
DarkStyle.h
framelesswindow.h
mainwindow.h
windowdragger.h
)
set(SRCS
DarkStyle.cpp
framelesswindow.cpp
main.cpp
mainwindow.cpp
windowdragger.cpp
)
set(RCS
darkstyle.qrc
framelesswindow.qrc
)
set(UI
framelesswindow.ui
mainwindow.ui
)
# Tell CMake to create the helloworld executable
add_executable(qtdarkstyle ${SRCS} ${HEADERS} ${UI} ${RCS})
target_include_directories(qtdarkstyle PRIVATE include)
# Add the Qt5 Widgets for linking
target_link_libraries(qtdarkstyle Qt5::Core Qt5::Gui Qt5::Widgets)