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

1

8

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.

Sinew answered 14/6, 2021 at 19:28 Comment(2)
CLion can’t generate a CMakeLists.txt file for an existing project, it doesn’t know what to include and what not to, it doesn’t know what to link etc.Kremer
so maybe i can make some template, that would include all files in directorySinew
M
14

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, you will be presented with the option of selecting an existing CMakeLists.txt file or creating a new one.
  4. Select create new. You will be presented with a list of files in your project which you can select/deselect for inclusion.
Merge answered 8/9, 2021 at 16:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.