Ice VS 2008 Addin inserts hard paths, not environmnet variable base paths

in Help Center
Inside of the ice configuration I specify $(Ice) which is an environment variable that points to the ice installation.
This and the expansions from it get stored in the .vcproj file has hard paths. See the snippets below.
That is very unfriendly and unworkable for multiple developers and build processes.
Here are some if the hard snippets:
<code>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""$(QTDIR)\include" ; .\GeneratedFiles\ ; ".\GeneratedFiles\$(ConfigurationName)" ; "$(QTDIR)\include\QtCore" ; "$(QTDIR)\include\QtXml" ; "$(QTDIR)\include\QtNetwork" ; "$(BtSharedDir)" ; ..\ ; ..\Shared ; .\ ; . ; C:\Program Files\ZeroC\Ice-3.4.0\include"
PreprocessorDefinitions="UNICODE,WIN32,QT_THREAD_SUPPORT,QT_NO_DEBUG,NDEBUG,QT_CORE_LIB,QT_XML_LIB,QT_NETWORK_LIB"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="qtmain.lib QtCore4.lib QtGui4.lib QtXml4.lib QtNetwork4.lib Ice.lib IceUtil.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
AdditionalLibraryDirectories=""$(QTDIR)\lib" ; "$(Ice)\lib" ; $(BtSharedDir)\Libs ; ..\Shared\Libs ; C:\Program Files\ZeroC\Ice-3.4.0\lib"
GenerateDebugInformation="true"
SubSystem="1"
LinkTimeCodeGeneration="1"
/>
<Global
Name="ZerocIce_HomeExpanded"
Value="C:\Program Files\ZeroC\Ice-3.4.0"
/>
</code>
This and the expansions from it get stored in the .vcproj file has hard paths. See the snippets below.
That is very unfriendly and unworkable for multiple developers and build processes.
Here are some if the hard snippets:
<code>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""$(QTDIR)\include" ; .\GeneratedFiles\ ; ".\GeneratedFiles\$(ConfigurationName)" ; "$(QTDIR)\include\QtCore" ; "$(QTDIR)\include\QtXml" ; "$(QTDIR)\include\QtNetwork" ; "$(BtSharedDir)" ; ..\ ; ..\Shared ; .\ ; . ; C:\Program Files\ZeroC\Ice-3.4.0\include"
PreprocessorDefinitions="UNICODE,WIN32,QT_THREAD_SUPPORT,QT_NO_DEBUG,NDEBUG,QT_CORE_LIB,QT_XML_LIB,QT_NETWORK_LIB"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="qtmain.lib QtCore4.lib QtGui4.lib QtXml4.lib QtNetwork4.lib Ice.lib IceUtil.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
AdditionalLibraryDirectories=""$(QTDIR)\lib" ; "$(Ice)\lib" ; $(BtSharedDir)\Libs ; ..\Shared\Libs ; C:\Program Files\ZeroC\Ice-3.4.0\lib"
GenerateDebugInformation="true"
SubSystem="1"
LinkTimeCodeGeneration="1"
/>
<Global
Name="ZerocIce_HomeExpanded"
Value="C:\Program Files\ZeroC\Ice-3.4.0"
/>
</code>
0
Comments
I agree, the add-in should not include such expanded path in the project file.
We actually looked briefly into this issue for the 3.4.1 release (it was reported earlier - see http://www.zeroc.com/forums/help-center/4942-ice-3-4-vs-plug-team-setting.html); unfortunately this was not high priority and we didn't incorporate a fix in 3.4.1.
Best regards,
Bernard
Also, you need to consider that the use of the environment variable allows different releases of ice to be used without changing the communal vcproj file.
This really should be a priority fix.
thanks
Rich
However, having the projects actually work on different machines with Ice installations in different locations specified by an environment variable should not be an issue. The plugin is able to detect this and adjust the paths accordingly when the project is opened. If this is not working for you then there is a bug in the plugin. Have you tried this and confirmed that it does not work?
The reason I brought this up is that it caused build failures and failures on other developers machines
I have not been able to reproduce failures like you describe. Yes, there are hard paths in the vcproj file but as I said the addin is designed to recognize when the value of the environment variable changes (whether on a single machine or when project is used on a different machine) and deal with it. In my testing it appears to work.
When the project file is written it contains settings like the following. When the project is opened the addin recognizes that an environment variable is being used for Ice Home and adjusts paths in lib, include, etc if the expanded setting is not the same as when the project was previously opened.
Like I mentioned this can cause unneeded changes in the projects that can pollute commits (which we plan to look into changing) but it should not produce build problems.
Therefore the question is what is different about your usage that is causing problems? It appears you are using Ice 3.4.0. What OS are you using? Did you have any other versions of Ice installed when you installed 3.4.0?
Also could you see if you still have the same issue with the recently released Ice 3.4.1?
It looks like the issue is that my files dont have this section:
<Global
Name="ZerocIce_Home"
Value="$(ICE_HOME)"
/>
They just have the HomeExpanded key
to answer your questions:
OS is windows XP SP3
Ice 3.31 was installed at the time I installed the 3.4.0 addin.
I am not able to update to 3.4.1 immediately, but I will try it in a few days.
Rich
As I mentioned, our build is failing since we incorporated the ice plugin. We have an environment variable called Ice which points to ice. We reference it as the Ice home in the vcproj file. here is the snippet from the vcproj file
<Global
Name="ZerocIce_Enabled"
Value="True"
/>
<Global
Name="ZerocIce_Home"
Value="$(Ice)"
/>
<Global
Name="ZerocIce_HomeExpanded"
Value="C:\Program Files\ZeroC\Ice-3.4.0"
/>
upon building we get a message:
Error 1 C:\Program Files\ZeroC\Ice-3.4.0\bin\x64\slice2cpp.exe not found. Review 'Ice Home' setting. e:\Build\WCell-2.0.0.63\WCNetReceiver\WcNetControlInterface.ice 0
Now, where can the x64 stuff be coming from? This is a 32 bit machine, and we have never hosted on a 64 bit machine.
Do you have any ideas about this?
thanks
Rich
Regarding this strange "C:\Program Files\ZeroC\Ice-3.4.0\bin\x64\slice2cpp.exe", I just checked the code, and it's a bug. If the add-in cannot find slice2cpp in "iceHome"\bin, it tries "iceHome"\bin\x64\slice2cpp, without checking this file actually exists.
Is $(Ice) a system environment variable on your system? Does it point to C:\Program Files\ZeroC\Ice-3.4.0?
Thanks,
Bernard
yes it is defined and points to the proper location of ICe, which in this case is E:\Program Files\ZeroC\Ice-3.4.0
Does the environment variable Icehome have special meaning?
thanks
Rich
The add-in currently sets this environment variable IceHome, which is not documented (and could be removed soon). Otherwise, it doesn't have a special meaning.
Another undocumented feature of the add-in is the default Ice home, in case you don't set it explicitly: it's the directory of the add-in itself (less \bin). There is no C:\Program Files\ZeroC hard-coded anywhere.
Presumably you have the add-in installed in $(Ice) (on E: ), so even if Visual Studio and the add-in don't see $(Ice) for some reason, the add-in should default to the correct Ice Home. I can't see what's wrong here. We'll try to reproduce this bug.
Thanks,
Bernard
Error 1 C:\Ice-3.4.0\cpp\bin\slice2cpp.exe not found. Review 'Ice Home' setting. c:\DEV\ACE4\BtFrameSync\BtFrameSync.ice 0