Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for qt6 #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ CMakeLists.txt.user*
.idea

# End of https://www.gitignore.io/api/qt

/.cache
7 changes: 5 additions & 2 deletions examples/multiple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

find_package(Qt6 COMPONENTS Core OpenGLWidgets REQUIRED)

if (ANDROID)
add_library(qt_imgui_demo_widgets SHARED demo-widgets.cpp)
else()
add_executable(qt_imgui_demo_widgets demo-widgets.cpp)
endif()
target_link_libraries(qt_imgui_demo_widgets PRIVATE qt_imgui_widgets)
target_link_libraries(qt_imgui_demo_widgets PRIVATE implot)

target_link_libraries(qt_imgui_demo_widgets PRIVATE qt_imgui_widgets implot Qt6::OpenGLWidgets)

if(ANDROID)
include(${CMAKE_CURRENT_LIST_DIR}/../../tools/qt-android-cmake/AddQtAndroidApk.cmake)
Expand Down
7 changes: 5 additions & 2 deletions examples/widget/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

find_package(Qt6 COMPONENTS Core OpenGLWidgets REQUIRED)

if (ANDROID)
add_library(qt_imgui_demo_widget SHARED demo-widget.cpp)
else()
add_executable(qt_imgui_demo_widget demo-widget.cpp)
endif()
target_link_libraries(qt_imgui_demo_widget PRIVATE qt_imgui_widgets)
target_link_libraries(qt_imgui_demo_widget PRIVATE implot)

target_link_libraries(qt_imgui_demo_widget PUBLIC qt_imgui_widgets implot Qt6::OpenGLWidgets)

if(ANDROID)
include(${CMAKE_CURRENT_LIST_DIR}/../../tools/qt-android-cmake/AddQtAndroidApk.cmake)
Expand Down
11 changes: 6 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ project(qtimgui)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5 COMPONENTS Core Quick Gui Widgets REQUIRED)
find_package(Qt6 COMPONENTS Core Quick Gui Widgets OpenGLWidgets REQUIRED)

set(
qt_imgui_sources
set(qt_imgui_sources

ImGuiRenderer.h
ImGuiRenderer.cpp
QtImGui.h
Expand All @@ -21,7 +21,8 @@ target_link_libraries(
qt_imgui_quick
PUBLIC
imgui
Qt5::Gui
Qt6::Gui
Qt6::OpenGLWidgets
)
if (ANDROID)
target_link_libraries(qt_imgui_quick PUBLIC log dl GLESv2 z)
Expand All @@ -34,7 +35,7 @@ target_link_libraries(
qt_imgui_widgets
PUBLIC
imgui
Qt5::Widgets
Qt6::Widgets
)
if (ANDROID)
target_link_libraries(qt_imgui_widgets PUBLIC log dl GLESv2 z)
Expand Down