How to target the existing project to new platform

简介:

Recently, I am always asked about how to use the project on different platform or different Visual Studio version. For instance, If the project uses Windows Mobile 6 Professional SDK (ARMV4I) platform and bases on Visual Studio 2008, and you want to use it on Pocket PC 2003(ARMV4I) using Visual Studio 2005.

The easy way to achieve that is to change the project file. Following xml file illuminates the project file for CppUnitLite targeted to Windows Mobile 6 Professional SDK (ARMV4I) and based on Visual Studio 2008.

<?xml version="1.0" encoding="Windows-1252"?>
<
VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="CppUnitLite"
ProjectGUID="{A022C462-A27C-442D-999E-F36C91517D40}"
RootNamespace="CppUnitLite"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<
Platforms>
<
Platform
Name="Windows Mobile 6 Professional SDK (ARMV4I)"
/>
</
Platforms>
<
ToolFiles>
</
ToolFiles>
<
Configurations>
<
Configuration
Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<
Tool
Name="VCPreBuildEventTool"
/>
<
Tool
Name="VCCustomBuildTool"
/>
<
Tool
Name="VCXMLDataGeneratorTool"
/>
<
Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<
Tool
Name="VCMIDLTool"
/>
<
Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="0"
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
MinimalRebuild="true"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<
Tool
Name="VCManagedResourceCompilerTool"
/>
<
Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<
Tool
Name="VCPreLinkEventTool"
/>
<
Tool
Name="VCLibrarianTool"
AdditionalOptions=" /subsystem:windowsce,5.02"
OutputFile="../Bin/CppUnitLite.lib"
/>
<
Tool
Name="VCALinkTool"
/>
<
Tool
Name="VCXDCMakeTool"
/>
<
Tool
Name="VCBscMakeTool"
/>
<
Tool
Name="VCFxCopTool"
/>
<
Tool
Name="VCCodeSignTool"
/>
<
Tool
Name="VCPostBuildEventTool"
/>
<
DeploymentTool
ForceDirty="-1"
RemoteDirectory=""
RegisterOutput="0"
AdditionalFiles=""
/>
<
DebuggerTool
/>
</
Configuration>
<
Configuration
Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
>
<
Tool
Name="VCPreBuildEventTool"
/>
<
Tool
Name="VCCustomBuildTool"
/>
<
Tool
Name="VCXMLDataGeneratorTool"
/>
<
Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<
Tool
Name="VCMIDLTool"
/>
<
Tool
Name="VCCLCompilerTool"
ExecutionBucket="7"
Optimization="2"
FavorSizeOrSpeed="2"
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<
Tool
Name="VCManagedResourceCompilerTool"
/>
<
Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<
Tool
Name="VCPreLinkEventTool"
/>
<
Tool
Name="VCLibrarianTool"
AdditionalOptions=" /subsystem:windowsce,5.02"
OutputFile="http://www.cnblogs.com/app/sensors/Lib/CppUnitLite.lib"
/>
<
Tool
Name="VCALinkTool"
/>
<
Tool
Name="VCXDCMakeTool"
/>
<
Tool
Name="VCBscMakeTool"
/>
<
Tool
Name="VCFxCopTool"
/>
<
Tool
Name="VCCodeSignTool"
/>
<
Tool
Name="VCPostBuildEventTool"
/>
<
DeploymentTool
ForceDirty="-1"
RemoteDirectory=""
RegisterOutput="0"
AdditionalFiles=""
/>
<
DebuggerTool
/>
</
Configuration>
</
Configurations>
<
References>
</
References>
<
Files>
<
Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<
File
RelativePath=".\Failure.cpp"
>
</
File>
<
File
RelativePath=".\SimpleString.cpp"
>
</
File>
<
File
RelativePath=".\Test.cpp"
>
</
File>
<
File
RelativePath=".\TestRegistry.cpp"
>
</
File>
<
File
RelativePath=".\TestResult.cpp"
>
</
File>
</
Filter>
<
Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<
File
RelativePath=".\Failure.h"
>
</
File>
<
File
RelativePath=".\SimpleString.h"
>
</
File>
<
File
RelativePath=".\Test.h"
>
</
File>
<
File
RelativePath=".\TestHarness.h"
>
</
File>
<
File
RelativePath=".\TestRegistry.h"
>
</
File>
<
File
RelativePath=".\TestResult.h"
>
</
File>
</
Filter>
<
Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</
Filter>
<
File
RelativePath=".\ReadMe.txt"
>
</
File>
</
Files>
<
Globals>
</
Globals>
</
VisualStudioProject>

If you want to use this project on Pocket PC 2003 and use Visual Studio 2005 as the complier. Two things need to be changed for this case.

How to change

1. Change the complier version number.

<VisualStudioProject
ProjectType="Visual C++"
Version="9.00" <!-- Change the version number to 8.00 -->

 

2. Change the platform name.

<Platforms>
<
Platform
Name="Windows Mobile 6 Professional SDK (ARMV4I)" <!--ChangetheplatformnametoPocketPC2003(ARMV4).-->

Notes please, more than one spots use this platform name. All those platform names should be replaced by the new one.

How to confirm the new platform name

Right the project name and select properties. In this case, the platform name is Pocket PC 2003(ARMV4).

image


    本文转自Jake Lin博客园博客,原文链接:http://www.cnblogs.com/procoder/archive/2010/07/14/How-to-target-the-existing-project-to-new-platform.html,如需转载请自行联系原作者


相关文章
|
6月前
target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target S
target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target S
91 0
Get Files In Folder [ DTFolderFiles ] Plug-in description
Get Files In Folder [ DTFolderFiles ] Plug-in description
48 0
|
IDE 开发工具 数据库
STM32bug【 KEILMDK中出现The Project references devices, files or libraries that are not installed】
STM32bug【 KEILMDK中出现The Project references devices, files or libraries that are not installed】
252 0
No matching configuration of project :libusb was found.
No matching configuration of project :libusb was found.
601 0
No plugin found for prefix ‘doclint‘ in the current project
No plugin found for prefix ‘doclint‘ in the current project
125 0
|
开发工具
Failed to find Build Tools revision 25.0.2
Failed to find Build Tools revision 25.0.2
125 0
成功解决OpenVideoCall(不可用)以及MSB8020 The build tools for v141 (Platform Toolset = ‘v141‘) cannot be found
成功解决OpenVideoCall(不可用)以及MSB8020 The build tools for v141 (Platform Toolset = ‘v141‘) cannot be found
成功解决OpenVideoCall(不可用)以及MSB8020 The build tools for v141 (Platform Toolset = ‘v141‘) cannot be found
|
开发工具 Android开发
Failed to find Build Tools revision 28.0.3
Failed to find Build Tools revision 28.0.3
304 0
Failed to find Build Tools revision 28.0.3
|
JavaScript 前端开发 物联网
12 Open Source Projects by Alibaba – Part 2
This article introduces and summarizes twelve open source projects from Alibaba and Alibaba Cloud.
2264 0
12 Open Source Projects by Alibaba – Part 2
|
NoSQL Dubbo 应用服务中间件
12 Open Source Projects by Alibaba – Part 1
This article introduces and summarizes twelve open source projects from Alibaba and Alibaba Cloud.
4577 0
12 Open Source Projects by Alibaba – Part 1