Cleanup: deduplicate OpenVDB library definitions/include/libs logic
[blender-staging.git] / intern / mantaflow / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2019, Blender Foundation
18 # All rights reserved.
19 #
20 # The Original Code is: all of this file.
21 #
22 # Contributor(s): Sebastian Barschkis (sebbas)
23 #
24 # ***** END GPL LICENSE BLOCK *****
25
26 add_definitions(-DWITH_FLUID=1)
27
28 if(WITH_OPENVDB)
29   add_definitions(-DOPENVDB=1)
30 else()
31   add_definitions(-DOPENVDB=0)
32 endif()
33
34 if(WIN32)
35   add_definitions(-D_USE_MATH_DEFINES)
36 endif()
37
38
39 set(INC
40   extern
41   intern/strings
42   ../../source/blender/makesdna
43   ../../source/blender/blenlib
44 )
45
46 # Python is always required
47 add_definitions(-DWITH_PYTHON)
48
49 set(INC_SYS
50   ../../extern/mantaflow/helper/util
51   ../../extern/mantaflow/helper/pwrapper
52   ../../extern/mantaflow/preprocessed
53   ${PYTHON_INCLUDE_DIRS}
54   ${ZLIB_INCLUDE_DIRS}
55 )
56
57 if(WITH_TBB)
58   list(APPEND INC_SYS
59     ${TBB_INCLUDE_DIRS}
60   )
61   list(APPEND LIB
62     ${TBB_LIBRARIES}
63   )
64 endif()
65
66 if(WITH_OPENVDB)
67   list(APPEND INC_SYS
68     ${OPENVDB_INCLUDE_DIRS}
69   )
70   list(APPEND LIB
71     ${OPENVDB_LIBRARIES}
72   )
73 endif()
74
75 set(SRC
76   intern/manta_python_API.cpp
77   intern/manta_fluid_API.cpp
78   intern/MANTA_main.cpp
79
80   extern/manta_python_API.h
81   extern/manta_fluid_API.h
82   intern/MANTA_main.h
83   intern/strings/fluid_script.h
84   intern/strings/smoke_script.h
85   intern/strings/liquid_script.h
86 )
87
88 set(LIB
89   extern_mantaflow
90
91   ${PYTHON_LINKFLAGS}
92   ${PYTHON_LIBRARIES}
93   ${ZLIB_LIBRARIES}
94 )
95
96 blender_add_lib(bf_intern_mantaflow "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")