Notifications
Clear all

[Closed] [SDK] Preparing Visual Studio C++ for multiple 3ds max SDKs?

Hello,
How do You prepare your workflow in Visual Studio to compile plugins for different 3ds max versions?
Do You automate it in some way? or enter change all internal compiler variables?
I must say I have some problems, In Configuration Manager I make new Configuration called for example ‘2020’ and I want it to copy all settings from Release mode. It not copying everything, so I must change a lot of thing myself, and all variables in MACROS…

14 Replies

i have a folder for each max version
this folders contain the .sln, .vcxproj and .vcxproj.filters file
so 3 files per folder

source files are outside in a common folder

you have an initial project for some version, set there all needed path, i have set path for intermediate files to point into each folder for a max-version,
open the .vcxproj file in a text-editor, aka. notepad

edit at only 2 locations
in <PropertyGroup Label=“Globals”>
there is a <MaxSDK> entry
i have <MaxSDK>$(ADSK_3DSMAX_SDK_2020)</MaxSDK>
“ADSK_3DSMAX_SDK_2020” is an environment-varaible set when installing the SDK (or you did by hand)
to have it for “2019” just change “2020” to ‘2019’

2nd part is in <PropertyGroup>
<OutDir>$(ADSK_3DSMAX_x64_2020)\plugins&lt;/OutDir>
here too just change 2020 to 2019
“ADSK_3DSMAX_x64_2020” is an env-variable set by your max-installation

shortcut, search 2020 and replace to 2019

do this for any version you need
if you use the property-sheets that come with the sdk, all other things should be picked up from there

looks complicated at first look, but when done once, all you need for new projects to copy prj-files and edit them at 2 places

much the same as above, though I use my own property sheets which preserve some commonality from previous versions of visual studio…

But what if project will need a new dependency .lib introduced after a while?
Will it require to edit all project files or all project files can somehow depend on single external ‘list’ of these .lib?
What’s the advantage to have multiple projects vs multiple configurations in a single project?

for me any additional lib/dependencies have their own property sheet.

What’s the advantage to have multiple projects vs multiple configurations in a single project?

dunno just the way i like to work

for example our exporter requires some dx9 legacy support code

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <_ProjectFileVersion>11.0.61030.0</_ProjectFileVersion>
    <_PropertySheetDisplayName>directx9_64</_PropertySheetDisplayName>
  </PropertyGroup>
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>$(DirectX9IncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <AdditionalDependencies>d3dx9.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(DirectX9LibDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <PropertyGroup Label="UserMacros">
    <DirectX9IncludeDir>C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include</DirectX9IncludeDir>
    <DirectX9LibDir>C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x64</DirectX9LibDir>
  </PropertyGroup>
</Project>

Thanks for all your answers…

At first I just wanted to make additional configurations in Configuration Manager, but the changes didn’t save, I think its some kind of bug because I make a very new VC project and the changes was saved as it should…

Cheers!

additinal, I was told about using CMake to make different variation of compilation, but its another thing to learn and too much time consuming, the copying project files “brute force” should be enough

For tyFlow I just use the configuration manager to specify all the different max versions I support. Then each version I specify the SDK to point to, output name, etc. Furthermore I edit the .vcproj file to make certain libs/directories shared between builds, and certain includes/libs separate for different builds. Then I use the Build->Batch Build menu to build them all at once. Super easy, and no need for separate solutions/projects.

build

Thanks!
Yes, I wanted to use this feature at first… but there must be a bug in my project files or something…

When I wanted to change values in new configurations nothing was saving. The values where changing globally, I tried at the very new win32 project and it worked… so I will just stay at the project files copying by now…

Congrats for tyFlow anyway! Great stuff!! I also made my plugin to work with tyFlow…

Thanks!

As for your settings issue…pop open your .vcxproj file in your text editor of choice and set the proper conditions for your settings. Sometimes if VS doesn’t initially set the configuration tags properly, it’ll stay that way and changing the settings in one configuration will affect them all (I’ve had that happen before)…once you manually set things properly in your .vcxproj file, VS should respect the conditions for that particular setting from then on out.

Here’s what I mean:

If the circled conditions were missing, the setting would be applied to all builds. No doubt in your .vcxproj you’re missing the conditions and VS didn’t add them for whatever reason.

Page 1 / 2