Refactor: Clarify code around scheduling composite nodes
[blender.git] / source / blender / python / intern / CMakeLists.txt
blobbfcb2fcb6bfa6a2047f2433ac59e67a26dd156fc
1 # SPDX-FileCopyrightText: 2006 Blender Authors
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 set(INC
6   ..
7   ../../editors/include
8   ../../imbuf/intern/oiio
9   ../../makesrna
10   ../../../../intern/mantaflow/extern
11   ../../../../intern/opencolorio
12   # RNA_prototypes.hh
13   ${CMAKE_BINARY_DIR}/source/blender/makesrna
16 set(INC_SYS
17   ${PYTHON_INCLUDE_DIRS}
20 set(SRC
21   bpy.cc
22   bpy_app.cc
23   bpy_app_alembic.cc
24   bpy_app_build_options.cc
25   bpy_app_ffmpeg.cc
26   bpy_app_handlers.cc
27   bpy_app_icons.cc
28   bpy_app_ocio.cc
29   bpy_app_oiio.cc
30   bpy_app_opensubdiv.cc
31   bpy_app_openvdb.cc
32   bpy_app_sdl.cc
33   bpy_app_timers.cc
34   bpy_app_translations.cc
35   bpy_app_usd.cc
36   bpy_capi_utils.cc
37   bpy_cli_command.cc
38   bpy_driver.cc
39   bpy_gizmo_wrap.cc
40   bpy_interface.cc
41   bpy_interface_atexit.cc
42   bpy_interface_run.cc
43   bpy_intern_string.cc
44   bpy_library_load.cc
45   bpy_library_write.cc
46   bpy_msgbus.cc
47   bpy_operator.cc
48   bpy_operator_wrap.cc
49   bpy_path.cc
50   bpy_props.cc
51   bpy_rna.cc
52   bpy_rna_anim.cc
53   bpy_rna_array.cc
54   bpy_rna_callback.cc
55   bpy_rna_context.cc
56   bpy_rna_data.cc
57   bpy_rna_driver.cc
58   bpy_rna_gizmo.cc
59   bpy_rna_id_collection.cc
60   bpy_rna_operator.cc
61   bpy_rna_text.cc
62   bpy_rna_types_capi.cc
63   bpy_rna_ui.cc
64   bpy_traceback.cc
65   bpy_utils_previews.cc
66   bpy_utils_units.cc
67   stubs.cc
69   bpy.hh
70   bpy_app.hh
71   bpy_app_alembic.hh
72   bpy_app_build_options.hh
73   bpy_app_ffmpeg.hh
74   bpy_app_handlers.hh
75   bpy_app_icons.hh
76   bpy_app_ocio.hh
77   bpy_app_oiio.hh
78   bpy_app_opensubdiv.hh
79   bpy_app_openvdb.hh
80   bpy_app_sdl.hh
81   bpy_app_timers.hh
82   bpy_app_translations.hh
83   bpy_app_usd.hh
84   bpy_capi_utils.hh
85   bpy_cli_command.hh
86   bpy_driver.hh
87   bpy_gizmo_wrap.hh
88   bpy_intern_string.hh
89   bpy_library.hh
90   bpy_msgbus.hh
91   bpy_operator.hh
92   bpy_operator_wrap.hh
93   bpy_path.hh
94   bpy_props.hh
95   bpy_rna.hh
96   bpy_rna_anim.hh
97   bpy_rna_callback.hh
98   bpy_rna_context.hh
99   bpy_rna_data.hh
100   bpy_rna_driver.hh
101   bpy_rna_gizmo.hh
102   bpy_rna_id_collection.hh
103   bpy_rna_operator.hh
104   bpy_rna_text.hh
105   bpy_rna_types_capi.hh
106   bpy_rna_ui.hh
107   bpy_traceback.hh
108   bpy_utils_previews.hh
109   bpy_utils_units.hh
110   ../BPY_extern.hh
111   ../BPY_extern_clog.hh
112   ../BPY_extern_python.hh
113   ../BPY_extern_run.hh
116 set(LIB
117   PRIVATE bf::blenkernel
118   PRIVATE bf::blenlib
119   PRIVATE bf::blenloader
120   PRIVATE bf::blentranslation
121   PRIVATE bf::depsgraph
122   PRIVATE bf::dna
123   bf_editor_animation
124   bf_editor_interface
125   bf_editor_space_api
126   PRIVATE bf::gpu
127   PRIVATE bf::imbuf
128   PRIVATE bf::intern::clog
129   PRIVATE bf::intern::guardedalloc
130   PRIVATE bf::animrig
131   bf_python_gpu
133   ${PYTHON_LINKFLAGS}
134   ${PYTHON_LIBRARIES}
135   PRIVATE bf::windowmanager
138 # Only to check if `buildinfo` is available.
139 if(WITH_BUILDINFO)
140   add_definitions(-DBUILD_DATE)
141 endif()
143 if(WITH_INSTALL_PORTABLE)
144   add_definitions(-DWITH_INSTALL_PORTABLE)
145 endif()
147 if(WITH_PYTHON_MODULE)
148   add_definitions(-DWITH_PYTHON_MODULE)
149 endif()
152 # Find the SSL certificate for the portable Blender installation.
153 # Without this, the absolute path on the builder is used, causing HTTPS access to fail.
154 # For example `urllib.request.urlopen("https://projects.blender.org")` fails
155 # (or any other HTTPS site). see: #102300 for details.
156 # NOTE: that this isn't necessary on WIN32.
157 if(WITH_PYTHON AND WITH_PYTHON_INSTALL AND (APPLE OR WITH_INSTALL_PORTABLE) AND (NOT WIN32))
158   # - `PYTHON_SSL_CERT_FILE` absolute path to the PEM file.
159   find_python_module_file("certifi/cacert.pem" PYTHON_SSL_CERT_FILE _python_ssl_cert_file_relative)
160   mark_as_advanced(PYTHON_SSL_CERT_FILE)
161   if(PYTHON_SSL_CERT_FILE)
162     add_definitions(-DPYTHON_SSL_CERT_FILE="${_python_ssl_cert_file_relative}")
163   else()
164     message(WARNING
165       "Unable to find \"certifi/cacert.pem\" within \"${PYTHON_LIBPATH}\", "
166       "this build will not be able to use bundled certificates with the \"ssl\" module!"
167     )
168   endif()
169   unset(_python_ssl_cert_file_relative)
170 endif()
172 if(WITH_PYTHON_SAFETY)
173   add_definitions(-DWITH_PYTHON_SAFETY)
174 endif()
176 if(WITH_AUDASPACE)
177   # It's possible to build with AUDASPACE (for file IO) but without the `aud` Python API,
178   # when building without NUMPY so define both `WITH_AUDASPACE` & `DWITH_AUDASPACE_PY`.
179   add_definitions(-DWITH_AUDASPACE)
180   if(WITH_PYTHON_NUMPY)
181     add_definitions(-DWITH_AUDASPACE_PY)
182   endif()
183 endif()
185 if(WITH_BULLET)
186   add_definitions(-DWITH_BULLET)
187 endif()
189 if(WITH_CODEC_FFMPEG)
190   list(APPEND INC_SYS
191     ${FFMPEG_INCLUDE_DIRS}
192   )
193   list(APPEND LIB
194     ${FFMPEG_LIBRARIES}
195   )
196   add_definitions(-DWITH_FFMPEG)
197 endif()
199 if(WITH_CODEC_SNDFILE)
200   add_definitions(-DWITH_SNDFILE)
201 endif()
203 if(WITH_CYCLES)
204   list(APPEND INC
205     ../../../../intern/cycles/blender
206   )
207   list(APPEND LIB
208     bf_intern_cycles
209   )
210   add_definitions(-DWITH_CYCLES)
211 endif()
213 if(WITH_CYCLES_OSL)
214   add_definitions(-DWITH_CYCLES_OSL)
215 endif()
217 if(WITH_CYCLES_EMBREE)
218   add_definitions(-DWITH_CYCLES_EMBREE)
219 endif()
221 if(WITH_FREESTYLE)
222   list(APPEND INC
223     ../../freestyle/intern/python
224   )
225   add_definitions(-DWITH_FREESTYLE)
226 endif()
228 if(WITH_IMAGE_CINEON)
229   add_definitions(-DWITH_CINEON)
230 endif()
232 if(WITH_IMAGE_OPENEXR)
233   add_definitions(-DWITH_OPENEXR)
234 endif()
236 if(WITH_IMAGE_OPENJPEG)
237   add_definitions(-DWITH_OPENJPEG)
238 endif()
240 if(WITH_WEBP)
241   add_definitions(-DWITH_WEBP)
242 endif()
244 if(WITH_INPUT_NDOF)
245   add_definitions(-DWITH_INPUT_NDOF)
246 endif()
248 if(WITH_INTERNATIONAL)
249   add_definitions(-DWITH_INTERNATIONAL)
250 endif()
252 if(WITH_OPENAL)
253   add_definitions(-DWITH_OPENAL)
254 endif()
256 if(WITH_OPENSUBDIV)
257   add_definitions(-DWITH_OPENSUBDIV)
258 endif()
260 if(WITH_SDL)
261   list(APPEND INC_SYS
262     ${SDL_INCLUDE_DIR}
263   )
264   list(APPEND LIB
265     ${SDL_LIBRARY}
266   )
267   add_definitions(-DWITH_SDL)
268 endif()
270 if(WITH_JACK)
271   add_definitions(-DWITH_JACK)
272 endif()
274 if(WITH_COREAUDIO)
275   add_definitions(-DWITH_COREAUDIO)
276 endif()
278 if(WITH_LIBMV)
279   add_definitions(-DWITH_LIBMV)
280 endif()
282 if(WITH_PULSEAUDIO)
283   add_definitions(-DWITH_PULSEAUDIO)
284 endif()
286 if(WITH_WASAPI)
287   add_definitions(-DWITH_WASAPI)
288 endif()
290 if(WITH_MOD_OCEANSIM)
291   add_definitions(-DWITH_OCEANSIM)
292 endif()
294 if(WITH_MOD_REMESH)
295   add_definitions(-DWITH_MOD_REMESH)
296 endif()
298 if(WITH_MOD_FLUID)
299   add_definitions(-DWITH_FLUID)
300 endif()
302 if(WITH_OPENCOLLADA)
303   add_definitions(-DWITH_COLLADA)
304 endif()
306 if(WITH_IO_WAVEFRONT_OBJ)
307   add_definitions(-DWITH_IO_WAVEFRONT_OBJ)
308 endif()
310 if(WITH_IO_PLY)
311   add_definitions(-DWITH_IO_PLY)
312 endif()
314 if(WITH_IO_STL)
315   add_definitions(-DWITH_IO_STL)
316 endif()
318 if(WITH_IO_GREASE_PENCIL)
319   add_definitions(-DWITH_IO_GREASE_PENCIL)
320 endif()
322 if(WITH_ALEMBIC)
323   add_definitions(-DWITH_ALEMBIC)
324 endif()
326 if(WITH_OPENCOLORIO)
327   add_definitions(-DWITH_OCIO)
328 endif()
330 if(WITH_OPENVDB)
331   add_definitions(-DWITH_OPENVDB)
332   list(APPEND INC
333     ../../../../intern/openvdb
334   )
335 endif()
337 if(WITH_ALEMBIC)
338   add_definitions(-DWITH_ALEMBIC)
339   list(APPEND INC
340     ../../io/alembic
341   )
342 endif()
344 if(WITH_USD)
345   add_definitions(-DWITH_USD)
346   list(APPEND INC
347     ../../io/usd
348   )
349 endif()
351 if(WITH_OPENSUBDIV)
352   add_definitions(-DWITH_OPENSUBDIV)
353   list(APPEND INC
354     ../../../../intern/opensubdiv
355   )
356 endif()
358 if(WITH_XR_OPENXR)
359   add_definitions(-DWITH_XR_OPENXR)
360 endif()
362 if(WITH_POTRACE)
363   add_definitions(-DWITH_POTRACE)
364 endif()
366 if(WITH_PUGIXML)
367   add_definitions(-DWITH_PUGIXML)
368 endif()
370 if(WITH_HARU)
371   add_definitions(-DWITH_HARU)
372 endif()
374 if(WITH_HYDRA)
375   list(APPEND LIB
376     bf_render_hydra
377   )
378   add_definitions(-DWITH_HYDRA)
379 endif()
381 blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
383 # RNA_prototypes.hh
384 add_dependencies(bf_python bf_rna)