How to work with CMake projects

CodeLite installation/troubleshooting forum
plh
CodeLite Curious
Posts: 2
Joined: Fri Apr 01, 2011 9:40 am
Genuine User: Yes
IDE Question: C++
Contact:

How to work with CMake projects

Post by plh »

Hi,
I've built the latest sources for CodeLite on Centos 5. I read in the notes for the latest release and in the online documentation that there "should" be a Import Files option on the Workspace (using right click). This option is supposed to allow me to create a custom workspace using my CMake files.

I don't have this option. My CodeLite revision is 4774.
Is this supposed to work now? Otherwise, what's the best way for me to use the existing makefiles?

Thanks!
PLH
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to work with CMake projects

Post by eranif »

After you create a workspace, you should create a project of type 'custom makefile' (from the menu: Workspace | New Project, and select the category 'Others')

Once you have a custom makefile project, right click it and select 'Improt files from directory'
Note that if you add new files to the disk, you can re-call 'Import files from directory' and it will only add the missing files.

All the settings, to make the project use 'cmake' is under the project settings dialog | customize | custom build (right click on your project and select 'settings)

For example, to add a 'cmake' command, click on the 'New..' button and add new command named: 'cmake' which executes 'cmake'.
Click OK, and now when right clicking the project, you will get new option named 'custom build targets | cmake' - use it to invoke cmake

Eran
Make sure you have read the HOW TO POST thread
plh
CodeLite Curious
Posts: 2
Joined: Fri Apr 01, 2011 9:40 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to work with CMake projects

Post by plh »

Eran,

Thanks! So, I"ve managed to setup the project to use CMake (thanks for the help here), but when I select "import files", no files show up in the right hand panel under the project.

I see a small blip appear (some dialog probably with status or something). I also have the checkbox marked that indicates all files will be imported, not just those with the listed extensions. I'm assuming I should at the minimum see the CMakeLists.txt file which is at the root of my project folders.

Do I need to setup virtual folders?

PLH
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to work with CMake projects

Post by eranif »

You dont need to setup anything, you need to make sure that you *check* the directories you want to import from

Eran
Make sure you have read the HOW TO POST thread
Post Reply