Discussion Setting up Orbiter project w/property pages

ADSWNJ

Scientist
Addon Developer
Joined
Aug 5, 2011
Messages
1,667
Reaction score
3
Points
38
Orb is right: using property pages is a very nice way to keep the hacking of configuration settings to a minimum. I am playing with a couple of test MFD's for some Xmas work with my buddy Enjo, and I took the time to get the property pages as I wanted them.

Here's a quick show-and-tell for you fellow developers:

1. Set up a new project as usual, Win32, DLL, no files please.

2. View... Property Manager, to bring up the property manager pane where the Solution Explorer usually sits.

3. Right-click your project name (in Property Manager), Add Existing Property Sheet... and select OrbiterSdk\resources\Orbiter plugin.props Notice that this also pulls in Orbiter_vs2005.props and orbiterroot.props. Don't worry about the vs2005 name in there ... it all works just fine on VC2010.

4. Right-click on Debug | Win32, Add Existing Property Sheet... and select OrbiterSdk\resources\Orbiter debug.props . You just want this in your debug config.

5. Right-click on orbiterroot Properties, go to User Macros and update the OrbiterRoot definition to your directory. E.g. for mine: $(SystemDrive)\Orbiter

6. That's pretty much it for the mandatory settings. Feel free to play around with the Orbiter_vs2005, Orbiter Plugin and Orbiter Debug to set it how you want. E.g. for me, I want the DLL to be generated directly into the Orbiter root, and I want the intermediate files to be in the Debug or Release subdirectories rather than in the target. See my example files attached to this.

7. Right-click on the project name in Property Manager, Properties ... All Configurations, Debugging ... and set the Command to $(OrbiterDir)\Orbiter.exe (or the _ng.exe if you wish) and the Working Directory to $(OrbiterDir).

That should be all you need to play with. Hit View ... Solution Explorer and go back to hacking cpp and hpp files again.



Here's the current state of my props files:

orbiterroot.props
Code:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Label="UserMacros">
    <OrbiterDir>$(SystemDrive)\Orbiter</OrbiterDir>
  </PropertyGroup>
  <PropertyGroup>
    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
  </PropertyGroup>
  <ItemGroup>
    <BuildMacro Include="OrbiterDir">
      <Value>$(OrbiterDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
  </ItemGroup>
</Project>

orbiter_vs2005.props
Code:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
    <Import Project="orbiterroot.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros">
    <ModuleDir>$(OrbiterDir)\Modules</ModuleDir>
    <MeshDir>$(OrbiterDir)\Meshes</MeshDir>
    <ConfigDir>$(OrbiterDir)\Config</ConfigDir>
    <ScenarioDir>$(OrbiterDir)\Scenarios</ScenarioDir>
    <SDKDir>$(OrbiterDir)\Orbitersdk</SDKDir>
    <SDKIncludeDir>$(SDKDir)\include</SDKIncludeDir>
    <SDKLibDir>$(SDKDir)\lib</SDKLibDir>
    <SDKSampleDir>$(SDKDir)\samples</SDKSampleDir>
  </PropertyGroup>
  <PropertyGroup>
    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
    <LinkIncremental>false</LinkIncremental>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>$(SDKIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
      <BufferSecurityCheck>true</BufferSecurityCheck>
      <FloatingPointModel>Fast</FloatingPointModel>
      <WarningLevel>Level3</WarningLevel>
    </ClCompile>
    <Link>
      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
      <OutputFile>
      </OutputFile>
      <AdditionalLibraryDirectories>$(SDKLibDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup>
    <BuildMacro Include="ModuleDir">
      <Value>$(ModuleDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
    <BuildMacro Include="MeshDir">
      <Value>$(MeshDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
    <BuildMacro Include="ConfigDir">
      <Value>$(ConfigDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
    <BuildMacro Include="ScenarioDir">
      <Value>$(ScenarioDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
    <BuildMacro Include="SDKDir">
      <Value>$(SDKDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
    <BuildMacro Include="SDKIncludeDir">
      <Value>$(SDKIncludeDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
    <BuildMacro Include="SDKLibDir">
      <Value>$(SDKLibDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
    <BuildMacro Include="SDKSampleDir">
      <Value>$(SDKSampleDir)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
  </ItemGroup>
</Project>

Orbiter plugin.props
Code:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
    <Import Project="orbiter_vs2005.props" />
  </ImportGroup>
  <PropertyGroup>
    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
    <OutDir>$(ModuleDir)\Plugin\</OutDir>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <Link>
      <AdditionalDependencies>$(SDKLibDir)\orbiter.lib;$(SDKLibDir)\orbitersdk.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <ProfileGuidedDatabase>$(ProjectDir)$(Configuration)\$(TargetName).pgd</ProfileGuidedDatabase>
      <ImportLibrary>$(ProjectDir)$(Configuration)\$(ProjectName).lib</ImportLibrary>
      <ProgramDatabaseFile>$(ProjectDir)$(Configuration)\$(TargetName).pdb</ProgramDatabaseFile>
      <OutputFile>$(ModuleDir)\Plugin\$(ProjectName).dll</OutputFile>
    </Link>
  </ItemDefinitionGroup>
</Project>

Orbiter debug.props
Code:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
    </ClCompile>
    <Link>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <ProgramDatabaseFile>$(Configuration)\$(TargetName).pdb</ProgramDatabaseFile>
      <IgnoreSpecificDefaultLibraries>msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
</Project>
 
Last edited:

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,813
Reaction score
640
Points
188
Thanks for this ADSWNJ, its prompted me to have a go at VS/Orbiter again, After the holls of course!

N.
 
Top