tornavis/source/blender/windowmanager/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

222 lines
4.2 KiB
CMake
Raw Normal View History

# SPDX-FileCopyrightText: 2006 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
2008-01-03 23:20:45 +01:00
set(INC
.
gizmo
gizmo/intern
../asset_system
../blenkernel
../blenloader
../blentranslation
../compositor
../editors/include
../draw
../gpu
../imbuf
../makesrna
../nodes
../render
../sequencer
../../../intern/memutil
../bmesh
# RNA_prototypes.h
${CMAKE_BINARY_DIR}/source/blender/makesrna
)
2023-07-29 05:47:57 +02:00
set(INC_SYS
)
set(SRC
intern/wm.cc
intern/wm_cursors.cc
2022-07-27 06:12:06 +02:00
intern/wm_dragdrop.cc
intern/wm_draw.cc
intern/wm_event_query.cc
intern/wm_event_system.cc
intern/wm_files.cc
intern/wm_files_link.cc
intern/wm_gesture.cc
intern/wm_gesture_ops.cc
intern/wm_init_exit.cc
intern/wm_jobs.cc
intern/wm_keymap.cc
intern/wm_keymap_utils.cc
intern/wm_menu_type.cc
intern/wm_operator_props.cc
intern/wm_operator_type.cc
intern/wm_operator_utils.cc
intern/wm_operators.cc
intern/wm_panel_type.cc
intern/wm_platform_support.cc
intern/wm_playanim.cc
intern/wm_splash_screen.cc
intern/wm_stereo.cc
intern/wm_subwindow.cc
intern/wm_surface.cc
intern/wm_toolsystem.cc
intern/wm_tooltip.cc
intern/wm_uilist_type.cc
intern/wm_utils.cc
intern/wm_window.cc
gizmo/intern/wm_gizmo.cc
gizmo/intern/wm_gizmo_group.cc
gizmo/intern/wm_gizmo_group_type.cc
gizmo/intern/wm_gizmo_map.cc
gizmo/intern/wm_gizmo_target_props.cc
gizmo/intern/wm_gizmo_type.cc
message_bus/intern/wm_message_bus.cc
message_bus/intern/wm_message_bus_rna.cc
message_bus/intern/wm_message_bus_static.cc
WM_api.hh
WM_keymap.hh
WM_message.hh
WM_toolsystem.hh
WM_types.hh
wm.hh
wm_cursors.hh
wm_draw.hh
wm_event_system.hh
wm_event_types.hh
wm_files.hh
wm_surface.hh
wm_window.hh
intern/wm_platform_support.hh
intern/wm_window_private.hh
gizmo/WM_gizmo_api.hh
gizmo/WM_gizmo_types.hh
gizmo/wm_gizmo_fn.hh
gizmo/wm_gizmo_wmapi.hh
gizmo/intern/wm_gizmo_intern.hh
message_bus/intern/wm_message_bus_intern.hh
message_bus/wm_message_bus.hh
)
set(LIB
PRIVATE bf::blenfont
PRIVATE bf::blenlib
PRIVATE bf::depsgraph
Cleanup: CMake: Modernize bf_dna dependencies There's quite a few libraries that depend on dna_type_offsets.h but had gotten to it by just adding the folder that contains it to their includes INC section without declaring a dependency to bf_dna in the LIB section. which occasionally lead to the lib building before bf_dna and the header being missing, while this generally gets fixed in CMake by adding bf_dna to the LIB section of the lib, however until last week all libraries in the LIB section were linked as INTERFACE so adding it in there did not resolve the build issue. To make things still build, we sprinkled add_dependencies wherever we needed it to force a build order. This diff : Declares public include folders for the bf_dna target so there's no more fudging the INC section required to get to them. Removes all dna related paths from the INC section for all libraries. Adds an alias target bf:dna to signify it has been updated to modern cmake Declares a dependency on bf::dna for all libraries that require it Removes (almost) all calls to add_dependencies for bf_dna Future work: Because of the manual dependency management that was done, there is now some "clutter" with libs depending on bf_dna that realistically don't. Example bf_intern_opencolorio itself has no dependency on bf_dna at all, doesn't need it, doesn't use it. However the dna include folder had been added to it in the past since bf_blenlib uses dna headers in some of its public headers and bf_intern_opencolorio does use those blenlib headers. Given bf_blenlib now correctly declares the dependency on bf_dna as public bf_intern_opencolorio will get the dna header directory automatically from CMake, hence some cleanup could be done for bf_intern_opencolorio Because 99% of the changes in this diff have been automated, this diff does not seek to address these issues as there is no easy way to determine why a certain dependency is in place. A developer will have to make a pass a this at some later point in time. As I'd rather not mix automated and manual labour. There are a few libraries that could not be automatically processed (ie bf_blendthumb) that also will need this manual look-over. Pull Request: https://projects.blender.org/blender/blender/pulls/109835
2023-07-10 15:07:37 +02:00
PRIVATE bf::dna
bf_editor_screen
PRIVATE bf::extern::fmtlib
PRIVATE bf::intern::clog
PRIVATE bf::intern::guardedalloc
PRIVATE bf::animrig
bf_sequencer
bf_intern_ghost
)
if(WIN32)
add_definitions(-DNOMINMAX)
endif()
if(WITH_AUDASPACE)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
if(WITH_SYSTEM_AUDASPACE)
list(APPEND LIB
${AUDASPACE_C_LIBRARIES}
${AUDASPACE_PY_LIBRARIES}
)
endif()
add_definitions(-DWITH_AUDASPACE)
endif()
if(WITH_CYCLES)
add_definitions(-DWITH_CYCLES)
endif()
if(WITH_OPENGL_BACKEND)
add_definitions(-DWITH_OPENGL_BACKEND)
endif()
if(WITH_VULKAN_BACKEND)
add_definitions(-DWITH_VULKAN_BACKEND)
endif()
Merge of the COLLADA GSoC branch into trunk. COLLADA code is disabled by default (it has dependencies requiring manual install). SCons and CMake builds are supported on Windows and Linux, no Mac building yet. More on building COLLADA code: http://wiki.blender.org/index.php/User:Kazanbas/Building_Collada_Branch. The detailed command log of the merge (can be useful for educational purposes): branch=https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-chingachgook # collada code svn copy $branch/source/blender/collada source/blender/collada # operator svn merge -c 20401,20955,21077,24077,24079 $branch/source/blender/windowmanager/intern/wm_operators.c source/blender/windowmanager/intern/wm_operators.c # menu svn merge -c 24079 $branch/release/scripts/ui/space_info.py release/scripts/ui/space_info.py # scons svn merge -c 20398 $branch/source/blender/SConscript source/blender/SConscript svn merge -c 20398,20691,20955,22726 $branch/tools/btools.py tools/btools.py svn merge -c 20691,20955,22726 $branch/tools/Blender.py tools/Blender.py svn merge -c 20398,20692,20955 $branch/config/linux2-config.py config/linux2-config.py svn merge -c 22726 $branch/config/win64-vc-config.py config/win64-vc-config.py svn merge -c 22726 $branch/config/win32-vc-config.py config/win32-vc-config.py svn merge -c 24077 $branch/source/blender/windowmanager/SConscript source/blender/windowmanager/SConscript # cmake svn merge -c 23319,23905,24077,24158 $branch/CMakeLists.txt CMakeLists.txt svn merge -c 23319 $branch/source/blender/CMakeLists.txt source/blender/CMakeLists.txt svn merge -c 23319 $branch/source/creator/CMakeLists.txt source/creator/CMakeLists.txt svn merge -c 23319 $branch/CMake/macros.cmake CMake/macros.cmake svn merge -c 24077 $branch/source/blender/windowmanager/CMakeLists.txt source/blender/windowmanager/CMakeLists.txt
2009-10-30 16:35:50 +01:00
if(WITH_OPENCOLLADA)
add_definitions(-DWITH_COLLADA)
endif()
if(WITH_CODEC_FFMPEG)
list(APPEND INC_SYS
${FFMPEG_INCLUDE_DIRS}
)
CMake: Refactor external dependencies handling This is a more correct fix to the issue Brecht was fixing in D6600. While the fix in that patch worked fine for linking it broke ASAN runtime under some circumstances. For example, `make full debug developer` would compile, but trying to start blender will cause assert failure in ASAN (related on check that ASAN is not running already). Top-level idea: leave it to CMake to keep track of dependency graph. The root of the issue comes to the fact that target like "blender" is configured to use a lot of static libraries coming from Blender sources and to use external static libraries. There is nothing which ensures order between blender's and external libraries. Only order of blender libraries is guaranteed. It was possible that due to a cycle or other circumstances some of blender libraries would have been passed to linker after libraries it uses, causing linker errors. For example, this order will likely fail: libbf_blenfont.a libfreetype6.a libbf_blenfont.a This change makes it so blender libraries are explicitly provided their dependencies to an external libraries, which allows CMake to ensure they are always linked against them. General rule here: if bf_foo depends on an external library it is to be provided to LIBS for bf_foo. For example, if bf_blenkernel depends on opensubdiv then LIBS in blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES. The change is made based on searching for used include folders such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries to LIBS ion that CMakeLists.txt. Transitive dependencies are not simplified by this approach, but I am not aware of any downside of this: CMake should be smart enough to simplify them on its side. And even if not, this shouldn't affect linking time. Benefit of not relying on transitive dependencies is that build system is more robust towards future changes. For example, if bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES and all such code is moved to bf_blenkernel this will not break linking. The not-so-trivial part is change to blender_add_lib (and its version in Cycles). The complexity is caused by libraries being provided as a single list argument which doesn't allow to use different release and debug libraries on Windows. The idea is: - Have every library prefixed as "optimized" or "debug" if separation is needed (non-prefixed libraries will be considered "generic"). - Loop through libraries passed to function and do simple parsing which will look for "optimized" and "debug" words and specify following library to corresponding category. This isn't something particularly great. Alternative would be to use target_link_libraries() directly, which sounds like more code but which is more explicit and allows to have more flexibility and control comparing to wrapper approach. Tested the following configurations on Linux, macOS and Windows: - make full debug developer - make full release developer - make lite debug developer - make lite release developer NOTE: Linux libraries needs to be compiled with D6641 applied, otherwise, depending on configuration, it's possible to run into duplicated zlib symbols error. Differential Revision: https://developer.blender.org/D6642
2020-01-20 18:36:19 +01:00
list(APPEND LIB
${FFMPEG_LIBRARIES}
)
2008-01-03 23:20:45 +01:00
add_definitions(-DWITH_FFMPEG)
endif()
2008-01-03 23:20:45 +01:00
2011-11-28 08:02:38 +01:00
if(WITH_HEADLESS)
add_definitions(-DWITH_HEADLESS)
elseif(WITH_GHOST_X11)
add_definitions(-DWITH_GHOST_X11)
2011-11-28 08:02:38 +01:00
endif()
2008-12-31 06:20:35 +01:00
if(WITH_PYTHON)
list(APPEND INC
../python
)
add_definitions(-DWITH_PYTHON)
if(WITH_PYTHON_MODULE)
add_definitions(-DWITH_PYTHON_MODULE)
endif()
2008-12-31 06:20:35 +01:00
endif()
if(WITH_BUILDINFO)
add_definitions(-DWITH_BUILDINFO)
endif()
2008-01-03 23:20:45 +01:00
if(WITH_INPUT_NDOF)
add_definitions(-DWITH_INPUT_NDOF)
endif()
if(WITH_INPUT_IME)
add_definitions(-DWITH_INPUT_IME)
endif()
if(WITH_COMPOSITOR_CPU)
list(APPEND LIB
bf_compositor
)
add_definitions(-DWITH_COMPOSITOR_CPU)
endif()
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection NOTE: While most of the milestone 1 goals are there, a few smaller features and improvements are still to be done. Big picture of this milestone: Initial, OpenXR-based virtual reality support for users and foundation for advanced use cases. Maniphest Task: https://developer.blender.org/T71347 The tasks contains more information about this milestone. To be clear: This is not a feature rich VR implementation, it's focused on the initial scene inspection use case. We intentionally focused on that, further features like controller support are part of the next milestone. - How to use? Instructions on how to use this are here: https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test These will be updated and moved to a more official place (likely the manual) soon. Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC headsets don't support the OpenXR standard yet and hence, do not work with this implementation. --------------- This is the C-side implementation of the features added for initial VR support as per milestone 1. A "VR Scene Inspection" Add-on will be committed separately, to expose the VR functionality in the UI. It also adds some further features for milestone 1, namely a landmarking system (stored view locations in the VR space) Main additions/features: * Support for rendering viewports to an HMD, with good performance. * Option to sync the VR view perspective with a fully interactive, regular 3D View (VR-Mirror). * Option to disable positional tracking. Keeps the current position (calculated based on the VR eye center pose) when enabled while a VR session is running. * Some regular viewport settings for the VR view * RNA/Python-API to query and set VR session state information. * WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data * wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU context) * DNA/RNA for management of VR session settings * `--debug-xr` and `--debug-xr-time` commandline options * Utility batch & config file for using the Oculus runtime on Windows. * Most VR data is runtime only. The exception is user settings which are saved to files (`XrSessionSettings`). * VR support can be disabled through the `WITH_XR_OPENXR` compiler flag. For architecture and code documentation, see https://wiki.blender.org/wiki/Source/Interface/XR. --------------- A few thank you's: * A huge shoutout to Ray Molenkamp for his help during the project - it would have not been that successful without him! * Sebastian Koenig and Simeon Conzendorf for testing and feedback! * The reviewers, especially Brecht Van Lommel! * Dalai Felinto for pushing and managing me to get this done ;) * The OpenXR working group for providing an open standard. I think we're the first bigger application to adopt OpenXR. Congratulations to them and ourselves :) This project started as a Google Summer of Code 2019 project - "Core Support of Virtual Reality Headsets through OpenXR" (see https://wiki.blender.org/wiki/User:Severin/GSoC-2019/). Some further information, including ideas for further improvements can be found in the final GSoC report: https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report Differential Revisions: D6193, D7098 Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
if(WITH_XR_OPENXR)
add_definitions(-DWITH_XR_OPENXR)
list(APPEND INC
xr
)
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection NOTE: While most of the milestone 1 goals are there, a few smaller features and improvements are still to be done. Big picture of this milestone: Initial, OpenXR-based virtual reality support for users and foundation for advanced use cases. Maniphest Task: https://developer.blender.org/T71347 The tasks contains more information about this milestone. To be clear: This is not a feature rich VR implementation, it's focused on the initial scene inspection use case. We intentionally focused on that, further features like controller support are part of the next milestone. - How to use? Instructions on how to use this are here: https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test These will be updated and moved to a more official place (likely the manual) soon. Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC headsets don't support the OpenXR standard yet and hence, do not work with this implementation. --------------- This is the C-side implementation of the features added for initial VR support as per milestone 1. A "VR Scene Inspection" Add-on will be committed separately, to expose the VR functionality in the UI. It also adds some further features for milestone 1, namely a landmarking system (stored view locations in the VR space) Main additions/features: * Support for rendering viewports to an HMD, with good performance. * Option to sync the VR view perspective with a fully interactive, regular 3D View (VR-Mirror). * Option to disable positional tracking. Keeps the current position (calculated based on the VR eye center pose) when enabled while a VR session is running. * Some regular viewport settings for the VR view * RNA/Python-API to query and set VR session state information. * WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data * wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU context) * DNA/RNA for management of VR session settings * `--debug-xr` and `--debug-xr-time` commandline options * Utility batch & config file for using the Oculus runtime on Windows. * Most VR data is runtime only. The exception is user settings which are saved to files (`XrSessionSettings`). * VR support can be disabled through the `WITH_XR_OPENXR` compiler flag. For architecture and code documentation, see https://wiki.blender.org/wiki/Source/Interface/XR. --------------- A few thank you's: * A huge shoutout to Ray Molenkamp for his help during the project - it would have not been that successful without him! * Sebastian Koenig and Simeon Conzendorf for testing and feedback! * The reviewers, especially Brecht Van Lommel! * Dalai Felinto for pushing and managing me to get this done ;) * The OpenXR working group for providing an open standard. I think we're the first bigger application to adopt OpenXR. Congratulations to them and ourselves :) This project started as a Google Summer of Code 2019 project - "Core Support of Virtual Reality Headsets through OpenXR" (see https://wiki.blender.org/wiki/User:Severin/GSoC-2019/). Some further information, including ideas for further improvements can be found in the final GSoC report: https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report Differential Revisions: D6193, D7098 Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
list(APPEND SRC
xr/intern/wm_xr.cc
xr/intern/wm_xr_action.cc
xr/intern/wm_xr_actionmap.cc
xr/intern/wm_xr_draw.cc
xr/intern/wm_xr_operators.cc
xr/intern/wm_xr_session.cc
xr/wm_xr.hh
xr/intern/wm_xr_intern.hh
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection NOTE: While most of the milestone 1 goals are there, a few smaller features and improvements are still to be done. Big picture of this milestone: Initial, OpenXR-based virtual reality support for users and foundation for advanced use cases. Maniphest Task: https://developer.blender.org/T71347 The tasks contains more information about this milestone. To be clear: This is not a feature rich VR implementation, it's focused on the initial scene inspection use case. We intentionally focused on that, further features like controller support are part of the next milestone. - How to use? Instructions on how to use this are here: https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test These will be updated and moved to a more official place (likely the manual) soon. Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC headsets don't support the OpenXR standard yet and hence, do not work with this implementation. --------------- This is the C-side implementation of the features added for initial VR support as per milestone 1. A "VR Scene Inspection" Add-on will be committed separately, to expose the VR functionality in the UI. It also adds some further features for milestone 1, namely a landmarking system (stored view locations in the VR space) Main additions/features: * Support for rendering viewports to an HMD, with good performance. * Option to sync the VR view perspective with a fully interactive, regular 3D View (VR-Mirror). * Option to disable positional tracking. Keeps the current position (calculated based on the VR eye center pose) when enabled while a VR session is running. * Some regular viewport settings for the VR view * RNA/Python-API to query and set VR session state information. * WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data * wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU context) * DNA/RNA for management of VR session settings * `--debug-xr` and `--debug-xr-time` commandline options * Utility batch & config file for using the Oculus runtime on Windows. * Most VR data is runtime only. The exception is user settings which are saved to files (`XrSessionSettings`). * VR support can be disabled through the `WITH_XR_OPENXR` compiler flag. For architecture and code documentation, see https://wiki.blender.org/wiki/Source/Interface/XR. --------------- A few thank you's: * A huge shoutout to Ray Molenkamp for his help during the project - it would have not been that successful without him! * Sebastian Koenig and Simeon Conzendorf for testing and feedback! * The reviewers, especially Brecht Van Lommel! * Dalai Felinto for pushing and managing me to get this done ;) * The OpenXR working group for providing an open standard. I think we're the first bigger application to adopt OpenXR. Congratulations to them and ourselves :) This project started as a Google Summer of Code 2019 project - "Core Support of Virtual Reality Headsets through OpenXR" (see https://wiki.blender.org/wiki/User:Severin/GSoC-2019/). Some further information, including ideas for further improvements can be found in the final GSoC report: https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report Differential Revisions: D6193, D7098 Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
)
endif()
blender_add_lib_nolist(bf_windowmanager "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
# RNA_prototypes.h
add_dependencies(bf_windowmanager bf_rna)
if(WITH_GTESTS)
set(TEST_INC
)
set(TEST_SRC
intern/wm_dragdrop_test.cc
)
blender_add_test_suite_lib(windowmanager "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB}")
endif()