I am new to CMake so my issue is probably simple to solve. I have the following project structure:
Project Root
CMakeLists.txt
|---- Library/Executable A
| | .c and .h files
| |---- CMakeLists.txt
|---- Library/Executable B
| | .c and .h files
| |---- CMakeLists.txt
|---- Library C
| | .c and .h files
| |---- CMakeLists.txt
For Debug purposes I have a main
in each sub-project that I use. The exception being Library C that is a collection of helper functions and data structures, mostly contained in header-only files. Library C is using in multiple points in the project, sometimes more than once in a single sub-project.
I am running into an issue of “already defined” objects when I build. I want to use the helper library where it is needed, but have it not conflict when I am using multiple sub-projects that use it independently. How would I go about configuring the CMakeLists.txt
to account for this?