question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Suggestion] Allow disable automatic CMake configure when saving CMakeLists.txt

See original GitHub issue

This pull request #1196 added new feature to automatic configure CMake when saving CMakeLists.txt.

This is a great feature that integrates CMake projects with IntelliSense. However, there were things I wanted to turn off this feature. Specifically, when working on a project that has multiple CMakeLists.txt, running CMake configure every time CMakeLists.txt is saved will hinder my work.

Imagine a project with the following structure:

.
+-- include
|   +-- CMakeLists.txt // Add `foo.hpp`, etc header files to project.
|   +-- foo.hpp
+-- src
|   +-- CMakeLists.txt // Add `cpp.hpp`, etc source files to project.
|   +-- foo.cpp
+-- CMakeLists.txt // Calls `add_subdirectory(include)` and `add_subdirectory(src)` as aggregators.

My project has many source and header files, I have divided the project source file declarations in this way.

This project is using Qt. The problem is that Qt must perform the task of scanning the source files and generating additional source files (Qt MOC sources) every time CMake configure time. I have to update the CMakeLists.txt twice to add the header and source files. CMake configure starts when the first CMakeLists.txt is saved, and it also starts scanning the source. I can’t work on it until I’ve finished scanning the source.

Could you add an option to turn off the this feature to get around the problem? I’m sure there are others besides me who would like to turn this feature off for projects that perform time-consuming tasks in the CMake configure step.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:27
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
andreeiscommented, Jun 4, 2020

Yes we are going to fix this for the soon upcoming 1.4.1 update release.

4reactions
andreeiscommented, Jun 18, 2020

This should be fixed in CMake Tools 1.4.1 which was published today. Let us know if you encounter any issues with this release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to avoid running CMake automatically when Opening a ...
Hi,. Each time I clone a repository from GitHub Visual Studio runs CMake on the folder. This is takeing long time and created...
Read more >
How can I disable CMake in some project folders of a VSCode ...
To avoid run cmake on specific folder, you can try create .vscode/settings.json on your folder. And set "cmake.configureOnOpen": false.
Read more >
Visual Studio Code CMake Tools Extension: Multi-root ...
You can temporarily override the active folder by selecting the active folder in the status bar or running the CMake: Select Active Folder ......
Read more >
Quick CMake tutorial | CLion Documentation - JetBrains
We can either reload the project once (Reload changes) or enable automatic reload to let CLion silently apply all the changes in CMakeLists.txt....
Read more >
Cross Platform Make - CMake
Project configuration settings may be specified on the command line with the ... Enable warnings that are meant for the author of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found