[CMake] Main program not getting rebuilt when library changes.

Brad King brad.king at kitware.com
Tue Oct 7 09:33:46 EDT 2014


On Mon, Oct 6, 2014 at 5:47 PM, Bill Greene wrote:
>>Another thing to try is to run cmake --build . and see if that works.
> That appears to compile the lib cpp file and rebuild the library just fine
> but it also doesn't re-link the main program.

I also cannot reproduce this from Bill H's example.  Both the .lib and
.exe file are rebuilt after touching only the lib .cpp file.

Try building the main target directly after touching the lib .cpp file:

 cmake --build . --config Debug --target cmTestMain

If that reproduces the issue then we can ask msbuild for verbose logging
info.  Touch the lib .cpp file again and then run:

 cmake --build . --config Debug --target cmTestMain -- -verbosity:diag >log 2>&1

The log file will be big and verbose.  If you see something stand out
in it then please reply with a relevant subset of the log.  Otherwise
please zip it up and send the log to me and Bill H. off-list since
it will likely be too big to attach on-list.

Thanks,
-Brad


More information about the CMake mailing list