Merge branch 'blender2.7'
[blender.git] / build_files / build_environment / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ***** END GPL LICENSE BLOCK *****
18
19 ####################################################################################################
20 #
21 # This is a build system used by platform maintainers to build library dependencies on
22 # Windows, macOS and Linux.
23 #
24 # For users building Blender, we recommend using the precompiled libraries from lib/ on
25 # Windows and macOS, and install_deps.sh on Linux.
26 #
27 # WINDOWS USAGE:
28 #   Don't call this cmake file yourself, use build_deps.cmd
29 #   build_deps 2013 x64 / build_deps 2013 x86
30 #   build_deps 2015 x64 / build_deps 2015 x86
31 #
32 # MAC OS X USAGE:
33 #   Install with homebrew: brew install cmake autoconf automake libtool yasm nasm
34 #   Run "make deps" from main Blender directory
35 #
36 # LINUX USAGE:
37 #   Install compiler cmake autoconf automake libtool yasm nasm tcl
38 #   Run "make deps" from main Blender directory
39 #
40 ####################################################################################################
41
42 project("BlenderDependencies")
43 cmake_minimum_required(VERSION 3.5)
44
45 include(ExternalProject)
46 include(cmake/options.cmake)
47 include(cmake/versions.cmake)
48
49 if(ENABLE_MINGW64)
50   if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
51     include(cmake/setup_mingw64.cmake)
52   else()
53     include(cmake/setup_mingw32.cmake)
54   endif()
55 else()
56   set(mingw_LIBDIR ${LIBDIR})
57 endif()
58
59 include(cmake/zlib.cmake)
60 include(cmake/blendthumb.cmake)
61 include(cmake/openal.cmake)
62 include(cmake/png.cmake)
63 include(cmake/jpeg.cmake)
64 include(cmake/boost.cmake)
65 include(cmake/blosc.cmake)
66 include(cmake/pthreads.cmake)
67 include(cmake/ilmbase.cmake)
68 include(cmake/openexr.cmake)
69 include(cmake/freetype.cmake)
70 include(cmake/freeglut.cmake)
71 include(cmake/glew.cmake)
72 include(cmake/alembic.cmake)
73 include(cmake/glfw.cmake)
74 include(cmake/clew.cmake)
75 include(cmake/cuew.cmake)
76 include(cmake/opensubdiv.cmake)
77 include(cmake/sdl.cmake)
78 include(cmake/opencollada.cmake)
79 include(cmake/opencolorio.cmake)
80 include(cmake/llvm.cmake)
81 include(cmake/clang.cmake)
82 if(APPLE)
83   include(cmake/openmp.cmake)
84 endif()
85 include(cmake/openimageio.cmake)
86 include(cmake/tiff.cmake)
87 include(cmake/flexbison.cmake)
88 include(cmake/osl.cmake)
89 include(cmake/tbb.cmake)
90 include(cmake/openvdb.cmake)
91 include(cmake/python.cmake)
92 include(cmake/python_site_packages.cmake)
93 include(cmake/numpy.cmake)
94 include(cmake/pugixml.cmake)
95
96 if(WITH_WEBP)
97   include(cmake/webp.cmake)
98 endif()
99
100 if(WITH_EMBREE)
101   include(cmake/embree.cmake)
102 endif()
103
104 if(WIN32)
105   # HMD branch deps
106   include(cmake/hidapi.cmake)
107   # OCIO deps
108   include(cmake/tinyxml.cmake)
109   include(cmake/yamlcpp.cmake)
110   # LCMS is an OCIO dep, but only if you build the apps, leaving it here for convenience
111   #include(cmake/lcms.cmake)
112
113 endif()
114
115 if(NOT WIN32 OR ENABLE_MINGW64)
116   include(cmake/openjpeg.cmake)
117   if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
118     if(WIN32)
119       include(cmake/zlib_mingw.cmake)
120     endif()
121     include(cmake/lame.cmake)
122     include(cmake/ogg.cmake)
123     include(cmake/vorbis.cmake)
124     include(cmake/theora.cmake)
125     include(cmake/vpx.cmake)
126     include(cmake/x264.cmake)
127     include(cmake/xvidcore.cmake)
128     include(cmake/faad.cmake)
129     include(cmake/ffmpeg.cmake)
130     include(cmake/fftw.cmake)
131     include(cmake/sndfile.cmake)
132     if(WIN32)
133       include(cmake/iconv.cmake)
134     endif()
135     if(UNIX)
136       include(cmake/flac.cmake)
137       include(cmake/xml2.cmake)
138       if(NOT APPLE)
139         include(cmake/spnav.cmake)
140         include(cmake/jemalloc.cmake)
141       endif()
142     endif()
143   endif()
144 endif()
145
146 if(UNIX)
147   include(cmake/bzip2.cmake)
148   include(cmake/ffi.cmake)
149   include(cmake/lzma.cmake)
150   include(cmake/ssl.cmake)
151   include(cmake/sqlite.cmake)
152 endif()
153
154 include(cmake/harvest.cmake)