issue #489 modified for vs2008.

This commit is contained in:
yangws 2011-05-13 14:13:30 +08:00
parent 56a1849e9f
commit aba77f4cae
13 changed files with 238 additions and 163 deletions

View File

@ -89,7 +89,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy /Y &quot;$(ProjectDir)..\Resource\*.*&quot; &quot;$(OutDir)&quot;"
CommandLine=""
/>
</Configuration>
<Configuration
@ -168,7 +168,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy /Y &quot;$(ProjectDir)..\Resource\*.*&quot; &quot;$(OutDir)&quot;"
CommandLine=""
/>
</Configuration>
</Configurations>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="gb2312"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="9.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
WorkingDirectory="$(ProjectDir)..\Resource\"
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
WorkingDirectory="$(ProjectDir)..\Resource\"
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -73,7 +73,8 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(ProjectDir)..\Resource\*.*" "$(OutDir)"</Command>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -100,7 +101,8 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(ProjectDir)..\Resource\*.*" "$(OutDir)"</Command>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>

View File

@ -2,5 +2,9 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>false</ShowAllFiles>
<LocalDebuggerWorkingDirectory Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)..\Resource</LocalDebuggerWorkingDirectory>
<LocalDebuggerWorkingDirectory Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)..\Resource</LocalDebuggerWorkingDirectory>
<DebuggerFlavor Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WindowsLocalDebugger</DebuggerFlavor>
<DebuggerFlavor Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@ -39,8 +39,11 @@ echo.* Check the cocos2d-win32 application "tests.exe" ...
echo.*/
echo.
set CC_TEST_PATH=".\Release.win32\tests.exe"
if not exist %CC_TEST_PATH% (
cd ".\Release.win32\"
set CC_TEST_BIN="tests.exe"
set CC_TEST_RES="..\tests\Res\*.*"
if not exist %CC_TEST_BIN% (
echo Can't find the binary "tests.exe", is there build error?
goto ERROR
)
@ -49,7 +52,8 @@ echo./*
echo.* Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual Studio User Guide.
echo.*/
echo.
call %CC_TEST_PATH%
xcopy /E /Y /Q %CC_TEST_RES% .
call %CC_TEST_BIN%
start http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-x_Application_Wizard_for_Visual_Studio_User_Guide
goto EOF

View File

@ -37,17 +37,9 @@ void _CheckPath()
{
WCHAR wszPath[MAX_PATH];
int nNum = WideCharToMultiByte(CP_ACP, 0, wszPath,
GetModuleFileName(NULL, wszPath, MAX_PATH),
GetCurrentDirectory(sizeof(wszPath), wszPath),
s_pszResourcePath, MAX_PATH, NULL, NULL);
for (int i = nNum; i >= 0; --i)
{
if (L'\\' == s_pszResourcePath[i])
{
s_pszResourcePath[i + 1] = 0;
break;
}
}
s_pszResourcePath[nNum] = '\\';
}
}

View File

@ -42,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\include;.."
AdditionalIncludeDirectories="..\platform;..\platform\third_party\win32\iconv;..\platform\third_party\win32\zlib;..\platform\third_party\win32\libpng;..\platform\third_party\win32\libjpeg;..\platform\third_party\win32\libxml2;..\platform\third_party\win32\OGLES;..\include;.."
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -124,7 +124,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\cocos2dx\platform&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\iconv&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\zlib&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libpng&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libjpeg&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\libxml2&quot;;&quot;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES&quot;;..\include;.."
AdditionalIncludeDirectories="..\platform;..\platform\third_party\win32\iconv;..\platform\third_party\win32\zlib;..\platform\third_party\win32\libpng;..\platform\third_party\win32\libjpeg;..\platform\third_party\win32\libxml2;..\platform\third_party\win32\OGLES;..\include;.."
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES"
RuntimeLibrary="2"
UsePrecompiledHeader="0"

View File

@ -99,9 +99,40 @@ function CreateCustomProject(strProjectName, strProjectPath) {
var file = FileSys.OpenTextFile(strUserPath, 2, true);
var strUserValue = "";
if(WizardVersion >= 10.0)
strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n <PropertyGroup>\r\n <ShowAllFiles>true</ShowAllFiles>\r\n </PropertyGroup>\r\n</Project>";
strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"
+ "<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n"
+ " <PropertyGroup>\r\n"
+ " <ShowAllFiles>true</ShowAllFiles>\r\n"
+ " <LocalDebuggerWorkingDirectory Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(ProjectDir)Resource</LocalDebuggerWorkingDirectory>\r\n"
+ " <LocalDebuggerWorkingDirectory Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(ProjectDir)Resource</LocalDebuggerWorkingDirectory>\r\n"
+ " <DebuggerFlavor Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">WindowsLocalDebugger</DebuggerFlavor>\r\n"
+ " <DebuggerFlavor Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">WindowsLocalDebugger</DebuggerFlavor>\r\n"
+ " </PropertyGroup>\r\n"
+ "</Project>";
else
strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?><VisualStudioUserFile ProjectType=\"Visual C++\" Version=\"9.00\" ShowAllFiles=\"true\"></VisualStudioUserFile>";
strUserValue = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"
+ "<VisualStudioUserFile\r\n"
+ " ProjectType=\"Visual C++\"\r\n"
+ " Version=\"9.00\"\r\n"
+ " ShowAllFiles=\"true\"\r\n"
+ " >\r\n"
+ " <Configurations>\r\n"
+ " <Configuration\r\n"
+ " Name=\"Debug|Win32\"\r\n"
+ " >\r\n"
+ " <DebugSettings\r\n"
+ " WorkingDirectory=\"$(ProjectDir)Resource\\\"\r\n"
+ " />\r\n"
+ " </Configuration>\r\n"
+ " <Configuration\r\n"
+ " Name=\"Release|Win32\"\r\n"
+ " >\r\n"
+ " <DebugSettings\r\n"
+ " WorkingDirectory=\"$(ProjectDir)Resource\\\"\r\n"
+ " />\r\n"
+ " </Configuration>\r\n"
+ " </Configurations>\r\n"
+ "</VisualStudioUserFile>";
file.WriteLine(strUserValue);
file.Close();
@ -280,9 +311,9 @@ function AddConfigurations(proj, strProjectName) {
MidlTool.DLLDataFileName = "";
// Post-build settings
var PostBuildTool = config.Tools("VCPostBuildEventTool");
PostBuildTool.Description = "Performing copy resource from Resource to OutDir...";
PostBuildTool.CommandLine = "xcopy /E /Q /Y \"$(ProjectDir)Resource\\*.*\" \"$(OutDir)\"";
// var PostBuildTool = config.Tools("VCPostBuildEventTool");
// PostBuildTool.Description = "Performing copy resource from Resource to OutDir...";
// PostBuildTool.CommandLine = "xcopy /E /Q /Y \"$(ProjectDir)Resource\\*.*\" \"$(OutDir)\"";
}
}
catch (e) {

View File

@ -1,2 +0,0 @@
echo off
xcopy /E /Y /Q ..\Res\*.* %1

View File

@ -90,7 +90,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy_res.bat &quot;$(OutDir)&quot;"
CommandLine=""
/>
</Configuration>
<Configuration
@ -170,7 +170,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy_res.bat &quot;$(OutDir)&quot;"
CommandLine=""
/>
</Configuration>
</Configurations>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="gb2312"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="9.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
WorkingDirectory="$(ProjectDir)..\Res"
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
WorkingDirectory="$(ProjectDir)..\Res"
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -73,9 +73,6 @@
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>copy_res.bat "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -101,9 +98,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>copy_res.bat "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\tests\UserDefaultTest\UserDefaultTest.cpp" />

View File

@ -2,5 +2,9 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>false</ShowAllFiles>
<LocalDebuggerWorkingDirectory Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)..\Res</LocalDebuggerWorkingDirectory>
<LocalDebuggerWorkingDirectory Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)..\Res</LocalDebuggerWorkingDirectory>
<DebuggerFlavor Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WindowsLocalDebugger</DebuggerFlavor>
<DebuggerFlavor Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>