Skip to content

Building a 3ds max CMake projects

Lukas Cone edited this page Mar 18, 2022 · 2 revisions

Following guide will show, how to use CMake to create and build a 3ds max project.
A variables in this document are presented with a ${} braces.
For example: A platform_type = ${platform} will mean platform_type = x64, just like in the CMake syntax.
Used variables:

  • ${platform} can be Win32 or x64
  • ${MAX_VERSION} a 3ds max version

Generating and building a project

  1. Head to the root of a cloned repo (where the CMakeLists.txt is)
  2. Create build folder and navigate to it.
  3. Create a folder in a style of a ${platform}_${MAX_VERSION}, and navigate to it. (Example: x64_2017)
  4. Generate your project with a cmake command (use cmake --help to get list of generators).
    Additional CMake arguments:
    • -Tv140 = sets the v140 toolset (VS2015)
    • -DMAX_VERSION=${MAX_VERSION}
    • -DMaxDirectory=${path} (optional) where ${path} is a path to a 3ds max directory (default: C:/Program Files/Autodesk/3ds max ${MAX_VERSION})
  5. Build with the CMake: cmake --build . --config ${config_type} --target ALL_BUILD --
    Where ${config_type} can be:
    • RelWithDebInfo or Debug: A binary files will be built in a specified 3ds max pluginsfolder. (${MaxDirectory}/plugins)
    • Release: A binary will be built in a bin/${platform}_${MAX_VERSION} folder.

Full example

mkdir build
cd build
mkdir x64_2017
cd x64_2017

cmake "-GVisual Studio 16 2019" -Tv140 -Ax64 -DMAX_VERSION=2017 ../.. 
cmake --build . --config Release --target ALL_BUILD --
Clone this wiki locally