[CMake] [binary dir] breaks INSTALL(...) if added to ADD_SUBDIRECTORY(...)

Peter Visser pervulgo at gmail.com
Sat Oct 21 06:39:34 EDT 2006


Hello,

The following example works fine:

----
In the top CMakeLists.txt
ADD_SUBDIRECTORY (Example1)
ADD_SUBDIRECTORY (Example2)
----
In the subdirectories Example1/Example2
INSTALL(TARGETS Example1/Example2
        RUNTIME DESTINATION bin
            LIBRARY DESTINATION lib
            ARCHIVE DESTINATION lib
)
-----
In the INSTALL both the executables Example1 and Example2 are added to the
bin directory

However adding a [binary dir] to the ADD_SUBDIRECTORY(...) breaks the
INSTALL
----
In the top CMakeLists.txt
ADD_SUBDIRECTORY (Example1 foo)
ADD_SUBDIRECTORY (Example2 foo)
----
In this case only Example2 is added to the bin directory. (Only the last
occurence of the ADD_SUBDIRECTORY(...) is added)
Is this behaviour intentionally or do I misunderstand the [binary dir]
argument.

Cheers,

Peter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20061021/d9be2a83/attachment.htm


More information about the CMake mailing list