Blender source memo

1
2
3
4
5
6
7
8
9
10
#blender\source\blender\editors
ED_region_do_draw editors\screen\area.c
	outliner_main_region_draw editors\space_outliner\space_outliner.cc
		draw_outliner editors\space_outliner\outliner_draw.cc
			outliner_buttons
				UI_but_active_only editors\interface\interface.cc
					UI_but_active_only_ex
						ui_but_activate_event editors\interface\interface_handlers.c
							ui_do_button
								ui_do_but_TEX

Navigate to source location by writing code

UE4 has a functionality of "Goto Definition",

1
FSourceCodeNavigationImpl::NavigateToFunctionSource

which uses two apis from dbghelp.dll,

1
2
SymGetSymFromName64
SymGetLineFromAddr64

Source and destination

Colored item indicates destination.

param 1 param 2
Tell him(indirect object) the truth(direct object)
Replace rice with noodles
Prefer coffee to tea
substitute dest for src
substitute src with dest
grep word file
find directory -name "*key*"
cp src dest
ln src link
chown owner file
strcpy dest src
#define macro expression
typedef source type
mklink link src

Build qt source in Fedora35

Extract qt-everywhere-src-6.2.2.zip to directory named qt,

sudo dnf install libxcb libxcb-devel xcb-util xcb-util-devel xcb-util-*-devel libX11-devel libXrender-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel libdrm-devel libXcursor-devel libXcomposite-devel

cd qt
mkdir bld
cd bld
cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/installed -DCMAKE_BUILD_TYPE="Debug" ..
cmake --build . --parallel
cmake --install . --prefix=`pwd`/installed

Can't locate English.pm in @INC

sudo dnf install perl-English

This application failed to start because no Qt platform plugin could be init...

If "xcb" things missing, we should "dnf install libxcb..." like above, and an annoying step we can't image is after we install required packages, we must delete CMakeCache.txt first and then to invoke cmake, if not, some modules like xcb-sm are always displayed not to be built.

Feature accessibility_atspi_bridge is already defined to be "OFF" and should now be set to "ON" when importing features from Qt6::Gui.

We only need to not let the message interrupt building progress,

/mnt/SDC2/qt/bld/installed/lib/cmake/Qt6/QtFeature.cmake:1136

	message(STATUS "Feature ${feature} is already defined to be \"${QT_FEATURE_${feature}}\" and should now be set to \"${value}\" when importing features from ${target}.")

refer to:
https://download.qt.io/official_releases/qtcreator/6.0/6.0.1/qt-creator-opensource-linux-x86_64-6.0.1.run
https://wiki.qt.io/Building_Qt_5_from_Git#Linux.2FX11
https://forum.qt.io/topic/121386/built-qt6-from-sources-problem-with-xcb-plugin/15
https://forum.qt.io/topic/128887/build-qt6-from-source-xcb-issue/3
https://forum.qt.io/topic/92834/configure-errors-disabling-x11-accessibility-bridge-d-bus-or-at-spi-is-missing/7

Debug ue4 in Fedora35

After running Setup.sh and GenerateProjectFiles.sh, we found UE4.pro created. It's like a fresh breeze coming from the roof window, we are free now, no more need to fear the once unbearable torment in Visual Studio IDE.

Qt source is not necessary to ue4, qtcreator is only a visual debugger to ue4.

Build Steps:

1
make UE4Editor-Linux-Debug ShaderCompileWorker-Linux-Debug -j8

Clean Steps:

1
make UE4Editor-Linux-Debug ShaderCompileWorker-Linux-Debug ARGS=-clean -j8

refer to:
https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Linux/BeginnerLinuxDeveloper/SettingUpQtCreator/

build qt source in vs2022 win11

Don't download qt source in tar.xz format, for in Windows, if we unzip it using 7zip, some deep file paths may be truncated, for example, ECMFindModuleHelpersStub.cmake referred by FindEGL.cmake in qtbase\cmake\3rdparty\extra-cmake-modules\find-modules.

This time I download qt-everywhere-src-6.2.2.zip.

In preparation, as to README.md, ActivePerl must be installed, it sucks, we must have an account of it. However, we can find another perl alternative, Strawberry Perl portable edition.

When we build, qt source root path should be short enough like d:\qt.

bld.bat

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
set curpath=%CD%
set vspath=D:\cext\Program Files\Microsoft Visual Studio\2022\Enterprise
set perlpath=D:\work\open\strawberry-perl-5.32.1.1\perl\bin
set clangpath=D:\work\open\libclang
set installpath=D:\cext\Qt
 
call "%vspath%\VC\Auxiliary\Build\vcvars64.bat"
 
set oldpath=%path%
set path=%path%;%perlpath%
 
if not exist %curpath%\bld @mkdir %curpath%\bld
 
cd %curpath%\bld
 
cmake.exe ^
	-G "Ninja" ^
	-DCMAKE_INSTALL_PREFIX:PATH=%curpath%\bld ^
	-DCMAKE_BUILD_TYPE="Debug" ^
	-DFEATURE_clang="ON" ^
	-DCMAKE_PREFIX_PATH="%clangpath%" ^
	-DCMAKE_MAKE_PROGRAM="%vspath%\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" ..
 
cmake --build . --parallel
rem cmake --install . --prefix %installpath%
 
if 0 == 1 (
	rem if we build QtDoc, we must add clang path to system path, otherwise we will get exit code 0xc0000135.
	set path=%path%;%clangpath%\bin
	cmake --build . --target docs
)
 
set path=%oldpath%
cd ..

Modify paths at the beginning of above bld.bat and put the batch file in the qt source root directory, then execute it.

ps1: all in one release of qt is like below url, but we should know all in one is not available since Qt 5.15.
http://download.qt.io/archive/qt/5.9/5.9.2/qt-opensource-linux-x64-5.9.2.run
And we need download online installer for Qt above 5.15 if we don't want to build from scratch:
https://download.qt.io/official_releases/online_installers/

Refer to:
https://ninja-build.org/
https://strawberryperl.com/releases.html
https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-windows-x86_64.msi

https://download.qt.io/development_releases/prebuilt/libclang/
https://download.qt.io/archive/qt/6.2/6.2.2/single/qt-everywhere-src-6.2.2.zip
https://download.qt.io/official_releases/qtcreator/6.0/6.0.1/qt-creator-opensource-windows-x86_64-6.0.1.exe

https://stackoverflow.com/questions/14807294/how-to-install-cmake-c-compiler-and-cxx-compiler
https://www.cnblogs.com/gearslogy/p/7435202.html

apt testing source

/etc/apt/sources.list

1
2
3
4
deb http://http.us.debian.org/debian/ testing non-free contrib main
#deb http://http.us.debian.org/debian/ stable non-free contrib main
#deb http://http.us.debian.org/debian/ unstable non-free contrib main
#deb http://http.us.debian.org/debian/ wheezy non-free contrib main
1
2
#apt edit-sources
apt update

NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138

1
2
apt-key adv --keyserver keyserver.ubuntu.com --recv 04EE7237B7D453EC
apt-key adv --keyserver keyserver.ubuntu.com --recv 648ACFD622F3D138

ubuntu repo names

1
2
3
wheezy: debian 7.0
xenial: Ubuntu 16.04
focal: Ubuntu 20.04

refer to:
https://serverfault.com/questions/550855/how-to-add-debian-testing-repository-to-apt-get
https://yunwei365.blog.csdn.net/article/details/114930145