aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/cmakeprojectmanager/hello-widgets/CMakeLists.txt
blob: 8c0c413d663eaa03f29511cdbf85f4c8f71df2a6 (plain)
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
cmake_minimum_required(VERSION 3.18)

project(hello-widgets)

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(Qt6 REQUIRED COMPONENTS Widgets)

qt_add_executable(hello-widgets
    main.cpp
    mainwindow.cpp
    mainwindow.h
    mainwindow.ui
)

target_link_libraries(hello-widgets PRIVATE Qt6::Widgets)

include(my_add_executable.cmake)

my_add_executable(hello-my-widgets
  main.cpp
  mainwindow.cpp
  mainwindow.h
  mainwindow.ui
)

target_link_libraries(hello-my-widgets PRIVATE Qt6::Widgets)

file(GLOB SOURCE_FILES CONFIGURE_DEPENDS *.cpp *.h *.ui)

add_executable(hello-widgets-glob ${SOURCE_FILES})
target_link_libraries(hello-widgets-glob PRIVATE Qt6::Widgets)