-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (39 loc) · 967 Bytes
/
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
cmake_minimum_required(VERSION 3.5)
project(cmake_issue_16776 VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
set(UI_FILES
src/mainwindow.ui
src/widget1.ui
src/widget2.ui
)
# qt_wrap_ui(UIC_FILES ${UI_FILES})
set(HEADER_FILES
src/mainwindow.h
src/widget1.h
src/widget2.h
)
# qt_wrap_cpp(MOC_FILES ${HEADER_FILES})
set(SOURCE_FILES
src/main.cpp
src/mainwindow.cpp
src/widget1.cpp
src/widget2.cpp
)
add_executable(example
${SOURCE_FILES}
${HEADER_FILES}
${UI_FILES}
# ${MOC_FILES}
# ${UIC_FILES}
)
target_link_libraries(example PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(example PROPERTIES
WIN32_EXECUTABLE TRUE
)