Can not compile cmake project

General questions regarding the usage of CodeLite
marlac
CodeLite Curious
Posts: 6
Joined: Tue Nov 13, 2018 10:14 am
Genuine User: Yes
IDE Question: C++
Contact:

Can not compile cmake project

Post by marlac »

I use CodeLite 12.0. Created executable cmake project "Hello World" . In settings I changed output file and makefile generated arguments only, the rest remained default. I'm able to generate cmake but not able to build. I received information :
make: *** No target specified and no makefile found. Stop ****
However I can see Makefile in directory . How to make everything compilable ?
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can not compile cmake project

Post by eranif »

Where is the build output?
also, where is the cmake output?
Please read the "HOW TO POST" thread (see my signature)
Make sure you have read the HOW TO POST thread
pztrn
CodeLite Curious
Posts: 5
Joined: Mon Nov 12, 2018 8:13 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can not compile cmake project

Post by pztrn »

I'm experiencing same. The only OP forgot to mention that CodeLite isn't creating build directory defined in project settings and therefore isn't launching cmake. After manually creating build directory everything works.

I'm on CodeLite 12.0.9 and macOS Mojave 10.14.1.
marlac
CodeLite Curious
Posts: 6
Joined: Tue Nov 13, 2018 10:14 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can not compile cmake project

Post by marlac »

OS: Linux Mint 18.3 Cinamon 64bit ver. 3.6.7
CodeLite ver 12.0.0 - It is NOT self compiled version
--versiongcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

Code: Select all

MESSAGE: Entering directory `/home/marek/Dokumenty/test2'
/bin/sh -c 'make'
----------Building project:[ test2 - Debug ]----------
make: *** No targets specified and no makefile found.  Stop.
====0 errors, 0 warnings====
I have following settings
Project type: Executable
Makefile Generator: Cmake
Arguments [empty]
Compiler: Cross GCC(x86_64-linux-gnu)
Intermediate folder :./Debug
Output File:test2
Pause when execution ends : CHECKED
This program is a GUI application: NOT CHECKED
Executable to Run/Debug :$(WorkspacePath)/cmake-build-$(WorkspaceConfiguration)/output/$(ProjectName)
Working directory: $(IntermediateDirectory)
Program arguments: [empty]
Debugger: GNU dbg debuger
marlac
CodeLite Curious
Posts: 6
Joined: Tue Nov 13, 2018 10:14 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can not compile cmake project

Post by marlac »

also, where is the cmake output?
Where can I check it ?
marlac
CodeLite Curious
Posts: 6
Joined: Tue Nov 13, 2018 10:14 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can not compile cmake project

Post by marlac »

pztrn wrote:I'm experiencing same. The only OP forgot to mention that CodeLite isn't creating build directory defined in project settings and therefore isn't launching cmake. After manually creating build directory everything works.

I'm on CodeLite 12.0.9 and macOS Mojave 10.14.1.
I created a directory
So I fave a following setting :
Executable to Run/Debug :$(WorkspacePath)/cmake-build-$(WorkspaceConfiguration)/output/$(ProjectName)

where

WorkspacePath = /home/marek/Dokumenty/test2
WorkspaceConfiguration = Debug
ProjectName - test2

I created /home/marek/Dokumenty/test2/cmake-build-Debug/output/test2 and still nothing.
CMakeLists.txt has been generated into /home/marek/Dokumenty/test2/test2

What should I change in settings and where in Codelite they are to make it compilable ?
neildarlow
CodeLite Enthusiast
Posts: 16
Joined: Wed Oct 31, 2018 2:16 pm
Genuine User: Yes
IDE Question: C++
Location: United Kingdom
Contact:

Re: Can not compile cmake project

Post by neildarlow »

I have created a simple console application and all changes were done in the project creation dialogs i.e.

Code: Select all

Build system: CMake
Compiler: GCC
I did not specify the output file i.e. leave it blank.

Right-click the project entry in the Workspace tab and select Export CMakeLists.txt
Right-click the project entry in the Workspace tab and select Run CMake

The cmake-build-Debug directory and project_name and output sub-directories are created.
A build and execute perform correctly.

I have seen the error the OP experienced under very specific conditions i.e. I created a project with Default build system and then modified the project options to CMake build system. Starting afresh with a regenerated Workspace and project with the CMake build system fixed it for me.

These experiments were performed on Linux Mint 19 using the codelite-12.0-1unofficial .deb from David's repository.

Regards,
Neil
Post Reply