Importing a CMake project into CodeLIte

Viewed 3428

I was wondering if anyone knew of a way to import an existing cmake project into the CodeLite IDE?

THis is a C++ project and I have all of the .c and .h files. I have the CMake lists and what not for the project too.

I am running on Ubuntu 16.04 with CodeLite 11.0.4.

If codelite is not able to do this, then is there an IDE that can import a CMake project?

3 Answers

You can generate a CodeLite workspace with cmake by using the -G option. First, look up all available CodeLite generators by doing

cmake --help

Keep in mind that not all might work for you, depending on your system configuration. Then use one of them as you like. For example, using Ninja you can do:

cmake -G "CodeLite - Ninja" /path

where /path is the directory where your CMakeLists.txt is located.

You can generate Codelite workspace with cmake by:

cmake -G "Codelite - Unix MakeFiles" /path (where 'path' your CMakeFiles.txt is present)

For instance:

  1. Generate Codelite workspace

    cmake -G "CodeLite - Unix Makefiles" ./

enter image description here

  1. Codelite workspace is generated

enter image description here

  1. Open CodeLite and build project (P.S. do not forget to set up project appropriately (e.g. compiler / workspace settings)

enter image description here

enter image description here

Related