[Previous: Support for Generic Projects in Qt Creator]
[Qt Creator Manual]
[Next: Tips and Tricks]
Handling External Libraries
The ability to recognize external libraries is not only important for the underlying buidl system, but also for Qt Creator itself. This ability allows Qt Creator to support code completion and syntax highlighting for external libraries as if they were part of the current project or the Qt library.
The procedure of adding a library to a project, depends on the type of project, which influences the build system used. The following sections describe the the procedure required for each project type.
QMake Projects (the default)
Open your project file (.pro) from the Projects pane. Then, follow the guidelines in the Declaring other Libraries section of the Qt documentation.
If your project successfully builds and links against the external library, syntax completion and highlighting should also work.
CMake Projects
In CMake, libraries are usually detected using the FIND_PACKAGE() macro. A couple of them are already being shipped with CMake, they can be found in the Modules directory of your CMake installation. If you provide libraries on your own, you will need to provide your own FindFoo.cmake file. Refer to the CMake FAQ for details.
As with qmake project, syntax completion and highlighting should work if you can sucessfully build and link against the external library.
Generic Projects
If you import a project using the Generic Projects function, Qt Creator will create a file called <projectname>.includes in your project root directory. It will contain all project subdirectories it that was able to find relevant header files in. Simply add your include pathes there.
Note that in Generic Project mode, Qt Creator will refrain from touching any project settings, so the above is merely a hint for the code completion and the syntax highlighter.
[Previous: Support for Generic Projects in Qt Creator]
[Qt Creator Manual]
[Next: Tips and Tricks]
Copyright © 2009 Nokia |
|
Qt Creator 1.2.1 |
|