Hi<div><br><div>I have several small projects. Some of them may include another project.</div><div>I have one big project that includes all small projects.</div><div>File structure:</div><div>projects</div><div>- p1.cmake (add_subdirectory(dir_project1))</div>
<div>- p2.cmake (add_subdirectory(dir_project2))</div><div>- dir_project1</div><div>- dir_project2</div><div><br></div><div>Some of these pX.cmake may be called twice meaning that add_subdirectory(dir_projectX) is called twice.</div>
<div>And the above warning appears.</div><div><br></div><div>Is there a way to handle this. E.g </div><div>- with guards like in C header files (tried something like that but did not work)</div><div>- checking if the resulting library exists, if yes: don't add:subdirectory()</div>
<div><br></div><div>Just wandering if there is a defacto or smart way to handle that a subproject may be included several times</div><div><br></div><div>Thanks</div><div>Paul</div><div><br></div></div>