@@ -23,6 +23,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged
2323
2424project (IfcOpenShell)
2525
26+ foreach (max_year RANGE 2014 2030)
27+ set (max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year} }" )
28+ if (NOT "${max_sdk} " STREQUAL "" )
29+ MESSAGE (STATUS "Autodesk 3ds Max SDK found at ${max_sdk} " )
30+ set (HAS_MAX TRUE )
31+ endif ()
32+ endforeach ()
33+
2634OPTION (UNICODE_SUPPORT "Build IfcOpenShell with Unicode support (requires ICU)." ON )
2735OPTION (COLLADA_SUPPORT "Build IfcConvert with COLLADA support (requires OpenCOLLADA)." ON )
2836OPTION (IFCXML_SUPPORT "Build IfcParse with ifcXML support (requires libxml2)." ON )
@@ -35,8 +43,11 @@ OPTION(BUILD_GEOMSERVER "Build IfcGeomServer executable." ON)
3543OPTION (BUILD_CONVERT "Build IfcConvert executable." ON )
3644OPTION (USE_VLD "Use Visual Leak Detector for debugging memory leaks, MSVC-only." OFF )
3745OPTION (USE_MMAP "Adds a command line options to parse IFC files from memory mapped files using Boost.Iostreams" OFF )
38- OPTION (BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." OFF )
46+ if (${HAS_MAX} )
47+ OPTION (BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." ON )
48+ endif ()
3949OPTION (BUILD_SHARED_LIBS "Build IfcParse and IfcGeom as shared libs (SO/DLL)." OFF )
50+
4051# TODO QtViewer is deprecated ATM as it uses the 0.4 API
4152# OPTION(BUILD_QTVIEWER "Build IfcOpenShell Qt GUI Viewer (requires Qt 4 framework)." OFF)
4253
@@ -100,10 +111,6 @@ UNIFY_ENVVARS_AND_CACHE(LIBXML2_INCLUDE_DIR)
100111UNIFY_ENVVARS_AND_CACHE (LIBXML2_LIBRARIES )
101112UNIFY_ENVVARS_AND_CACHE (PCRE_LIBRARY_DIR )
102113UNIFY_ENVVARS_AND_CACHE (PYTHON_EXECUTABLE )
103- IF (WIN32 )
104- UNIFY_ENVVARS_AND_CACHE (THREEDS_MAX_SDK_HOME )
105- ENDIF ()
106-
107114
108115# Set INSTALL_RPATH for target
109116MACRO (SET_INSTALL_RPATHS _target _paths )
0 commit comments