'How to generate CMakeLists.txt in Clion when I create project from existing sources?

Idk how to make it automaticly - the only option is to specify where the file is - not to generate it, but I don't wan't to write it by my own, because there are too many source files to include.



Solution 1:[1]

Here are the steps that helped me:

  1. (Optional) If you have a CMakeLists.txt file in your project already but it's incomplete, delete it first.
  2. Click on Tools > CMake > Unload CMake Project.
  3. Open a source file and you will be presented with the option of selecting a new CMakeLists.txt file or creating a new one. Select create new. You will be presented with a list of files in your project which you can select/deselect for inclusion.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nbro