Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it.
[blender.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   add_definitions(-DOPENVDB_STATICLIB)
31 endif()
32
33 if(WIN32)
34   add_definitions(-D_USE_MATH_DEFINES)
35 endif()
36
37
38 set(INC
39   extern
40   intern/strings
41   ../../source/blender/makesdna
42   ../../source/blender/blenlib
43 )
44
45 # Python is always required
46 add_definitions(-DWITH_PYTHON)
47
48 set(INC_SYS
49   ../../extern/mantaflow/helper/util
50   ../../extern/mantaflow/helper/pwrapper
51   ../../extern/mantaflow/preprocessed
52   ${PYTHON_INCLUDE_DIRS}
53   ${ZLIB_INCLUDE_DIRS}
54 )
55
56 if(WITH_TBB)
57   list(APPEND INC_SYS
58     ${TBB_INCLUDE_DIRS}
59   )
60   list(APPEND LIB
61     ${TBB_LIBRARIES}
62   )
63 endif()
64
65 if(WITH_OPENVDB)
66   list(APPEND INC_SYS
67     ${BOOST_INCLUDE_DIR}
68     ${OPENEXR_INCLUDE_DIRS}
69     ${OPENVDB_INCLUDE_DIRS}
70   )
71   list(APPEND LIB
72     ${OPENVDB_LIBRARIES}
73     ${OPENEXR_LIBRARIES}
74     ${ZLIB_LIBRARIES}
75     ${BOOST_LIBRARIES}
76   )
77   if(WITH_OPENVDB_BLOSC)
78     list(APPEND LIB
79       ${BLOSC_LIBRARIES}
80       ${ZLIB_LIBRARIES}
81     )
82   endif()
83 endif()
84
85 set(SRC
86   intern/manta_python_API.cpp
87   intern/manta_fluid_API.cpp
88   intern/MANTA_main.cpp
89
90   extern/manta_python_API.h
91   extern/manta_fluid_API.h
92   intern/MANTA_main.h
93   intern/strings/fluid_script.h
94   intern/strings/smoke_script.h
95   intern/strings/liquid_script.h
96 )
97
98 set(LIB
99   extern_mantaflow
100
101   ${PYTHON_LINKFLAGS}
102   ${PYTHON_LIBRARIES}
103   ${ZLIB_LIBRARIES}
104 )
105
106 blender_add_lib(bf_intern_mantaflow "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")