<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 31, 2013 at 10:52 PM, Eric Noulard <span dir="ltr"><<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2013/7/31 Andreas Pakulat <<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>>:<br>
<div><div class="h5">> Hi,<br>
><br>
> On Sat, Jul 27, 2013 at 12:39 AM, Andreas Pakulat <<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> I'm having a project here where cmake refuses to recognize the "COMPONENT"<br>
>> option for the install() command for certain targets.<br>
>><br>
>> Within the project there are several subdirs, the top-level CMakeLists.txt<br>
>> has a component-install rule like this:<br>
>><br>
>> INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/html DESTINATION<br>
>> share/doc/myapp COMPONENT documentation)<br>
>><br>
>> which generates the expected output in the cmake_install.cmake file.<br>
>> However several subdirectories contain executable targets for which the<br>
>> cmake_install.cmake file uses the "Unspecified" component. The executable<br>
>> target files look like this:<br>
>><br>
>> SET(SOURCES<br>
>> main.cpp object.cpp)<br>
>><br>
>> SET(MOCABLES<br>
>> object.h)<br>
>><br>
>> QT4_WRAP_CPP(MOC_SOURCES ${MOCABLES})<br>
>><br>
>> ADD_EXECUTABLE(myapp ${SOURCES} ${MOC_SOURCES})<br>
>> TARGET_LINK_LIBRARIES(myapp ${QT_LIBRARIES})<br>
>><br>
>> # Installation<br>
>> INSTALL(TARGETS myapp RUNTIME DESTINATION bin<br>
>> ARCHIVE DESTINATION lib<br>
>> LIBRARY DESTINATION lib<br>
>> COMPONENT applications)<br>
>><br>
>> I can't seem to find a reason for this misbehaviour using cmake --trace or<br>
>> cmake --debug-output. Are there any other ways (short of patching +<br>
>> compiling cmake) to find out what goes wrong here? And if not, can someone<br>
>> give me a hint where to start patching?<br>
>><br>
>> I'm using cmake 2.8.11.2 on Debian/GNU Linux.<br>
>><br>
>> In a very small example with just an executable target in a single cmake<br>
>> file everything works fine, but minimizing the real codebase is quite a bit<br>
>> harder than I thought.<br>
><br>
><br>
> It seems that the issue is that I'm listing 'COMPONENT' after the various<br>
> destinations. This seems to confuse the parsing of the arguments in<br>
> cmInstallCommand, as the genericArgs in ::HandleTargetsMode always yields<br>
> 'Unspecified' unless I move COMPONENT before the DESTINATIONS.<br>
<br>
</div></div>I'm not sure to fully understand your testcase but<br>
the keywords specified after ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|<br>
PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE<br>
<br>
should be repeated for each of them.<br>
<br>
i.e. one shall not write<br>
<div class="im">INSTALL(TARGETS myapp<br>
RUNTIME DESTINATION bin<br>
ARCHIVE DESTINATION lib<br>
LIBRARY DESTINATION lib<br>
COMPONENT applications)<br>
<br>
</div>but<br>
INSTALL(TARGETS myapp<br>
RUNTIME DESTINATION bin COMPONENT applications<br>
ARCHIVE DESTINATION lib COMPONENT applications<br>
<div class="im"> LIBRARY DESTINATION lib COMPONENT applications)<br>
<br>
</div>I.e COMPONENT should be repeated just as "DESTINATION" is.<br>
<div class="im"><br>
> The cmake docs do not indicate any importance on the order, but I finally<br>
> have a minimal testcase and can file a bugreport.<br>
<br>
</div>I don't think the doc is wrong but the nested bracket level [[[ ]]]<br>
makes it confusing to understand.<br></blockquote><div><br></div><div>Ugh, you're right and yes the brackets really don't help in understanding this. Well </div></div><br></div></div>