How to organize project structure?

I'm new to CMake.
What I'm doing in CMakeLists.txt is:

file(glob_recurse SOURCE_FILES

add_executable(myprj ${SOURCE_FILES})

And when I open this file with CLion, all my cc files and h files are in the same level directly under project.

How can I make it organized by directories?

Thank you!


1 comment

It seems that it's because my CMakeLists.txt is not in the /my/project folder.
When I put it in /my/project everything works fine.

Now my question becomes:
Can I specify my project root without putting CMakeLists.txt in my project?
My company doesn't use CMake, and I don't want to put unrelated files in my source code repository.

Thank you!



Please sign in to leave a comment.