Skip to content

Commit fd809a7

Browse files
CMake: Update to work with Qt6 using Mac and windows
Signed-off-by: Patrick José Pereira <[email protected]>
1 parent 6fec14a commit fd809a7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ find_package(Qt6 REQUIRED
1313
Quick
1414
QuickControls2
1515
)
16+
qt_standard_project_setup()
1617

1718
add_subdirectory(src)

src/CMakeLists.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
set(CMAKE_AUTOMOC ON)
2-
31
# Automatically link Qt executables to qtmain target on Windows
42
cmake_policy(SET CMP0020 NEW)
53

4+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
5+
66
qt6_add_resources(RESOURCES ../resources.qrc)
77

88
add_executable(qhot
@@ -27,7 +27,7 @@ target_link_libraries(qhot
2727
Qt6::QuickControls2
2828
)
2929

30-
get_target_property(QT_MOC_EXECUTABLE Qt6::moc LOCATION)
30+
get_target_property(QT_MOC_EXECUTABLE Qt6::moc IMPORTED_LOCATION)
3131
get_filename_component(QT_INSTALL_PREFIX ${QT_MOC_EXECUTABLE} DIRECTORY)
3232
if (EXISTS ${QT_INSTALL_PREFIX})
3333
install(
@@ -37,3 +37,4 @@ if (EXISTS ${QT_INSTALL_PREFIX})
3737
)
3838
endif()
3939

40+
set_target_properties(qhot PROPERTIES MACOSX_BUNDLE ON)

0 commit comments

Comments
 (0)