forked from ttvd/houdini-geo-vox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
123 lines (104 loc) · 3.09 KB
/
premake5.lua
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
workspace "GEO_Vox"
-- Add --houdini-version option.
newoption {
trigger = "houdini-version",
value = "version",
description = "Version of Houdini to build against"
}
-- Make sure the version has been specified.
if not _OPTIONS["houdini-version"] then
premake.error("Please specify Houdini version via --houdini-version or run help.")
end
-- Extract Houdini version.
local version_houdini = _OPTIONS["houdini-version"]
-- Construct path to Houdini installation.
local path_houdini = ""
local path_houdini_target = ""
if os.host() == "windows" then
path_houdini = "C:/Program Files/Side Effects Software/Houdini " .. version_houdini
path_houdini_target = path_houdini
elseif os.host() == "linux" then
if os.target() == "windows" then
path_houdini = "/mnt/c/Program Files/Side Effects Software/Houdini " .. version_houdini
path_houdini_target = "C:/Program Files/Side Effects Software/Houdini " .. version_houdini
else
premake.error("Unsupported platform.")
end
else
premake.error("Unsupported platform.")
end
-- Check if path is valid.
if not os.isdir(path_houdini) then
premake.error(string.format("Invalid Houdini installation path provided: %s", path_houdini))
end
-- Make version file path.
local version_file_houdini = path_houdini .. "/toolkit/include/sys/SYS_Version.h"
-- Make sure version file exists.
if not os.isfile(version_file_houdini) then
print(version_file_houdini)
premake.error(string.format("Version file not found for Houdini installation: %s", path_houdini))
end
-- Set the sdk.
systemversion(last_sdk)
configurations { "Debug", "Release" }
platforms { "Win64" }
architecture "x64"
location "_build"
buildoptions {
"/TP",
"/bigobj",
"/GR",
"/Zc:forScope",
"/wd4355",
"/w14996",
"/MD",
"/EHsc",
"/nologo"
}
defines {
"VERSION=" .. version_houdini,
"WIN32",
"I386",
"MAKING_DSO",
"AMD64",
"SIZEOF_VOID_P=8",
"SESI_LITTLE_ENDIAN",
"FBX_ENABLED=1",
"OPENCL_ENABLED=1",
"OPENVDB_ENABLED=1",
"_REENTRANT",
"_FILE_OFFSET_BITS=64",
"_WIN32_WINNT=0x0502",
"NOMINMAX",
"_USE_MATH_DEFINES",
"SWAP_BITFIELDS",
"STRICT",
"WIN32_LEAN_AND_MEAN",
"_CRT_SECURE_NO_DEPRECATE",
"_CRT_NONSTDC_NO_DEPRECATE",
"_SCL_SECURE_NO_WARNINGS",
"NDEBUG",
"HBOOST_ALL_NO_LIB"
}
includedirs {
path_houdini_target .. "/toolkit/include"
}
libdirs {
path_houdini_target .. "/custom/houdini/dsolib",
path_houdini_target .. "/bin"
}
startproject "GEO_Vox"
project "GEO_Vox"
kind "SharedLib"
language "C++"
files {
"GEO_Vox.C",
"GEO_Vox.h"
}
links {
"libUT",
"libGEO",
"libGA",
"libGU",
"libSYS"
}