I have created a new cpp repository a day ago to re-implement my fortran code snippets in c plus plus language and this is default generated cmake file by clion IDE:
This worked very well before i decided to re-implement other exercise. Now when i run the second exercise.
How can i fix this? I want to configure smake file so that every new cpp file can run without any conflict with other cpp file.
It’s very obvious just from looking at this that it was auto-generated.
Please change the
add_executable() call to:
removing everything except the
.cpp file from
add_executable(). In addition, you don’t need
should only one cpp executable be in cmake file?
No, you can have more than one executable, but those other files aren’t needed to build the executable.
could you please provide me correct cmake configuration for my project?
I don’t know exactly what your project requires, but based on what you have so far I think it looks approximately like this: