From fd809a7c5ff07471ae09b9d72fb700a6210f55fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Sun, 12 Mar 2023 14:14:03 -0300 Subject: [PATCH] CMake: Update to work with Qt6 using Mac and windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- CMakeLists.txt | 1 + src/CMakeLists.txt | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f9b30d..f66b31f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,5 +13,6 @@ find_package(Qt6 REQUIRED Quick QuickControls2 ) +qt_standard_project_setup() add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5fcd961..ca8c3f9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,8 @@ -set(CMAKE_AUTOMOC ON) - # Automatically link Qt executables to qtmain target on Windows cmake_policy(SET CMP0020 NEW) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + qt6_add_resources(RESOURCES ../resources.qrc) add_executable(qhot @@ -27,7 +27,7 @@ target_link_libraries(qhot Qt6::QuickControls2 ) -get_target_property(QT_MOC_EXECUTABLE Qt6::moc LOCATION) +get_target_property(QT_MOC_EXECUTABLE Qt6::moc IMPORTED_LOCATION) get_filename_component(QT_INSTALL_PREFIX ${QT_MOC_EXECUTABLE} DIRECTORY) if (EXISTS ${QT_INSTALL_PREFIX}) install( @@ -37,3 +37,4 @@ if (EXISTS ${QT_INSTALL_PREFIX}) ) endif() +set_target_properties(qhot PROPERTIES MACOSX_BUNDLE ON)