Put output files in different folders as VS users
would expect.

Also, add more quotes to create_nmf args.

BUG=155087

Review URL: https://codereview.chromium.org/11099046

git-svn-id: https://nativeclient-sdk.googlecode.com/svn/trunk/src@1441 050acbb0-2703-11df-ab0a-9f3f633ae91d
diff --git a/InstallerResources/NaCl/Props/nacl_general.xml b/InstallerResources/NaCl/Props/nacl_general.xml
index d927dbf..2313b64 100644
--- a/InstallerResources/NaCl/Props/nacl_general.xml
+++ b/InstallerResources/NaCl/Props/nacl_general.xml
@@ -56,7 +56,7 @@
 

   <StringProperty Name="OutDir" DisplayName="Output Directory"

                   Description="Specifies a relative path to the output file directory; can include environment variables."

-                  Category="General" Default="$(SolutionDir)$(Configuration)\"

+                  Category="General" Default="$(SolutionDir)\$(Platform)\$(Toolchain)\$(Configuration)\"

                   Subtype="folder"

                   F1Keyword="VC.Project.VCConfiguration.OutputDirectory">

                   <StringProperty.DataSource>

@@ -77,7 +77,7 @@
   <StringProperty Name="TargetName" DisplayName="Target Name"

                   Description="Specifies a file name that this project will generate."

                   F1Keyword="VC.Project.VCConfiguration.TargetName"

-                  Category="General" Default="$(ProjectName)"

+                  Category="General" Default="$(ProjectName)_$(TargetArchitecture)"

                   >

                   <StringProperty.DataSource>

                      <DataSource Persistence="ProjectFile" Label="" />

diff --git a/InstallerResources/NaCl64/Microsoft.Cpp.NaCl64.default.props b/InstallerResources/NaCl64/Microsoft.Cpp.NaCl64.default.props
index 85944f2..3a7ed8d 100644
--- a/InstallerResources/NaCl64/Microsoft.Cpp.NaCl64.default.props
+++ b/InstallerResources/NaCl64/Microsoft.Cpp.NaCl64.default.props
@@ -3,12 +3,13 @@
     <PlatformShortName>NaCl64</PlatformShortName>

     <PlatformArchitecture>64</PlatformArchitecture>

     <TargetArchitecture>x86_64</TargetArchitecture>

-

+    <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>

+    <TargetName Condition="'$(TargetName)'==''">$(ProjectName)_$(TargetArchitecture)</TargetName>

     <ToolchainName Condition="'$(ToolchainName)' == ''">newlib</ToolchainName>

 

     <IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'!=''">$(IntermediateOutputPath)</IntDir>

     <IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'==''">$(Platform)\$(ToolchainName)\$(Configuration)\</IntDir>

-    <OutDir Condition="'$(OutDir)'==''">$(ProjectDir)$(ToolchainName)\</OutDir>

+    <OutDir Condition="'$(OutDir)'==''">$(SolutionDir)$(Platform)\$(ToolchainName)\$(Configuration)\</OutDir>

 

     <VSNaClSDKRoot Condition="'$(VSNaClSDKRoot)'==''">$(NACL_SDK_ROOT)\</VSNaClSDKRoot>

     <NaClWebServerPort Condition="'$(NaClWebServerPort)'==''">5103</NaClWebServerPort>

diff --git a/InstallerResources/examples/hello_world_gles/hello_world_gles/hello_world_gles.vcxproj b/InstallerResources/examples/hello_world_gles/hello_world_gles/hello_world_gles.vcxproj
index 2a36ebe..28c6ff5 100644
--- a/InstallerResources/examples/hello_world_gles/hello_world_gles/hello_world_gles.vcxproj
+++ b/InstallerResources/examples/hello_world_gles/hello_world_gles/hello_world_gles.vcxproj
@@ -50,30 +50,24 @@
   <PropertyGroup Label="UserMacros" />

   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|NaCl64'">

     <NaClAddInVersion>1.0.4665.30163</NaClAddInVersion>

-    <OutDir>$(ProjectDir)$(ToolchainName)\</OutDir>

-    <TargetName>$(ProjectName)_$(TargetArchitecture)</TargetName>

     <VSNaClSDKRoot>$(NACL_SDK_ROOT)\</VSNaClSDKRoot>

     <IncludePath>$(VSNaClSDKRoot)include;</IncludePath>

     <LibraryPath>$(VSNaClSDKRoot)lib;</LibraryPath>

   </PropertyGroup>

   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|NaCl32'">

     <NaClAddInVersion>1.0.4665.30163</NaClAddInVersion>

-    <OutDir>$(ProjectDir)$(ToolchainName)\</OutDir>

-    <TargetName>$(ProjectName)_$(TargetArchitecture)</TargetName>

     <VSNaClSDKRoot>$(NACL_SDK_ROOT)\</VSNaClSDKRoot>

     <IncludePath>$(VSNaClSDKRoot)include;</IncludePath>

     <LibraryPath>$(VSNaClSDKRoot)lib;</LibraryPath>

   </PropertyGroup>

   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|NaCl64'">

     <NaClAddInVersion>1.0.4665.30163</NaClAddInVersion>

-    <OutDir>$(ProjectDir)$(ToolchainName)\</OutDir>

     <VSNaClSDKRoot>$(NACL_SDK_ROOT)\</VSNaClSDKRoot>

     <IncludePath>$(VSNaClSDKRoot)include;</IncludePath>

     <LibraryPath>$(VSNaClSDKRoot)lib;</LibraryPath>

   </PropertyGroup>

   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|NaCl32'">

     <NaClAddInVersion>1.0.4665.30163</NaClAddInVersion>

-    <OutDir>$(ProjectDir)$(ToolchainName)\</OutDir>

     <VSNaClSDKRoot>$(NACL_SDK_ROOT)\</VSNaClSDKRoot>

     <IncludePath>$(VSNaClSDKRoot)include;</IncludePath>

     <LibraryPath>$(VSNaClSDKRoot)lib;</LibraryPath>

@@ -97,7 +91,8 @@
     </Link>

     <PostBuildEvent>

       <Command>set PATH=$(Path)

-python.exe $(VSNaClSDKRoot)\tools\create_nmf.py -D $(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\bin\x86_64-nacl-objdump.exe -L $(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\x86_64-nacl\lib -L $(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\x86_64-nacl\lib32 -o $(ToolchainName)\hello_world_gles.nmf -t $(ToolchainName) -s $(ToolchainName) $(TargetDir)$(TargetName)_$(TargetArchitecture)$(TargetExt)</Command>

+mkdir $(ToolchainName)

+python.exe "$(VSNaClSDKRoot)\tools\create_nmf.py" -D "$(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\bin\x86_64-nacl-objdump.exe" -L "$(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\x86_64-nacl\lib" -L "$(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\x86_64-nacl\lib32" -o $(ToolchainName)\hello_world_gles.nmf -t $(ToolchainName) -s $(ToolchainName) "$(TargetPath)"</Command>

       <Message>Running 'create_nmf'</Message>

     </PostBuildEvent>

   </ItemDefinitionGroup>

@@ -107,7 +102,8 @@
     </Link>

     <PostBuildEvent>

       <Command>set PATH=$(Path)

-python.exe $(VSNaClSDKRoot)\tools\create_nmf.py -D $(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\bin\x86_64-nacl-objdump.exe -L $(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\x86_64-nacl\lib -L "$(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\x86_64-nacl\lib32" -o $(ToolchainName)\hello_world_gles.nmf -t $(ToolchainName) -s $(ToolchainName) "$(TargetDir)$(TargetName)$(TargetExt)"</Command>

+mkddir $(ToolchainName)

+python.exe "$(VSNaClSDKRoot)\tools\create_nmf.py" -D "$(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\bin\x86_64-nacl-objdump.exe" -L "$(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\x86_64-nacl\lib" -L "$(VSNaClSDKRoot)\toolchain\win_x86_$(ToolchainName)\x86_64-nacl\lib32" -o $(ToolchainName)\hello_world_gles.nmf -t $(ToolchainName) -s $(ToolchainName) "$(TargetPath)"</Command>

       <Message>Running 'create_nmf'</Message>

     </PostBuildEvent>

   </ItemDefinitionGroup>