<div dir="ltr"><div>Thanks very much for taking a careful look at this, Bill.</div><div><br></div><div>The source files in my test were more or less the same as yours but I</div><div>changed them to be identical.</div><div><br></div><div>Most of my previous tests were with the 2013 Express version of VS but</div><div>I had also done a couple of tests with 2010 Express. Previously, I</div><div>was seeing the same dependency behavior problem with both versions.</div><div>I did this latest test with 2010 Express. The version of that I currently</div><div>have installed is: Version 10.0.40219.1 SP1Rel.</div><div><br></div><div>After I change MySub.cpp, either with "touch" or by editing the file in the</div><div>GUI, and rebuild either with the F7 key or by selecting the "Build Solution"</div><div>menu item, I see something like this:</div><div><br></div><div>$ ls -l cmTest*/Debug</div><div>cmTestLib/Debug:</div><div>total 4</div><div>----------+ 1 bgreene None 2742 Oct  6 13:59 cmTestLib.lib</div><div><br></div><div>cmTestMain/Debug:</div><div>total 692</div><div>----------+ 1 bgreene None  28160 Oct  6 13:46 cmTestMain.exe</div><div>----------+ 1 bgreene None 312688 Oct  6 13:46 cmTestMain.ilk</div><div>----------+ 1 bgreene None 363520 Oct  6 13:46 cmTestMain.pdb</div><div><br></div><div>If I do, "Rebuild Solution", not surprisingly, both the lib and exe get rebuilt.</div><div><br></div><div> >This could be a bug in VS as CMake has very little to do with depends like this and the VS IDE.</div><div> </div><div>I'm certainly not an expert with Visual Studio but this sure has all the appearances of a VS bug.</div><div>The VS solution generated by cmake looks "right" to me. However, the fact that this behavior occurs</div><div>in both VS 2010 and VS 2013 seems surprising.</div><div><br></div><div>Bill</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 10:51 AM, Bill Hoffman <span dir="ltr"><<a href="mailto:bill.hoffman@kitware.com" target="_blank">bill.hoffman@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Bill,<br>
<br>
I want to reset this conversation a bit.  What you are doing should work no problem.  Most of the suggestions should not be needed.  I do agree that glob is bad, but it will cause different problems.   Anyway, I created the following example based on your posts and it works with VS 2010.   Can you try this and report back?  This could be a bug in VS as CMake has very little to do with depends like this and the VS IDE.<br>
<br>
I did this to test:<br>
$ ls -l b/cmTestMain/Debug/<br>
total 684<br>
-rwxr-xr-x 1 hoffman Domain Users  28160 Oct  6 10:47 cmTestMain.exe<br>
<br>
hoffman@quasar ~/Work/dep<br>
$ touch cmTestLib/MySub.cpp<br>
<br>
#build from VS IDE and exe relinks<br>
hoffman@quasar ~/Work/dep<br>
$ ls -l b/cmTestMain/Debug/<br>
total 684<br>
-rwxr-xr-x 1 hoffman Domain Users  28160 Oct  6 10:48 cmTestMain.exe<br>
<br>
<br>
hoffman@quasar ~/Work/dep<br>
$ touch cmTestLib/MySub.h<br>
<br>
# build from VS IDE exe relinks again<br>
hoffman@quasar ~/Work/dep<br>
$ ls -l b/cmTestMain/Debug<br>
total 684<br>
-rwxr-xr-x 1 hoffman Domain Users  28160 Oct  6 10:49 cmTestMain.exe<span class=""><br>
<br>
<br>
<br>
<br>
top level:<br>
-----------<br>
cmake_minimum_required (VERSION 2.8)<br>
project(cmTest)<br></span>
add_subdirectory (cmTestLib)<br>
add_subdirectory (cmTestMain)<br>
<br>
cmTestLib<br>
--------------<span class=""><br>
add_library (cmTestLib STATIC MySub.cpp MySub.h)<br>
<br></span>
------ cmTestLib/MySub.cpp<br>
#include "MySub.h"<br>
<br>
int hello()  { return 0;}<br>
<br>
----- cmTestLib/MySub.h<br>
int hello();<span class=""><br>
<br>
cmTestMain<br>
----------------<br>
include_directories (${cmTest_SOURCE_DIR}/<u></u>cmTestLib)<br>
add_executable (cmTestMain cmTestMain.cpp)<br>
target_link_libraries (cmTestMain cmTestLib)<br>
<br>
<br></span>
Here are the source files:<br>
<br>
------ cmTestLib/MySub.cpp<br>
#include "MySub.h"<br>
<br>
int hello()  { return 0;}<br>
<br>
----- cmTestLib/MySub.h<br>
int hello();<br>
<br>
cmTestMain/cmTestMain.cpp<br>
<br>
#include "MySub.h"<br>
<br>
int main()<br>
{<br>
  return hello();<div class="HOEnZb"><div class="h5"><br>
}<br>
<br>
<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<u></u>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/<u></u>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/<u></u>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/<u></u>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/<u></u>mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>