32

I have a makefile project. I know that in Eclipse CDT is possible to load makefile project.

Is it possibile to load it in qtcreator?

1

3 Answers 3

30

As Greenflow mentioned, Qt Creator can import existing project but it doesn't even depend on the existence of the Makefile. All you need to do for import of the existing project is specify the high-level folder in which the sources of the project are located (including sources in subdirectories) and set some name for the project - the name which Qt Creator will use to display its name. Qt Creator also asks you which files should be included to the project but again, it is simply for the display of sources in the project tree, not for build. Qt Creator uses make tool in the specified build directory by default to build your project but you can override this setting. For example, in the company I work for we have a custom build system and a custom build tool. So when I import some project into Qt Creator, I specify the directory with sources, set some name, specify build directory, override the default make build tool by our custom one, add some include paths to file .includes, if necessary, specify macros in file .config and develop things, that's just it.

You can see more detailed information about Import existing project feature of Qt Creator here.

4
  • This works perfectly, yet I have another question. It is adding some files (foo.config foo.creator etc.) is it possible to locate these files in another folder? It would be great if I could locate them in Documents.
    – meakgoz
    Nov 25, 2015 at 8:57
  • Yes, it is possible, that's what I do routinely to prevent cluttering the source code repository tree. The only drawback is that during the project creation Qt Creator has no idea where the sources are located so it doesn't show them in the window suggesting the sources for the project, you'd need to add them after the project is created. There also seems to be a bug with it: if you create the empty project and then add files to it, each file becomes displayed twice in the project tree. However, closing the project and opening it again fixes this issue.
    – Dmitry
    Nov 25, 2015 at 9:09
  • @Dmitry: Does this work with latest QT Creator 4.2.1? Checked for such option but to no avail. Apr 17, 2017 at 11:39
  • @saurabheights: I don't have the latest Qt Creator 4.2.1 at the moment to test but I can confirm it's present and working in Qt Creator 4.1.0 and the official documentation still exists - the link was stale in my comment, I've updated it now.
    – Dmitry
    Apr 17, 2017 at 13:06
13

Yes and no. Choose: File->New File or Project...->Import Project->Import existing Project.

Imports existing projects that do not use qmake, CMake or Autotools. This allows you to use Qt Creator as a code editor.

It is really the last choice, but you can load a Makefile project into QtCreator. How well it works... hard to say. Depends on the project and how the Makefile is created. Most likely you can compile your project. Editing files: Probably no problem. But adding new files... I don't think QtCreator can handle Makefile changes.

1

I've noticed that by default Qt creator runs the command 'make all'. You can modify this under the Projects tab.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.