GM1
GM1

Reputation: 491

How to create a simple CLion C++ CMake project with different locations for Project itself, build products and source files

I'm new with CLion and CMakeList. I'd like to have different locations for:

  1. CLion project files
  2. Build Files
  3. Source and Header Files

When opening default projects all are located under the same directory tree

What are the steps to create such project ('Hello world')?

Upvotes: 1

Views: 785

Answers (1)

halfelf
halfelf

Reputation: 10107

  1. CLion project files

AFAIK, you can only set one global path for each jetbrains' IDE, by writing IDE_HOME\bin\idea.properties file.

Details can be found here.

  1. Build Files

Settings -> Build, Execution, Deployment -> CMake -> Generation path

You can also set several paths for different build profiles there.

enter image description here

  1. Source and Header Files

Add sources and include directories in CMakeLists.txt .

Upvotes: 1

Related Questions