forked from qt-creator/qt-creator
See the CMake documentation https://cmake.org/cmake/help/latest/ prop_tgt/FOLDER.html This allows placement of targets in the project view in specific folders like e.g. "tests" Qt Creator (ab)uses the FOLDER property for the "qtc_runnable" feature, see https://doc.qt.io/qtcreator/creator-run-settings.html which would not allow to have both. The "qtc_runnable" should be fixed by having a property "QTC_RUNNABLE" for a target and have Qt Creator parse the code. Fixes: QTCREATORBUG-28873 Change-Id: I73433de78b9a86f631ee9d7903db535b69b734f6 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
39 lines
833 B
CMake
39 lines
833 B
CMake
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)
|
|
set_target_properties(hello-widgets-glob PROPERTIES FOLDER "Glob")
|