4

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?

genpfault
  • 51,148
  • 11
  • 85
  • 139
philm
  • 797
  • 1
  • 8
  • 29
  • 1
    Have you tried to [read the CMake documentation](https://cmake.org/cmake/help/latest/)? Especially the section on [*generators*](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) which [extra generators list](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#extra-generators) includes [CodeLite](https://cmake.org/cmake/help/latest/generator/CodeLite.html). – Some programmer dude Nov 09 '17 at 23:14
  • Hello thank you for the reply. I am not sure if I understand your comment correctly in relation to the question? I looked through the link provided and it looks like that the documentation is lists some IDEs that can generate CMAKE files. I am kinda looking for a tutorial on how to import a CMAKE project into the CodeLite IDE. I have reason to believe that CodeLite can interface with CMAKE, I am not sure how though. – philm Nov 10 '17 at 13:02
  • 1
    You can tell CMake to generate a CodeLite project from a set of `CMakeLists.txt` files. – Some programmer dude Nov 10 '17 at 13:04
  • Oh, I did not know that! Cool, thank you for that little piece of information! I will look into this. As always, if you could place that in as an answer, I will upvote it and if it works, accept as a solution – philm Nov 10 '17 at 13:43
  • @Someprogrammerdude Please submit this as an answer so that I can accept because I was able to get it to work using what you suggested – philm Nov 10 '17 at 16:46
  • The eclipse CDT has better cmake integration. – LeDYoM Jan 10 '18 at 20:03

3 Answers3

3

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.

atlas29
  • 46
  • 4
0

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

genpfault
  • 51,148
  • 11
  • 85
  • 139
27P
  • 1,183
  • 16
  • 22
-2

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.

philm
  • 797
  • 1
  • 8
  • 29