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

Bill Greene w.h.greene at gmail.com
Mon Oct 6 17:47:43 EDT 2014


>
>
>
>What if you right click on ALL_BUILD and build that project?
For some reason, the ALL_BUILD project was *not* selected/checked to build.
However if I build it explicitly or
change the VS configuration so it does build, the main program is still not
being re-linked.

>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've copied the output from "cmake --build" below in case that is of any
use.

Bill

------------------------------------------------------------------------
c:\temp\Projects>cmake --build cmake_test_hoffman
Microsoft (R) Build Engine version 4.0.30319.18408
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 10/6/2014 5:29:23 PM.
Project "c:\temp\Projects\cmake_test_hoffman\ALL_BUILD.vcxproj" on node 1
(default targets).
Project "c:\temp\Projects\cmake_test_hoffman\ALL_BUILD.vcxproj" (1) is
building "C:\temp\Projects\cmake_test_hoffman\ZE
RO_CHECK.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
  Creating "Win32\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because
"AlwaysCreate" was specified.
FinalizeBuildStatus:
  Deleting file "Win32\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild".
  Touching "Win32\Debug\ZERO_CHECK\ZERO_CHECK.lastbuildstate".
Done Building Project
"C:\temp\Projects\cmake_test_hoffman\ZERO_CHECK.vcxproj" (default targets).

Project "c:\temp\Projects\cmake_test_hoffman\ALL_BUILD.vcxproj" (1) is
building "C:\temp\Projects\cmake_test_hoffman\cm
TestLib\cmTestLib.vcxproj" (3) on node 1 (default targets).
InitializeBuildStatus:
  Creating "cmTestLib.dir\Debug\cmTestLib.unsuccessfulbuild" because
"AlwaysCreate" was specified.
CustomBuild:
  All outputs are up-to-date.
ClCompile:
  c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi
/nologo /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _
  WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1
/MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope
   /GR /Fo"cmTestLib.dir\Debug\\" /Fd"cmTestLib.dir\Debug\vc100.pdb" /Gd
/TP /analyze- /errorReport:queue ..\..\..\..\w
  greene\tests\c++\cmake_test_hoffman\cmTestLib\MySub.cpp
  MySub.cpp
Lib:
  c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\Lib.exe
/OUT:"C:\temp\Projects\cmake_test_hoffman\cmTestLi
  b\Debug\cmTestLib.lib" /NOLOGO cmTestLib.dir\Debug\MySub.obj
  cmTestLib.vcxproj ->
C:\temp\Projects\cmake_test_hoffman\cmTestLib\Debug\cmTestLib.lib
FinalizeBuildStatus:
  Deleting file "cmTestLib.dir\Debug\cmTestLib.unsuccessfulbuild".
  Touching "cmTestLib.dir\Debug\cmTestLib.lastbuildstate".
Done Building Project
"C:\temp\Projects\cmake_test_hoffman\cmTestLib\cmTestLib.vcxproj" (default
targets).

Project "c:\temp\Projects\cmake_test_hoffman\ALL_BUILD.vcxproj" (1) is
building "C:\temp\Projects\cmake_test_hoffman\cm
TestMain\cmTestMain.vcxproj" (4) on node 1 (default targets).
InitializeBuildStatus:
  Creating "cmTestMain.dir\Debug\cmTestMain.unsuccessfulbuild" because
"AlwaysCreate" was specified.
CustomBuild:
  All outputs are up-to-date.
ClCompile:
  All outputs are up-to-date.
ManifestResourceCompile:
  All outputs are up-to-date.
Link:
  All outputs are up-to-date.
Manifest:
  All outputs are up-to-date.
FinalizeBuildStatus:
  Deleting file "cmTestMain.dir\Debug\cmTestMain.unsuccessfulbuild".
  Touching "cmTestMain.dir\Debug\cmTestMain.lastbuildstate".
Done Building Project
"C:\temp\Projects\cmake_test_hoffman\cmTestMain\cmTestMain.vcxproj"
(default targets).

InitializeBuildStatus:
  Creating "Win32\Debug\ALL_BUILD\ALL_BUILD.unsuccessfulbuild" because
"AlwaysCreate" was specified.
CustomBuild:
  Build all projects
FinalizeBuildStatus:
  Deleting file "Win32\Debug\ALL_BUILD\ALL_BUILD.unsuccessfulbuild".
  Touching "Win32\Debug\ALL_BUILD\ALL_BUILD.lastbuildstate".
Done Building Project
"c:\temp\Projects\cmake_test_hoffman\ALL_BUILD.vcxproj" (default targets).


Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.64
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20141006/11445764/attachment.html>


More information about the CMake mailing list