Tutorial: Project upgrade from V13r1 to V13r2 SDK

The scope of this tutorial is to migrate an existing VisualStudio project from SDK V13r1 to SDK V13r2.

We will also add support for ARM64 platform compile target.

Tasks

Step by step

Copy project directory

Make a copy of your project directory - the main directory that contains the SLN file.

Remove old SDK

Delete the SDK directory containing V13r1 SDK files.

Change main make file

Open the main make file of your project (the file yourapp.mak in the same directory as the vcxproj file).

Make the following changes:

Change C++ project file

Open the vcxproj file with a text editor

Install V13r2 SDK files

When you open the project, let the innovaphone Visual Studio Extension copy the SDK files to your source directory. You should now be able to compile and debug the app using 13r2 SDK.

You have to Clean/Rebuild your project to clear the cached libraries.

Create ARM64 platform compile target

The next step isn't necessary right now, but highly recommended to not have to change it in the feature. Starting with 13r2, the apps can be compiled form ARM64, too. Since the 13r1 project file doesn't have any idea about ARM64, the compile target must be added to the vcxproj and sln file. The benefit is, that you don't need to add it later if it is needed (upgrading from 13r2 to newer releases should be way easier for now). To add the ARM64 compile target, please patch the vcxproj and sln files as follows:

Close VisualStudio solution and open the SLN file of your project in a text editor.

GlobalSection(SolutionConfigurationPlatforms)

Add the following lines to the GlobalSection(SolutionConfigurationPlatforms) section:

    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|ARM = Debug|ARM
        Debug|ARM64 = Debug|ARM64
        Debug|x64 = Debug|x64
        Release|ARM = Release|ARM
        Release|ARM64 = Release|ARM64
        Release|x64 = Release|x64
    EndGlobalSection

GlobalSection(ProjectConfigurationPlatforms)

Proceed to "GlobalSection(ProjectConfigurationPlatforms)" section.

After the line "{E0104876-BAB2-4678-BF5B-BA325726D66E}.Debug|ARM.Deploy.0 = Debug|ARM" insert the three lines below (also - adjust them):

        {E0104876-BAB2-4678-BF5B-BA325726D66E}.Debug|ARM64.ActiveCfg = Debug|ARM64
        {E0104876-BAB2-4678-BF5B-BA325726D66E}.Debug|ARM64.Build.0 = Debug|ARM64
        {E0104876-BAB2-4678-BF5B-BA325726D66E}.Debug|ARM64.Deploy.0 = Debug|ARM64

After the line "{E0104876-BAB2-4678-BF5B-BA325726D66E}.Release|ARM.Deploy.0 = Release|ARM" insert the three lines below (and again - adjust them):

        {E0104876-BAB2-4678-BF5B-BA325726D66E}.Release|ARM64.ActiveCfg = Release|ARM64
        {E0104876-BAB2-4678-BF5B-BA325726D66E}.Release|ARM64.Build.0 = Release|ARM64
        {E0104876-BAB2-4678-BF5B-BA325726D66E}.Release|ARM64.Deploy.0 = Release|ARM64

Save the SLN file

Patch the vcxproj file

Open the vcxproj file.

After the "<ProjectConfiguration Include="Release|ARM">" block (after the corresponding </ProjectConfiguration> tag) insert the following lines:


        <ProjectConfiguration Include="Release|ARM64">
          <Configuration>Release</Configuration>
          <Platform>ARM64</Platform>
        </ProjectConfiguration>
        <ProjectConfiguration Include="Debug|ARM64">
          <Configuration>Debug</Configuration>
          <Platform>ARM64</Platform>
        </ProjectConfiguration>
        

After the "<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">" block, insert the following lines:

        <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
            <ConfigurationType>Makefile</ConfigurationType>
            <UseDebugLibraries>false</UseDebugLibraries>
        </PropertyGroup>
        <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
            <ConfigurationType>Makefile</ConfigurationType>
            <UseDebugLibraries>true</UseDebugLibraries>
        </PropertyGroup>
        <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug (Visual GDB)|ARM64'" Label="Configuration">
            <ConfigurationType>Makefile</ConfigurationType>
            <UseDebugLibraries>true</UseDebugLibraries>
        </PropertyGroup>
        

After the <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> block, insert the following lines:

        <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
        <PostBuildEvent>
            <Command>IF "%INNOVAPHONE-SDK-DEPLOY-APP%"=="YES" deploy-app --remoteMachine="$(RemoteTarget)" --appName=$(MSBuildProjectName) --appBinary="$(ProjectDir)arm64-debug\NewApp2\newapp2" --vsMode</Command>
            </PostBuildEvent>
        </ItemDefinitionGroup>
        

Next look for "<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">" and after the group insert:

<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
          <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
        </ImportGroup>
        <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
          <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
        </ImportGroup>

Adjust the following text by replaceing "NewApp2" with the case sensitive name of your project and "newapp2" with the lowercase name of your project.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
          <LocalRemoteCopySources>false</LocalRemoteCopySources>
          <BuildCommandLine>call common/build/buildnum NewApp2.mak arm64</BuildCommandLine>
          <CleanCommandLine>make -f NewApp2.mak clean-arm64</CleanCommandLine>
          <ExecutablePath>$(innovaphone-sdk)\app-platform-buildtls;$(innovaphone-sdk)\aarch64-7.2.0-linux-gnu\bin</ExecutablePath>
          <NMakeIncludeSearchPath>sdk;.;common\lap;$(innovaphone-sdk)\aarch64-7.2.0-linux-gnu\aarch64-linux-gnu\include\c++\7.2.0;$(innovaphone-sdk)\app-platform-libs\10\arm64\usr\include;$(innovaphone-sdk)\app-platform-libs\10\arm64\usr\include\postgresql;$(innovaphone-sdk)\aarch64-7.2.0-linux-gnu\lib\gcc\aarch64-linux-gnu\7.2.0\include;$(innovaphone-sdk)\aarch64-7.2.0-linux-gnu\aarch64-linux-gnu\include\c++\7.2.0\aarch64-linux-gnu</NMakeIncludeSearchPath>
          <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
          <IntDir>$(SolutionDir)$(Configuration)\</IntDir>
          <SourcesToCopyRemotelyOverride>@(SourcesToCopyRemotely);@(DataFilesToCopyRemotely)</SourcesToCopyRemotelyOverride>
          <ReBuildCommandLine>make -f NewApp2.mak clean-arm64 &amp;&amp; call common/build/buildnum NewApp2.mak arm64</ReBuildCommandLine>
        </PropertyGroup>
        <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm64'">
          <LocalRemoteCopySources>false</LocalRemoteCopySources>
          <BuildCommandLine>call common/build/buildnum NewApp2.mak arm64 "DEBUG=1"</BuildCommandLine>
          <CleanCommandLine>make -f NewApp2.mak clean-arm64 DEBUG=1</CleanCommandLine>
          <ExecutablePath>$(innovaphone-sdk)\app-platform-buildtls;$(innovaphone-sdk)\aarch64-7.2.0-linux-gnu\bin</ExecutablePath>
          <NMakeIncludeSearchPath>sdk;.;common\lap;$(innovaphone-sdk)\aarch64-7.2.0-linux-gnu\aarch64-linux-gnu\include\c++\7.2.0;$(innovaphone-sdk)\app-platform-libs\10\arm64\usr\include;$(innovaphone-sdk)\app-platform-libs\10\arm64\usr\include\postgresql;$(innovaphone-sdk)\aarch64-7.2.0-linux-gnu\lib\gcc\aarch64-linux-gnu\7.2.0\include;$(innovaphone-sdk)\aarch64-7.2.0-linux-gnu\aarch64-linux-gnu\include\c++\7.2.0\aarch64-linux-gnu</NMakeIncludeSearchPath>
          <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
          <IntDir>$(SolutionDir)$(Configuration)\</IntDir>
          <SourcesToCopyRemotelyOverride>@(SourcesToCopyRemotely);@(DataFilesToCopyRemotely)</SourcesToCopyRemotelyOverride>
          <ReBuildCommandLine>make -f NewApp2.mak clean-arm64 DEBUG=1 &amp;&amp; call common/build/buildnum NewApp2.mak arm64 "DEBUG=1"</ReBuildCommandLine>
          <RemoteDebuggerCommand>/apps/newapp2/newapp2</RemoteDebuggerCommand>
          <DebuggerFlavor>LinuxDebugger</DebuggerFlavor>
        </PropertyGroup>

After the "<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">" group insert the adjusted text from above after the block.

Make sure to set ARM64 Platform in the Configuration Manager when building for ARM64 devices.

You should now be able to compile your app for ARM64.