<div dir="ltr">Not sure whether the behavior I describe in the following is a bug. To my limited view it appears as one.<div><br></div><div>Running CMake with Visual Studio 2013 generator.</div><div><br></div><div>Consider a build tree like:</div>
<div><br></div><div><div>    build/</div><div>        top.sln</div><div><br></div><div>        alib/</div><div>            alib.sln</div><div>            alib.vxproj</div><div><br></div><div>        aexe/</div><div>            aexe.sln</div>
<div>            aexe.vcxproj</div><div><br></div><div>The source directs CMake with something like:</div><div><br></div><div><div>    source/alib/CMakeLists.txt</div><div><br></div><div>        add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.c</div>
<div>            COMMAND ${GENERATOR}</div><div>            DEPENDS <a href="http://generate.in">generate.in</a>)</div><div><br></div><div>        add_custom_target(run_generator</div><div>            DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/generated.c)</div>
<div><br></div><div>        add_library(alib ${SRC})</div><div><br></div><div>        add_dependencies(alib run_generator)</div><div><br></div><div>    source/aexe/CMakeLists.txt</div><div><br></div><div>        add_exe(aexe ${SRC})</div>
<div>        target_link_libraries(aexe alib)</div></div><div><br></div><div><br></div><div>A closer look at the resulting configuration of top.sln and aexe.sln shows:</div><div><br></div><div>    top.sln  : 'run_generator' is marked for build</div>
<div>    aexe.sln: 'run_generator' is not marked for build</div><div><br></div><div>This means that building aexe.sln will never the generator although the dependency</div><div>    aexe <-- alib <-- run_generator <-- generated.c</div>
<div>is recorded correctly.</div><div><br></div><div>On the other hand, when building either top.sln or aexe.vcxproj the generator will be run when necessary.</div><div><br></div><div>I would expect 'run_generator' to be marked for build in aexe.sln (as it is in top.sln). Right???</div>
<div><br></div><div>All the best, Dirk</div><div><br></div>-- <br><div dir="ltr">Dirk Steenpass</div>
</div></div>