Skip to content

Commit

Permalink
Add a variable for Qt modules
Browse files Browse the repository at this point in the history
  • Loading branch information
adazem009 committed Nov 28, 2023
1 parent 7169a8d commit 52b14e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(QML_IMPORT_PATH "${QML_IMPORT_PATH};${PROJECT_SOURCE_DIR}/src/qml" PARENT_SC

target_compile_definitions(libscratchcpp-gui PRIVATE SCRATCHCPPGUI_LIBRARY)

target_link_libraries(libscratchcpp-gui PRIVATE Qt6::Gui Qt6::Qml Qt6::Quick)
linkQt(libscratchcpp-gui)

include(build/SetUpLibscratchcpp.cmake)
target_link_libraries(libscratchcpp-gui PRIVATE scratchcpp)
Expand Down
5 changes: 5 additions & 0 deletions build/FindQt.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
find_package(Qt6 6.6 COMPONENTS Gui Qml Quick REQUIRED)
set(QT_LIBS Qt6::Gui Qt6::Qml Qt6::Quick)

function(linkQt TARGET)
target_link_libraries(${TARGET} PRIVATE ${QT_LIBS})
endfunction()

0 comments on commit 52b14e8

Please sign in to comment.