Re: [CMake] manifest version mismatch with VS 2008 and InstallRequiredSystemLibraries

2011-05-09 Thread Tyler
On Tue, May 3, 2011 at 12:17 PM, Bill Hoffman bill.hoff...@kitware.com wrote:
 My blog entry might help:

 http://www.kitware.com/blog/home/post/4

Thanks, Bill. That's a good summary of the issues. It would have been
really useful to me a few days ago :), but hopefully this saves
someone else some time. The tip about CMakeVerifyManifest is quite
handy.

To close the loop, here's what I ended up doing.

It's possible to tell Visual Studio to embed a newer version in
generated binaries (by insuring that _BIND_TO_CURRENT_VCLIBS_VERSION
is set to 1 sufficiently early in your project), but each time the
version number increases you have to rebuild everything, including
third-party libraries. We build and cache our 3rdpartylibs on a
network share and I didn't want to run on the Microsoft treadmill by
rebuilding everything each time Microsoft releases a Visual Studio
update. Instead, I decided to treat the CRT libs as yet another
3rdpartylib, pinned to version 9.0.21022.8, and just include them
manually.

I considered modifying InstallRequiredSystemLibraries so that it could
use CRT libraries from somewhere other than the default, but there are
many combinations of different versions of VS and components I don't
use (MFC, ATL, etc.). Also, it seems that no one else has this
problem, so making the solution general for the community would not be
useful. Instead I hacked together the function below.

Thanks,
tyler

# This is a dumb version of the CMake module InstallRequiredSystemLibraries.
# We would like to replace this hand-rolled function with include
# (InstallRequiredSystemLibraries) but the default CRT libraries don't work
# for us and the provided module doesn't allow us to customize where the CRT
# libraries are pulled from. See
# http://wiki/bin/view/Main/PackagingWithCMake#microsoft_crt for details.
function (tp_install_required_system_libraries)
if (NOT DEFINED TP_CRT_ROOT)
set (TP_CRT_ROOT ${TP_3RDPARTYLIBS_ROOT}/microsoft_crt/9.0.21022.8)
endif ()
set (TP_CRT_BASE ${TP_CRT_ROOT}/build/${TP_PLATFORM})
set (runtime_libs
${TP_CRT_BASE}/Microsoft.VC90.CRT.manifest
${TP_CRT_BASE}/msvcm90.dll
${TP_CRT_BASE}/msvcp90.dll
${TP_CRT_BASE}/msvcr90.dll
)
install (PROGRAMS ${runtime_libs}
DESTINATION bin
)
endfunction ()
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] manifest version mismatch with VS 2008 and InstallRequiredSystemLibraries

2011-05-09 Thread Michael Jackson
I am a bit late to the thread but I also had this problem so I made it a 
policy NOT to install the VS update that broke the Manifest thing. Easy for 
me as I am a single guy shop :-) but it did get rid of the problem, or more 
correctly worked around the problem. Of course the downside is that I am not 
getting any updates to VS. Just my 2 cents.
___
Mike Jackson  www.bluequartz.net


On May 9, 2011, at 4:28 PM, Tyler wrote:

 On Tue, May 3, 2011 at 12:17 PM, Bill Hoffman bill.hoff...@kitware.com 
 wrote:
 My blog entry might help:
 
 http://www.kitware.com/blog/home/post/4
 
 Thanks, Bill. That's a good summary of the issues. It would have been
 really useful to me a few days ago :), but hopefully this saves
 someone else some time. The tip about CMakeVerifyManifest is quite
 handy.
 
 To close the loop, here's what I ended up doing.
 
 It's possible to tell Visual Studio to embed a newer version in
 generated binaries (by insuring that _BIND_TO_CURRENT_VCLIBS_VERSION
 is set to 1 sufficiently early in your project), but each time the
 version number increases you have to rebuild everything, including
 third-party libraries. We build and cache our 3rdpartylibs on a
 network share and I didn't want to run on the Microsoft treadmill by
 rebuilding everything each time Microsoft releases a Visual Studio
 update. Instead, I decided to treat the CRT libs as yet another
 3rdpartylib, pinned to version 9.0.21022.8, and just include them
 manually.
 
 I considered modifying InstallRequiredSystemLibraries so that it could
 use CRT libraries from somewhere other than the default, but there are
 many combinations of different versions of VS and components I don't
 use (MFC, ATL, etc.). Also, it seems that no one else has this
 problem, so making the solution general for the community would not be
 useful. Instead I hacked together the function below.
 
 Thanks,
 tyler
 
 # This is a dumb version of the CMake module InstallRequiredSystemLibraries.
 # We would like to replace this hand-rolled function with include
 # (InstallRequiredSystemLibraries) but the default CRT libraries don't work
 # for us and the provided module doesn't allow us to customize where the CRT
 # libraries are pulled from. See
 # http://wiki/bin/view/Main/PackagingWithCMake#microsoft_crt for details.
 function (tp_install_required_system_libraries)
if (NOT DEFINED TP_CRT_ROOT)
set (TP_CRT_ROOT ${TP_3RDPARTYLIBS_ROOT}/microsoft_crt/9.0.21022.8)
endif ()
set (TP_CRT_BASE ${TP_CRT_ROOT}/build/${TP_PLATFORM})
set (runtime_libs
${TP_CRT_BASE}/Microsoft.VC90.CRT.manifest
${TP_CRT_BASE}/msvcm90.dll
${TP_CRT_BASE}/msvcp90.dll
${TP_CRT_BASE}/msvcr90.dll
)
install (PROGRAMS ${runtime_libs}
DESTINATION bin
)
 endfunction ()
 ___
 Powered by www.kitware.com
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] manifest version mismatch with VS 2008 and InstallRequiredSystemLibraries

2011-05-03 Thread Tyler
My project makes use of the CMake/CPack module
InstallRequiredSystemLibraries to package Microsoft Visual C Runtime
libraries with other build artifacts. Despite this and despite the
presence of appropriate-looking files showing up in the installed
image, my project does not run on XP and Vista machines unless the
user installs the vcredist package from Microsoft.

The VC runtime libraries provided by Microsoft and picked up by
CMake/CPack have a manifest version of 9.0.30729.4148. I believe this
version string refers to VS2008 SP1 + some hotfix. This seems
reasonable since my Windows build machine is running VS2008 SP1 + some
hotfix.

However, all the binaries produced by the build system have the
version sting 9.0.21022 embedded internally in a manifest.

I am not the first to encounter this problem and there are a number of
potential workarounds:

http://stackoverflow.com/questions/59635/app-does-not-run-with-vs-2008-sp1-dlls-previous-version-works-with-rtm-versions/70808#70808

http://stackoverflow.com/questions/2682373/how-can-i-configure-visual-c-project-to-use-9-0-30729-runtime-version-instead-o

http://connect.microsoft.com/VisualStudio/feedback/details/361682/vc9-sp1-generates-manifests-with-the-wrong-version-number



Options I can see:

1. Hack Microsoft.VC90.CRT.manifest and change the version string from
9.0.30729.4148 to 9.0.21022. This seems to work but obviously it seems
ugly and could easily have side effects.

2. #define _BIND_TO_CURRENT_VCLIBS_VERSION 1. This will work but it's
invasive: it must be set for all projects, it must be set early enough
that it's loaded before the Microsoft system header that defines the
default for this value, it must be set for all 3rdpartylibs used by
all projects.

3. Modify/hack/roll my own InstallRequiredSystemLibraries that grabs
an older 9.0.21022 version of the MSVC redistributable libraries
(perhaps from the WinSxS directory on my development system).



My question is: how are others handling this with CMake/CPack? Anyone
using one of the 3 approaches I outlined above? If so, pros/cons? If
not, what else can I try?

Thanks,
tyler
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] manifest version mismatch with VS 2008 and InstallRequiredSystemLibraries

2011-05-03 Thread John Drescher
On Tue, May 3, 2011 at 11:43 AM, Tyler ty...@cryptio.net wrote:
 My project makes use of the CMake/CPack module
 InstallRequiredSystemLibraries to package Microsoft Visual C Runtime
 libraries with other build artifacts. Despite this and despite the
 presence of appropriate-looking files showing up in the installed
 image, my project does not run on XP and Vista machines unless the
 user installs the vcredist package from Microsoft.

 The VC runtime libraries provided by Microsoft and picked up by
 CMake/CPack have a manifest version of 9.0.30729.4148. I believe this
 version string refers to VS2008 SP1 + some hotfix. This seems
 reasonable since my Windows build machine is running VS2008 SP1 + some
 hotfix.

 However, all the binaries produced by the build system have the
 version sting 9.0.21022 embedded internally in a manifest.


Are you sure that all the libraries and dlls you use in your project
were compiled with VS2008 SP1 + some hotfix.

I have in the past when I updated the compiler but forgot to clean
build all of the dependencies (like Qt and VTK).

John
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] manifest version mismatch with VS 2008 and InstallRequiredSystemLibraries

2011-05-03 Thread Tyler
Yes, I verified the manifests in each binary with strings + grep.
Everything is produced with a version of 9.0.21022.

tyler

On Tue, May 3, 2011 at 8:49 AM, John Drescher dresche...@gmail.com wrote:
 On Tue, May 3, 2011 at 11:43 AM, Tyler ty...@cryptio.net wrote:
 My project makes use of the CMake/CPack module
 InstallRequiredSystemLibraries to package Microsoft Visual C Runtime
 libraries with other build artifacts. Despite this and despite the
 presence of appropriate-looking files showing up in the installed
 image, my project does not run on XP and Vista machines unless the
 user installs the vcredist package from Microsoft.

 The VC runtime libraries provided by Microsoft and picked up by
 CMake/CPack have a manifest version of 9.0.30729.4148. I believe this
 version string refers to VS2008 SP1 + some hotfix. This seems
 reasonable since my Windows build machine is running VS2008 SP1 + some
 hotfix.

 However, all the binaries produced by the build system have the
 version sting 9.0.21022 embedded internally in a manifest.


 Are you sure that all the libraries and dlls you use in your project
 were compiled with VS2008 SP1 + some hotfix.

 I have in the past when I updated the compiler but forgot to clean
 build all of the dependencies (like Qt and VTK).

 John

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] manifest version mismatch with VS 2008 and InstallRequiredSystemLibraries

2011-05-03 Thread Bill Hoffman

On 5/3/2011 11:52 AM, Tyler wrote:

Yes, I verified the manifests in each binary with strings + grep.
Everything is produced with a version of 9.0.21022.



My blog entry might help:

http://www.kitware.com/blog/home/post/4

-Bill
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake