1

I am working with large C++ project (using cLion) which containing 4 submodules. I wrote small C++ library which provides the ability to read from .properties file (most common in Java..).

The "Application.properties" file should includes common variables and per-project variables. For example; I am using Elasticsearch database and all the 4 sub-modules should know his address. In addition, Since i have 4 foreign projects i need to maintenance constantly 5 different CMakeLists files ( 4 sub-modules 1 for the main project).

My solution is to set the shared code in the main project root and using it by include the library in per project.

  • The project & submodules version control is git. I thought about it and decided that maybe I should check for more reviews before I started writing.

With Gratitude, Kobi.

Kobi
  • 106
  • 2
  • 9

1 Answers1

0

My solution was to create a "common module" for each module in my sub modules i added the following line in the cmakelists.txt file. ADD_LIBRARY(MyLib ../Common/a.cpp ../Common/b.cpp) target_link_libraries(MyTargetName LINK_PUBLIC MyLib)

since the main repository (of the submodules) its a git repository itself. i can manage shard library easily. thanks.

Kobi
  • 106
  • 2
  • 9