if (QSCINTILLA_LIBRARY AND QSCINTILLA_INCLUDE_DIR)
	set (QSCINTILLA_FOUND TRUE)
else ()
	find_library (QSCINTILLA_LIBRARY NAMES qscintilla2_qt5 qscintilla2)
	find_path (QSCINTILLA_INCLUDE_DIR NAMES qsciglobal.h PATH_SUFFIXES qt5/Qsci)

	if (QSCINTILLA_INCLUDE_DIR AND QSCINTILLA_LIBRARY)
		set (QSCINTILLA_FOUND TRUE)
		message (STATUS "Found qscintilla libraries at ${QSCINTILLA_LIBRARY}")
		message (STATUS "Found qscintilla headers at ${QSCINTILLA_INCLUDE_DIR}")
		mark_as_advanced(QSCINTILLA_LIBRARY QSCINTILLA_INCLUDE_DIR)
	endif ()
endif ()

if (QSCINTILLA_FOUND)
	add_library (QSCINTILLA::QSCINTILLA UNKNOWN IMPORTED)
	set_target_properties (QSCINTILLA::QSCINTILLA PROPERTIES
		IMPORTED_LOCATION "${QSCINTILLA_LIBRARY}"
		INTERFACE_INCLUDE_DIRECTORIES "${QSCINTILLA_INCLUDE_DIR}")
endif ()
