Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 2.74 KB

IDE_USAGE.md

File metadata and controls

92 lines (63 loc) · 2.74 KB

CMake sdl project - IDE usage

There is many IDEs that support CMake projects. It could be natively or via plugins.
This is a short tutorial on how we can use some IDEs to open a CMake project on linux:

Open the project with Qt Creator

Qt Creator is a cross-platform C/C++ IDE, originally dedicated for the Qt framework. It handle natively CMake projects and provide an efficient code completion.

Install Qt creator:

Install from Debian/Ubuntu repo:

sudo apt install qtcreator

Online installer: https://www.qt.io/download-thank-you?hsLang=en
Offline installer: https://www.qt.io/offline-installers

Open the project:
Run Qt Creator, use Open Files or Project ... and select the CMakeLists.txt file of the cloned project.
Finally, build and run the project.

Open the project with Code::blocks

Code::Blocks is a well-known cross-platform C/C++ and Fortran IDE. It handle CMake projects by wrapping them into native Code::Blocks projects.

Install Code::Blocks

sudo apt install codeblocks

Prepare the Code::Blocks project:

# Create a folder for the Code::Blocks project
cd basic-c-sdl-project-tunisia-flag
mkdir -p build/codeblocks
cd build/codeblocks

# Generate a Code::Blocks project
cmake ../.. -G "CodeBlocks - Unix Makefiles"

Open the project:
Run Code::Blocks, and open the project in basic-c-sdl-project-tunisia-flag/build/codeblocks.
Finally, build and run the project.

Open the project with Eclipse C/C++

Eclipse is a well-known IDE, widely used in Java projects development, but it also supports other programming languages, like in this case C/C++. It handle CMake projects by wrapping them into native Eclipse projects.

Download Eclipse C/C++:

Online installer: https://www.eclipse.org/downloads
Offline package: https://www.eclipse.org/downloads/packages

Prepare the Eclipse project:

# Create a folder for the Eclipse project outside this project
cd basic-c-sdl-project-tunisia-flag
mkdir ../eclipse-basic-c-sdl-project-tunisia-flag
cd ../eclipse-basic-c-sdl-project-tunisia-flag

# Generate an Eclipse project
cmake ../basic-c-sdl-project-tunisia-flag -G "Eclipse CDT4 - Unix Makefiles"

Open the project:
Run Eclipse, and open the project in eclipse-basic-c-sdl-project-tunisia-flag.
Create a new run configuration: Go to Run > Run configurations > C\C++ Application and specify the C/C++ Application using Search Project...
Finally, build and run the project.