﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ADoc%2FIDE_Configuration%2FLinux_CMake_QtCreator</id>
	<title>Dev:Doc/IDE Configuration/Linux CMake QtCreator - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ADoc%2FIDE_Configuration%2FLinux_CMake_QtCreator"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/IDE_Configuration/Linux_CMake_QtCreator&amp;action=history"/>
	<updated>2026-05-14T23:16:31Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Doc/IDE_Configuration/Linux_CMake_QtCreator&amp;diff=97327&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/IDE_Configuration/Linux_CMake_QtCreator&amp;diff=97327&amp;oldid=prev"/>
		<updated>2018-06-28T19:37:10Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 19:37時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Doc/IDE_Configuration/Linux_CMake_QtCreator&amp;diff=97326&amp;oldid=prev</id>
		<title>2018年5月9日 (水) 07:38にwiki&gt;Geraldineによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/IDE_Configuration/Linux_CMake_QtCreator&amp;diff=97326&amp;oldid=prev"/>
		<updated>2018-05-09T07:38:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Optimized IDE Setup on Linux =&lt;br /&gt;
&lt;br /&gt;
Some of the steps in this guide are not immediately obvious even for experienced linux users/developers so I have written up this document for others who are interested in developing blender on linux.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Qtc_blender_25.png|640px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Who Is This For? ==&lt;br /&gt;
Linux developers who want to setup an efficient build environment.&lt;br /&gt;
&lt;br /&gt;
There are a number of aspects that help to achieve this:&lt;br /&gt;
* Using a minimal CMake  configuration.&lt;br /&gt;
* QtCreator has a fast C/C++ source code indexer (much faster than eclipse/netbeans/kdevelop)&lt;br /&gt;
* Avoid executing the install target (no copying files on rebuild), instead reference the files in-place to run blender.&lt;br /&gt;
&lt;br /&gt;
== Starting out ==&lt;br /&gt;
This document assumes you have built blender using the [[Dev:2.5/Doc/Building_Blender/Linux/Ubuntu/CMake|Linux/CMake Quickstart]].&lt;br /&gt;
&lt;br /&gt;
* blender source in '''~/blender-git/blender'''&lt;br /&gt;
* blender build in '''~/blender-git/build'''&lt;br /&gt;
&lt;br /&gt;
This was tested on Ubuntu but should work on any recent Linux distribution.&lt;br /&gt;
&lt;br /&gt;
== Installing QtCreator ==&lt;br /&gt;
QtCreator is an IDE which can be used for general C/C++ development, not just QT Applications, it has an editor, debugger, auto-completion as well as git and cmake integration.&lt;br /&gt;
&lt;br /&gt;
Download and install from QT's site: http://www.qt.io/download-open-source/#section-6&lt;br /&gt;
&lt;br /&gt;
Click 'View All Downloads', then scroll down to the Qt Creator standalone packages and download the most current package for your system.&lt;br /&gt;
&lt;br /&gt;
== Configure QtCreator ==&lt;br /&gt;
Launch QtCreator.&lt;br /&gt;
&lt;br /&gt;
Before loading a blender project make some minor changes to QtCreators defaults.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
Open the Options dialog '''Tools -&amp;gt; Options'''&lt;br /&gt;
&lt;br /&gt;
'''Build and Run'''&lt;br /&gt;
* Always build project before deploying it (disable)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instructions on configuring QtCreator for blenders style&lt;br /&gt;
&lt;br /&gt;
see: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle/Configuration#QtCreator&lt;br /&gt;
&lt;br /&gt;
== Making a new QtCreator Project ==&lt;br /&gt;
=== Create the Project ===&lt;br /&gt;
''Note, for now its recommended to use the custom project file generator included with blender until QtCreator's has support for reading CMakes defines &amp;amp; includes!''&lt;br /&gt;
==== Using Blenders Custom Project File Generator ====&lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
From your cmake dir run blenders project file generator.&lt;br /&gt;
''You may want to make some short cut to this - a shell script, bash alias or QtCreator external command all work fine.''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/blender-git/build&lt;br /&gt;
python3 ../blender/build_files/cmake/cmake_qtcreator_project.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From QtCreator go to File -&amp;gt; Open and select ~/blender-git/build/blender.creator&lt;br /&gt;
&lt;br /&gt;
{{NiceTip|Custom Project Names|If you want to use a custom name for the QtCreator project, you can use the '''--name''' or '''-n''' argument when calling the cmake_qtcreator_project.py script. This is useful if you want to manage multiple projects for multiple builds. The files created by this will then be called accordingly, e.g. some_name.creator instead of blender.creator}}&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Project =====&lt;br /&gt;
Now you should see the blender project open, start by pressing the build button({{Shortcut|ctrl|B}}), this should be very quick since blender has been built before.&lt;br /&gt;
&lt;br /&gt;
To run blender you'll need to point to the blender executable: Projects (side toolbar) -&amp;gt; Run Settings (Tab), then see the &amp;quot;Executable&amp;quot; field, browse for the executable.&lt;br /&gt;
&lt;br /&gt;
QtCreator stores its build directory in '''~/blender-git/blender/blender.creator.user''', if you have some configuration problem and wish to start over be sure to remove this file first.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using QtCreators CMake Project Support (deprecated for now) ====&lt;br /&gt;
{{Template:MoreDetails | + QtCreators CMake Project Support (deprecated) |&lt;br /&gt;
&lt;br /&gt;
* File -&amp;gt; Open File or Project, Select ~/blender-git/blender/CMakeLists.txt&lt;br /&gt;
&lt;br /&gt;
This invokes the '''CMake Wizard'''&lt;br /&gt;
* '''Build Location''' change the build directory to '''~/blender-git/build''' and press Next&lt;br /&gt;
* '''Run CMake''', Press the &amp;quot;Run CMake&amp;quot; button, then finish.&amp;lt;br&amp;gt;''note: this will use the configuration selected when first building blender from the command line.''&lt;br /&gt;
&lt;br /&gt;
===== Configuring the Project =====&lt;br /&gt;
Now you should see the blender project open, start by pressing the build button, this should be very quick since blender has been built before.&lt;br /&gt;
&lt;br /&gt;
To run blender you need to select the binary, on the left hand side there is a &amp;quot;Projects&amp;quot; section, Select '''Run Settings''',  Change the run configuration from makesdna to blender and press &amp;quot;Make blender Active&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
QtCreator stores its build directory in '''~/blender-git/blender/CMakeLists.txt.user''', if you have some configuration problem and wish to start over be sure to remove this file first.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To re-open the project after re-starting QtCreator, select this project from '''File -&amp;gt; Recent Projects'''&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
In '''~/blender-git/build/CMakeCache.txt''', change '''CMAKE_BUILD_TYPE''' from '''Release''' to '''Debug'''. This will create a debug executable instead the next time you build Blender.&lt;br /&gt;
&lt;br /&gt;
QtCreator requires an independent debugger program be installed on your system (e.g. GDB). If your distro does not automatically ship with one, you may need to manually install and set it up with QtCreator (see [https://doc.qt.io/qtcreator/creator-debugger-engines.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The video bellow 'Navigate Code / Tips' has [http://youtu.be/_kniMTbcCko?t=8m19s a part] on how to debug using QtCreator.&lt;br /&gt;
&lt;br /&gt;
== Using QtCreator for Python ==&lt;br /&gt;
This section is optional and unnecessary if you are only interested in editing the C/C++ code.&lt;br /&gt;
&lt;br /&gt;
The [[Dev:Doc/IDE_Configuration/Linux_CMake_QtCreator#Using_Blenders_Custom_Project_File_Generator | project generator]] also creates a project for python code.&lt;br /&gt;
Go to {{Menu|File|Open}} and select ''~/blender-git/build/blender.creator'' QtCreator supports having multiple projects open.&lt;br /&gt;
&lt;br /&gt;
== Git Integration ==&lt;br /&gt;
&lt;br /&gt;
While there is reasonably good git integration in QtCreator, if you're comfortable using the git command line, then you can keep doing so.&lt;br /&gt;
&lt;br /&gt;
* Blender can be updated from git within QtCreator&amp;lt;br&amp;gt;'''Tools -&amp;gt; Git -&amp;gt; Remote Repository -&amp;gt; Pull&amp;quot;'''&lt;br /&gt;
* QtCreator's '''git blame''' integration is quite good, so you can see who last edited each line of a source-file.&lt;br /&gt;
&lt;br /&gt;
== QtCreator Videos ==&lt;br /&gt;
* [http://www.youtube.com/watch?v=5Ymoav0nNWQ&amp;amp;feature Navigate Code + Simple Fix]&lt;br /&gt;
* [http://www.youtube.com/watch?v=_kniMTbcCko Navigate Code / Tips]&lt;br /&gt;
Here are the [http://wiki.blender.org/index.php/User:Ideasman42#crep crep] and [http://wiki.blender.org/index.php/User:Ideasman42#prep prep] tools mentioned in the videos.&lt;br /&gt;
&lt;br /&gt;
== Trouble Shooting ==&lt;br /&gt;
=== Ubuntu / Ptrace Error ===&lt;br /&gt;
&lt;br /&gt;
On ubuntu there is a reported error running a debug binary within QtCreator.&lt;br /&gt;
&lt;br /&gt;
Ptrace is 'process trance'.  By using ptrace one process can control another, enabling the controller to inspect and manipulate the internal state of its target.  Potentially a security problem, which is why this is switched on.  There are therefore two solutions, open ptrace up permanently or temporarily.&lt;br /&gt;
&lt;br /&gt;
Temporary solution is:&lt;br /&gt;
&lt;br /&gt;
 echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope&lt;br /&gt;
&lt;br /&gt;
After reboot the ptrace will be active again so you may want to add this to a script file and run when using Qt Creator.&lt;br /&gt;
&lt;br /&gt;
Permanent solution is:&lt;br /&gt;
&lt;br /&gt;
1: Set 'ptrace_scope' to 0 in /etc/sysctl.d/10-ptrace.conf &lt;br /&gt;
2: Restart the service using sudo sysctl -p&lt;br /&gt;
&lt;br /&gt;
=== Build button disabled in QtCreator ===&lt;br /&gt;
If the build button is disabled in QtCreator, it probably means there are no kits defined. Go to '''Tools -&amp;gt; Options''' then '''Build &amp;amp; Run -&amp;gt; Kits''' to add a kit for Desktop QT with GCC.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
Comparison [http://lists.blender.org/pipermail/bf-committers/2010-May/027444.html QtCreator/KDevelop4] by Xat&lt;/div&gt;</summary>
		<author><name>wiki&gt;Geraldine</name></author>
		
	</entry>
</feed>