[CMake] add_subdirectory() twice => Policy CMP0013 is not set: Duplicate binary directories are not allowed

Rolf Eike Beer eike at sf-mail.de
Fri Nov 4 13:56:05 EDT 2011


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

http://www.mail-archive.com/cmake@cmake.org/msg33029.html

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111104/2e1ac4b8/attachment.pgp>


More information about the CMake mailing list