find_package(Qt6 COMPONENTS Core Widgets Gui GuiPrivate REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(KYSDK_UKUIWINDOWHELPER REQUIRED kysdk-ukuiwindowhelper)
if (KYSDK_UKUIWINDOWHELPER_FOUND)
    include_directories(${KYSDK_UKUIWINDOWHELPER_INCLUDE_DIRS})
endif()

set(CMAKE_AUTOMOC ON) 
set(CMAKE_AUTOUIC ON) 
set(CMAKE_AUTORCC ON)

qt6_add_resources(VirtualKeyboard_SRC
	src/keyboard.qrc)

qt6_wrap_cpp(VirtualKeyboard_SRC
        src/fakekeyboard.h
        src/qxkbcommon_p.h
        ../common/capslockstatehelper.h
    )

set(VirtualKeyboard_SRC
        ${VirtualKeyboard_SRC}
        src/charsmorewidget.cpp
        src/charswidget.cpp
        src/dragwidget.cpp
        src/kbbutton.cpp
        src/kbtitle.cpp
        src/letterswidget.cpp
        src/numberswidget.cpp
        src/virtualkeyboardwidget.cpp
        src/x11keyboard.cpp
        src/qtkeyboard.cpp
        src/qxkbcommon.cpp
        src/qxkbcommon_3rdparty.cpp
        ../common/capslockstatehelper.cpp
        )

include_directories(
	${Qt6Core_INCLUDE_DIRS}
	${Qt6Widgets_INCLUDE_DIRS}
        )

add_library(VirtualKeyboard STATIC ${VirtualKeyboard_SRC})
target_link_libraries(VirtualKeyboard
    Qt6::Core Qt6::Widgets
    ${KWAYLANDCLIENT_LIBRARIES}
    Qt6::Gui
    Qt6::GuiPrivate
    ${KYSDK_UKUIWINDOWHELPER_LIBRARIES}
    xkbcommon)
