-
-
Notifications
You must be signed in to change notification settings - Fork 902
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
96 lines (87 loc) · 3.66 KB
/
CMakeLists.txt
File metadata and controls
96 lines (87 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
################################################################################
# #
# This file is part of IfcOpenShell. #
# #
# IfcOpenShell is free software: you can redistribute it and/or modify #
# it under the terms of the Lesser GNU General Public License as published by #
# the Free Software Foundation, either version 3.0 of the License, or #
# (at your option) any later version. #
# #
# IfcOpenShell is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# Lesser GNU General Public License for more details. #
# #
# You should have received a copy of the Lesser GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
# check for 3ds Max SDK
foreach(max_year RANGE 2014 2030)
set(max_sdk "$ENV{ADSK_3DSMAX_SDK_${max_year}}")
if(NOT "${max_sdk}" STREQUAL "")
message(STATUS "Autodesk 3ds Max SDK ${max_year} found at ${max_sdk}")
list(APPEND FOUND_MAX_YEARS ${max_year})
list(APPEND FOUND_MAX_SDKS ${max_sdk})
set(HAS_MAX TRUE)
endif()
endforeach()
if(HAS_MAX)
# build libraray for each found 3ds Max SDK
foreach(max_year max_sdk IN ZIP_LISTS FOUND_MAX_YEARS FOUND_MAX_SDKS)
message(STATUS "Building IFCMax library for Autodesk 3ds Max SDK ${max_year}")
include_directories(
${INCLUDE_DIRECTORIES}
${OPENCOLLADA_INCLUDE_DIRS}
${ICU_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${max_sdk}/include
)
# All recent versions of 3ds Max (2014 and newer) are 64-bit only so assume lib/x64 directory
link_directories(
${LINK_DIRECTORIES}
${IfcOpenShell_BINARY_DIR}
${OPENCOLLADA_LIBRARY_DIR}
${ICU_LIBRARY_DIR}
${Boost_LIBRARY_DIRS}
${max_sdk}/lib/x64/Release
)
add_library(IfcMax_${max_year} SHARED IfcMax.h IfcMax.cpp)
# TODO: find the minimal subset of 3dsmax libraries to reference
target_link_libraries(
IfcMax_${max_year}
${IFCOPENSHELL_LIBRARIES}
bmm.lib
Comctl32.lib
core.lib
CustDlg.lib
edmodel.lib
expr.lib
flt.lib
geom.lib
gfx.lib
gup.lib
imageViewers.lib
ManipSys.lib
maxnet.lib
Maxscrpt.lib
maxutil.lib
MenuMan.lib
menus.lib
mesh.lib
MNMath.lib
Paramblk2.lib
particle.lib
Poly.lib
RenderUtil.lib
tessint.lib
viewfile.lib
zlibdll.lib
${OpenCASCADE_LIBRARIES}
)
set_target_properties(IfcMax_${max_year} PROPERTIES SUFFIX ".dli")
install(TARGETS IfcMax_${max_year})
endforeach()
else()
message(STATUS "Autodesk 3ds Max SDK not found, is required to build IFCMax.")
endif()