Hello,<br><br>For our Project, we need a structure where its possible to work/test/deploy a single module and also build products which uses some modules. <br><br>f.e <br><br>MODULE 1<br> /bin<br> /scr<br> /test-src<br>
CMakeLists.txt<br><br>MODULE 2<br> /bin<br> /src <br> /test-src<br> CMakeLists.txt<br><br>PRODUCT 1<br>
/bin<br>
/src <br>
/test-src<br>
CMakeLists.txt<br><br>PRODUCT 1 uses MODULE 1 and Module 2<br>MODULE 1 uses MODULE 2<br>MODULE 2 needs no other <br><br>in all CMakeLists-Files you can define per Macros Tests, Examples, Libs etc... If some target is depending on some other, the CMakeLists File will be called and the necessary target will be linked.<br>
<br>f.e. add_host_test( testModule1 <br> DEPS MODULE2)<br> <br>My Problem is, that PRODUCT 1 and MODULE 1 uses MODULE 2 and both builds the same executables libs etc. but its not possible(and necessary) to build the same executable etc. twice. <br>
every module should be build once per cmake execution.<br><br>I tried to use guards. But guards didn't work for me, because there aren't valid in global scope.<br><br>A simmilar stucture is necessary, because we will build a platform solution with a lot of Products in there. <br>
<br>Has anyone a solution for this problem? Or another project sturcture, that is better for this type of project?<br><br>Thx <br>Flo<br>