Bug 576744 - Configure CMake with eclipse
Summary: Configure CMake with eclipse
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-cmake (show other bugs)
Version: 10.3.3   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-19 15:32 EDT by Marcus Aloshy CLA
Modified: 2021-10-21 11:09 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Aloshy CLA 2021-10-19 15:32:03 EDT
Im totally new to this environment and  trying to integrate CMake with eclipse so as the first step installed CMake plugins from the market place and its showing "CMake project" in the new project wizard and the project contains .cpp file and CMakeLists.txt but when i try to build that project its showing "Build not configured correctly" and "No tool chain found for build target"

Should i miss something to configure ? which toolchain i need to use to build a basic cmake project ? Is there any documentation available to build a basic cmake project with eclipse ?
Comment 1 Mat Booth CLA 2021-10-20 12:12:41 EDT
We are pretty light on documentation... :-/

Do you have a toolchain installed? It requires you have a toolchain available and ready to use.

On Fedora you can probably "sudo dnf install cmake gcc gcc-g++ binutils" and whatever other tools you need

On Ubuntu you can probably "sudo apt install build-essential cmake"

On Windows, I guess you need to install mingw and cmake manually, I'm not really a Windows guy.

Once you have a toolchain available on your PATH then IIRC selecting the project and hitting Ctrl+B to build should just work, with no other configuration in Eclipse required.
Comment 2 Promodkumar CM CLA 2021-10-20 18:11:29 EDT
I have installed CMake and MinGW and where should I add the toolchain path? newly created project settings? or environment variable path?
Comment 3 Mat Booth CLA 2021-10-21 06:53:02 EDT
(In reply to Promodkumar CM from comment #2)
> I have installed CMake and MinGW and where should I add the toolchain path?
> newly created project settings? or environment variable path?

For me just having the tools on my PATH environment variable was enough. If you can invoke gcc, cmake, etc from the command line it should be fine.
Comment 4 Marcus Aloshy CLA 2021-10-21 10:11:37 EDT
(In reply to Mat Booth from comment #3)
> (In reply to Promodkumar CM from comment #2)
> > I have installed CMake and MinGW and where should I add the toolchain path?
> > newly created project settings? or environment variable path?
> 
> For me just having the tools on my PATH environment variable was enough. If
> you can invoke GCC, CMake, etc from the command line it should be fine.


I have GCC and CMake on PATH environment variable and am able to invoke both from the command line and its working and I tried creating a new CMake project and building the project but the console shows "No Toolchain found for Target local".
Comment 5 Mat Booth CLA 2021-10-21 11:09:26 EDT
Hmm maybe some auto-detection does not work if you install your toolchain *after* Eclipse.

Check the toolchain preferences under Preferences --> C/C++ --> Core Build Toolchains