Skip to content

Commit

Permalink
CMake: Update to work with Qt6 using Mac and windows
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Mar 12, 2023
1 parent 6fec14a commit fd809a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ find_package(Qt6 REQUIRED
Quick
QuickControls2
)
qt_standard_project_setup()

add_subdirectory(src)
7 changes: 4 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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(
Expand All @@ -37,3 +37,4 @@ if (EXISTS ${QT_INSTALL_PREFIX})
)
endif()

set_target_properties(qhot PROPERTIES MACOSX_BUNDLE ON)

0 comments on commit fd809a7

Please sign in to comment.