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