eranif / codelite

A multi purpose IDE specialized in C/C++/Rust/Python/PHP and Node.js. Written in C++
https://codelite.org
GNU General Public License v2.0
2.12k stars 455 forks source link

Is it possible to convert folders into projects? [Question] #3270

Open dzalf opened 11 months ago

dzalf commented 11 months ago

Dear Eran and developers

I have been experimenting with the codes from The Algorithms in C++ and I have been wondering if there is a way (embedded in CodeLite or not) to convert each folder into a Project inside a workspace.

I have created a workspace inside the cloned folder, created a project math as an example and added all the related source files from the respective math folder

image

Evidently, compile+build fails because each .cpp file is an independent code with its own _main()_ function and thus "multiple definitions of main" is thrown.

I assume that the only way to achieve this would be to manually create each project and link individual source code files. Is this correct?

Thanks

eranif commented 11 months ago

Since it uses CMake as its build process, I would actually use File System Workspace instead of the standard C++ workspace.

You can define how to build it from the (top level folder) settings -> build tab

eranif commented 11 months ago

Building the source code should be:

cd /path/to/C-Plus-Plus
mkdir build-debug
cd $_
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
make -j$(nproc)
dzalf commented 11 months ago

Dear Eran

I truly appreciate your reply. Thank you for taking the time.

I will try this and get back to you.

Thank you for developing CodeLite. It is awesome!

🍻