set(QTLIBS Qt5::Network Qt5::Widgets)

include_directories(..)
qt5_add_resources(NEOVIM_RCC_SOURCES data.qrc)
add_executable(nvim-qt WIN32 main.cpp shell.cpp input.cpp errorwidget.cpp mainwindow.cpp ${NEOVIM_RCC_SOURCES})
target_link_libraries(nvim-qt ${QTLIBS} ${MSGPACK_LIBRARIES} neovim-qt)

add_executable(nvim-qt-widget EXCLUDE_FROM_ALL main.cpp shell.cpp input.cpp ${NEOVIM_RCC_SOURCES})
set_target_properties(nvim-qt-widget PROPERTIES COMPILE_DEFINITIONS NEOVIMQT_GUI_WIDGET )
target_link_libraries(nvim-qt-widget ${QTLIBS} ${MSGPACK_LIBRARIES} neovim-qt)

if(WIN32)
	include(WinDeployQt)
	WinDeployQt(TARGET nvim-qt COMPILER_RUNTIME INCLUDE_MODULES ${QTLIBS} EXCLUDE_MODULES webkit webkit2)
endif()

set(QTLIBS Qt5::Network Qt5::Widgets)

include_directories(..)
qt5_add_resources(NEOVIM_RCC_SOURCES data.qrc)
add_executable(nvim-qt WIN32 main.cpp shell.cpp input.cpp errorwidget.cpp mainwindow.cpp ${NEOVIM_RCC_SOURCES})
target_link_libraries(nvim-qt ${QTLIBS} ${MSGPACK_LIBRARIES} neovim-qt)

add_executable(nvim-qt-widget EXCLUDE_FROM_ALL main.cpp shell.cpp input.cpp ${NEOVIM_RCC_SOURCES})
set_target_properties(nvim-qt-widget PROPERTIES COMPILE_DEFINITIONS NEOVIMQT_GUI_WIDGET )
target_link_libraries(nvim-qt-widget ${QTLIBS} ${MSGPACK_LIBRARIES} neovim-qt)

if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
	include(WinDeployQt)
	WinDeployQt(TARGET nvim-qt COMPILER_RUNTIME INCLUDE_MODULES ${QTLIBS} EXCLUDE_MODULES webkit webkit2)
endif()

Disable WinDeployQt for cross compile
Disable WinDeployQt for cross compile
