philm
philm

Reputation: 885

Importing a CMake project into CodeLite

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?

Upvotes: 8

Views: 4696

Answers (3)

27P
27P

Reputation: 1475

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

  2. Codelite workspace is generated

    enter image description here

  3. 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

Upvotes: 1

atlas29
atlas29

Reputation: 66

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.

Upvotes: 5

philm
philm

Reputation: 885

According to Some programmer dude, CMAKE is able to make a codeLite project. I have tested this with the version of CMAKE that you can install with sudo apt-get install in ubuntu 16.04. This works.

Upvotes: -2

Related Questions