I've tried to use QScintilla in order to develop my own text editor. I have been using QMake for over 3 years, and I know the way of adding the library is
config += QScintilla2
But my question is, how to add (or, target link) the library in CMake?
I've tried using target_link_library(QScintilla) and it reports "No target named 'QScintilla' found" and something similar. How to resolve it?
By the way, the QScintilla installed in my PC is built with QMake. I don't know if it is compatible with CMake or not.
Unfortunately, you are correct that CMake and QMake are not inter-compatible. Instead, you should copy-and-paste the results of the building into any folder (in my case it's
lib/qt5_qscintilla) under the directory containing the CMake fileCMakeLists.txt, plus theQscifolder for the header files provided by the Riverbank Computing.For instance, on Windows and Linux, the file is
libqscintilla2_qt5.a; on macOS, the file is ended with extension.dylib(dynamic library, sorry I can't really tell you the file name now).Then, try this: