multiple Cmake in a single project

Answered

I am working on a project with multiple CMakes. In the main directory, we have "CMakeLists.txt" which builds the program, under "test" directory, we have another "CMakeLists.txt" that tests the app once it is built, and under "examples" directory we have another CMakeLists.txt which builds examples using the built program.

 

The project directory graph is:

 

program_directory

|-- CMakeLists.txt

|-- test

       |-- CMakeLists.txt

|-- examples

        |-- CMakeLists.txt

 

How do I properly configure project with multiple build targets located in different directories? If I run "Load Cmake Porject" for a particular CMake file, then it seems to unload other Cmake files.

0
1 comment

Hello!

Are the test and examples subfolders added in the top-level CMakeLists.txt as subprojects (using add_subdirectory())? If yes, please close your project (File | Close Project), delete all .idea subfolders that have beed created in your project folder and subfolders, in CLion on the Welcome Screen choose "Open" and select the program_directory (in which the top-level CMakeLists.txt and the test and examples subfolders are located).

0

Please sign in to leave a comment.