﻿<?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%2FBuilding_Blender%2FLinux%2Fcmake</id>
	<title>Dev:Doc/Building Blender/Linux/cmake - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ADoc%2FBuilding_Blender%2FLinux%2Fcmake"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Building_Blender/Linux/cmake&amp;action=history"/>
	<updated>2026-06-08T21:28:57Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Doc/Building_Blender/Linux/cmake&amp;diff=94211&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Building_Blender/Linux/cmake&amp;diff=94211&amp;oldid=prev"/>
		<updated>2018-06-28T18:45:56Z</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日 (木) 18:45時点における版&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/Building_Blender/Linux/cmake&amp;diff=94210&amp;oldid=prev</id>
		<title>2016年1月4日 (月) 10:06にwiki&gt;Ideasman42による</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Building_Blender/Linux/cmake&amp;diff=94210&amp;oldid=prev"/>
		<updated>2016-01-04T10:06:27Z</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;= 3. Compile Blender with CMake =&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
             WARNING FOR EDITORS&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
This page has a conditional rule in it to distinguish Ubuntu/Fedora (and later maybe other distros.&lt;br /&gt;
&lt;br /&gt;
This has been done because the previous situation was messy because we had commands for fedora, ubuntu and generic distro all in one page.&lt;br /&gt;
&lt;br /&gt;
To edit this page watch at the #switch: statements and place your edit under the right condition.&lt;br /&gt;
&lt;br /&gt;
Thanks!&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Installing CMake ==&lt;br /&gt;
&lt;br /&gt;
Install CMake from your package manager.&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
&lt;br /&gt;
for editors: if you know of another distro with different install command, please add a |&amp;lt;page&amp;gt;=&amp;lt;command&amp;gt; to the switch below&lt;br /&gt;
&lt;br /&gt;
 --&amp;gt;&lt;br /&gt;
{{#switch:{{FULLPAGENAME}}&lt;br /&gt;
|Dev:Doc/Building Blender/Linux/Ubuntu/CMake=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo apt-get install cmake cmake-curses-gui&amp;lt;/source&amp;gt;&lt;br /&gt;
|Dev:Doc/Building Blender/Linux/Fedora 12/Cmake=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;su -c 'yum install cmake cmake-curses-gui'&amp;lt;/source&amp;gt;&lt;br /&gt;
|Dev:Doc/Building Blender/Linux/Gentoo/CMake=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo emerge dev-util/cmake&amp;lt;/source&amp;gt;&lt;br /&gt;
|Dev:Doc/Building Blender/Linux/Arch/CMake=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;pacman -S cmake&amp;lt;/source&amp;gt;&lt;br /&gt;
|}}&lt;br /&gt;
&lt;br /&gt;
== Automatic CMake Setup ==&lt;br /&gt;
If you're not interested in manually setting up CMake build directory, configuring, building and installing in separate steps, we provide a convenience makefile in Blender's source directory which sets up CMake for you.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/blender-git/blender&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the build finishes you'll get a message like..&lt;br /&gt;
 Blender successfully built, run from: /home/me/blender-git/build_linux/bin/blender&lt;br /&gt;
&lt;br /&gt;
Updating your local checkout and rebuilding is as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/blender-git/blender&lt;br /&gt;
make update&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are some pre-defined build targets:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;&amp;lt;b&amp;gt;make&amp;lt;/b&amp;gt;&amp;lt;/tt&amp;gt; - some are turned off by default because they can be difficult to correctly configure for newer developers and aren't essential to use &amp;amp; develop Blender in most cases.&lt;br /&gt;
* &amp;lt;tt&amp;gt;&amp;lt;b&amp;gt;make lite&amp;lt;/b&amp;gt;&amp;lt;/tt&amp;gt; - the quickest way to get a Blender build up &amp;amp; running, can also help to avoid installing a lot of dependencies if you don't need video-codecs, physics-sim &amp;amp; cycles rendering.&lt;br /&gt;
* &amp;lt;tt&amp;gt;&amp;lt;b&amp;gt;make full&amp;lt;/b&amp;gt;&amp;lt;/tt&amp;gt; - this makes a complete build with all options enabled, matching the releases on '''blender.org'''.&lt;br /&gt;
&lt;br /&gt;
For a full list of the optional targets type...&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
make help&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual CMake Setup ==&lt;br /&gt;
{{Template:MoreDetails | + Manual CMake Setup (optional) |&lt;br /&gt;
If you want to have more control over your build configuration or have multiple build directories for a single source directory.&lt;br /&gt;
You can follow these steps.&lt;br /&gt;
&lt;br /&gt;
''Typically useful for developers, who built frequently.''&lt;br /&gt;
&lt;br /&gt;
=== Preparing CMake's directory ===&lt;br /&gt;
&lt;br /&gt;
Now you have to choose a location for CMake build files, currently '''in-source builds in Blender aren't supported'''.&lt;br /&gt;
&lt;br /&gt;
''' Out-of-source build '''&lt;br /&gt;
&lt;br /&gt;
By doing an [http://www.cmake.org/Wiki/CMake_FAQ#What_is_an_.22out-of-source.22_build.3F &amp;quot;out-of-source&amp;quot; build] you create a CMake's directory aside from &amp;lt;code&amp;gt;~/blender-git/blender&amp;lt;/code&amp;gt;, for example &amp;lt;code&amp;gt;~/blender-git/build&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ~/blender-git/build&lt;br /&gt;
cd ~/blender-git/build&lt;br /&gt;
cmake ../blender&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will generate makefiles in the build directory (&amp;lt;code&amp;gt;~/blender-git/build&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
{{Note|Warning|{{Warning/Important}}As said above, ''in-source-builds'' where you build blender from the source code directory are not supported.&amp;lt;br&amp;gt;&lt;br /&gt;
If CMake finds a &amp;lt;code&amp;gt;CMakeCache.txt&amp;lt;/code&amp;gt; in the source code directory, it uses that instead of using &amp;lt;code&amp;gt;~/blender-git/build/CMakeCache.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you have tried to do an in-source build, you should remove any CMakeCache.txt from the source code directory before actually running the out-of-source build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rm ~/blender-git/blender/CMakeCache.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Editing CMake Parameters ===&lt;br /&gt;
&lt;br /&gt;
''Note that CMake should detect correct parameters so you shouldn't need change defaults to simply to compile blender, this is only if you want to change defaults, make a debug build, disable features etc,&amp;lt;br&amp;gt;so you may want to skip this section for now and come back to it later if you want to make adjustments.''&lt;br /&gt;
&lt;br /&gt;
You can modify the build parameters in different ways:&lt;br /&gt;
&lt;br /&gt;
* editing &amp;lt;code&amp;gt;~/blender-git/build/CMakeCache.txt&amp;lt;/code&amp;gt; file in a text editor&lt;br /&gt;
* using '''cmake-gui''' if your distro supports it&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;cmake-gui ../blender&amp;lt;/source&amp;gt;&lt;br /&gt;
: Opens a graphical interface where you can easily change parameters and re-configure things.&lt;br /&gt;
* using '''ccmake''' tool, with&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;ccmake ../blender&amp;lt;/source&amp;gt;&lt;br /&gt;
: Opens a text interface where you can easily change parameters and re-configure things.&lt;br /&gt;
* cmake parameters can also be easily set on the command line, for eg.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cmake ../blender \&lt;br /&gt;
    -DCMAKE_INSTALL_PREFIX=/opt/blender \&lt;br /&gt;
    -DWITH_INSTALL_PORTABLE=OFF \&lt;br /&gt;
    -DWITH_BUILDINFO=OFF \&lt;br /&gt;
    -DWITH_GAMEENGINE=OFF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: These commands are exactly those found in &amp;lt;code&amp;gt;~/blender-git/build/CMakeCache.txt&amp;lt;/code&amp;gt; so you can copy commands from there and use them in the command line without running ccmake.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Cmake-gui.jpg|thumb|300px|left|Screenshot from cmake-gui, qt based gui for cmake]]&lt;br /&gt;
[[File:Ccmake.jpg|thumb|300px|right|Screenshot from ccmake, curse-based gui for cmake]]&lt;br /&gt;
{{clr}}&lt;br /&gt;
&lt;br /&gt;
=== Building Blender ===&lt;br /&gt;
&lt;br /&gt;
After changes have been done and you have generated the makefiles, you can compile using the ''make'' command inside the build directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/blender-git/build&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Dev:Doc/Building_Blender/MakeJobs}}&lt;br /&gt;
&lt;br /&gt;
Also notice the '''install''' target is used, this will copy scripts and documentation into '''~/blender-git/build/bin'''&lt;br /&gt;
&lt;br /&gt;
For future builds you can simply update the repository and re-run make.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/blender-git/blender&lt;br /&gt;
git pull --rebase&lt;br /&gt;
git submodule foreach git pull --rebase origin master&lt;br /&gt;
cd ~/blender-git/build&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|Notice|{{Warning/Important}}Both portable &amp;amp; system installations are supported.&lt;br /&gt;
&lt;br /&gt;
Portable installation is default where scripts and data files will be copied into the build '~/blender-git/build/bin' directory and can be moved to other systems easily.&lt;br /&gt;
&lt;br /&gt;
Disable &amp;lt;code&amp;gt;WITH_INSTALL_PORTABLE&amp;lt;/code&amp;gt; to install into &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX&amp;lt;/code&amp;gt; which uses a typical Unix [http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard FHS] layout: bin/, share/blender/, man/ etc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Static Linking ===&lt;br /&gt;
If you want to share your build with others you may want to include libraries with Blender (statically linked libraries).&lt;br /&gt;
&lt;br /&gt;
{{Note|Listing needed shared libs|You can see all needed shared libraries by running:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
objdump -x path/to/blender | grep &amp;quot;NEEDED&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note: by default, Python is not static. To make it so, You'll have to edit &amp;lt;code&amp;gt;PYTHON_LYBRARY&amp;lt;/code&amp;gt; to something like &amp;lt;code&amp;gt;/usr/lib/libpython3.4m.a;/usr/lib/libexpat.a&amp;lt;/code&amp;gt; (exact paths depend on your OS).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Static Linking Each Library:'''&lt;br /&gt;
&lt;br /&gt;
;Enable general static linking&lt;br /&gt;
:Set WITH_STATIC_LIBS to ON, so that CMake will try to make blender link against static libs, when available. Though not perfect, this should reduce quite nicely needed shared libs.&lt;br /&gt;
&lt;br /&gt;
;ffmpeg&lt;br /&gt;
:Set the FFMPEG_LIBRARIES var to full paths of all needed libs (xvid, x264, etc.).&lt;br /&gt;
&lt;br /&gt;
;boost&lt;br /&gt;
:Set (or create) Boost_USE_STATIC_LIBS to true. If you are using boost automatically built by the install_deps.sh script, you should not need to do anything else.&lt;br /&gt;
:But if you are using your own distro's boost package, you most likely will have to set (or create) Boost_USE_ICU to true too (and install the relevant libicu development package), to get blender linking.&lt;br /&gt;
&lt;br /&gt;
TODO: other libs?&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
== Optimize Rebuilds ==&lt;br /&gt;
&lt;br /&gt;
{{Template:MoreDetails | + Optimize Rebuilds (optional) |&lt;br /&gt;
Now that you can build blender and run blender, there are changes you can make which greatly increase the speed of build times.&lt;br /&gt;
&lt;br /&gt;
Use one of the CMake configuration editors (ccmake or cmake-gui), see [[Dev:Doc/Building_Blender/Linux/cmake#Editing_CMake_Parameters | Editing CMake Parameters]]&lt;br /&gt;
&lt;br /&gt;
For really fast rebuilds you can disable Every option with the '''WITH_''' prefix, except for WITH_PYTHON which is needed for the UI. This speeds up linking and gives a smaller binary.&lt;br /&gt;
&lt;br /&gt;
Remove the files created by '''make install''' since they will become stale.&lt;br /&gt;
However, blender still needs to be able to find its scripts or you will have a very minimalist looking interface.&lt;br /&gt;
This can be solved by linking the source directory to your blender binary path so copying isn't needed and scripts are always up to date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rm -r ~/blender-git/build/bin/*.*&lt;br /&gt;
ln -s ~/blender-git/blender/release ~/blender-git/build/bin/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For convenient access, create this symlink to run blender from the source directory:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 ln -s ~/blender-git/build/bin/blender ~/blender-git/blender/blender.bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You can add any files created this way to ''~/blender-git/blender/.git/info/exclude'' so they won't count as untracked files for git. Add your local files here, instead of in .gitignore, because .gitignore is also committed and will affect everyone else.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Dev:Doc/IDE_Configuration|CMake &amp;amp; IDE Configuration]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Ideasman42</name></author>
		
	</entry>
</feed>