Merge branch 'master' into blender2.8
[blender.git] / build_files / buildbot / config / blender_linux.cmake
1 # ######## Global feature set settings ########
2
3 include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_full.cmake")
4
5 # Detect which libc we'll be linking against.
6 # Some of the paths will depend on this
7
8 if(EXISTS "/lib/x86_64-linux-gnu/libc-2.24.so")
9         message(STATUS "Building in GLibc-2.24 environment")
10         set(GLIBC "2.24")
11         set(MULTILIB "/x86_64-linux-gnu")
12 elseif(EXISTS "/lib/i386-linux-gnu//libc-2.24.so")
13         message(STATUS "Building in GLibc-2.24 environment")
14         set(GLIBC "2.24")
15         set(MULTILIB "/i386-linux-gnu")
16 elseif(EXISTS "/lib/x86_64-linux-gnu/libc-2.19.so")
17         message(STATUS "Building in GLibc-2.19 environment")
18         set(GLIBC "2.19")
19         set(MULTILIB "/x86_64-linux-gnu")
20 elseif(EXISTS "/lib/i386-linux-gnu//libc-2.19.so")
21         message(STATUS "Building in GLibc-2.19 environment")
22         set(GLIBC "2.19")
23         set(MULTILIB "/i386-linux-gnu")
24 elseif(EXISTS "/lib/libc-2.11.3.so")
25         message(STATUS "Building in GLibc-2.11 environment")
26         set(GLIBC "2.11")
27         set(MULTILIB "")
28 else()
29         message(FATAL_ERROR "Unknown build environment")
30 endif()
31
32 # Default to only build Blender
33 set(WITH_BLENDER             ON  CACHE BOOL "" FORCE)
34
35 # ######## Linux-specific build options ########
36 # Options which are specific to Linux-only platforms
37 set(WITH_DOC_MANPAGE         OFF CACHE BOOL "" FORCE)
38
39 # ######## Official release-specific build options ########
40 # Options which are specific to Linux release builds only
41 set(WITH_JACK_DYNLOAD        ON  CACHE BOOL "" FORCE)
42 set(WITH_SDL_DYNLOAD         ON  CACHE BOOL "" FORCE)
43 set(WITH_SYSTEM_GLEW         OFF CACHE BOOL "" FORCE)
44
45 set(WITH_OPENMP_STATIC       ON  CACHE BOOL "" FORCE)
46
47 set(WITH_PYTHON_INSTALL_NUMPY    ON CACHE BOOL "" FORCE)
48 set(WITH_PYTHON_INSTALL_REQUESTS ON CACHE BOOL "" FORCE)
49
50 # ######## Release environment specific settings ########
51
52 if (NOT ${GLIBC} STREQUAL "2.24")
53
54 # All the hardcoded library paths and such
55
56 # LLVM libraries
57 set(LLVM_VERSION             "3.4"  CACHE STRING "" FORCE)
58 set(LLVM_ROOT_DIR            "/opt/lib/llvm-${LLVM_VERSION}"  CACHE STRING "" FORCE)
59 set(LLVM_STATIC              ON  CACHE BOOL "" FORCE)
60
61 # BOOST libraries
62 set(BOOST_ROOT               "/opt/lib/boost" CACHE STRING "" FORCE)
63 set(Boost_USE_STATIC_LIBS    ON CACHE BOOL "" FORCE)
64
65 # FFmpeg libraries
66 set(FFMPEG                   "/opt/lib/ffmpeg" CACHE STRING "" FORCE)
67 set(FFMPEG_LIBRARIES
68         avdevice avformat avcodec avutil avfilter swscale swresample
69         /usr/lib${MULTILIB}/libxvidcore.a
70         /usr/lib${MULTILIB}/libx264.a
71         /usr/lib${MULTILIB}/libmp3lame.a
72         /usr/lib${MULTILIB}/libvpx.a
73         /usr/lib${MULTILIB}/libvorbis.a
74         /usr/lib${MULTILIB}/libogg.a
75         /usr/lib${MULTILIB}/libvorbisenc.a
76         /usr/lib${MULTILIB}/libtheora.a
77         /usr/lib${MULTILIB}/libschroedinger-1.0.a
78         /usr/lib${MULTILIB}/liborc-0.4.a
79         CACHE STRING "" FORCE
80 )
81
82 # SndFile libraries
83 set(SNDFILE_LIBRARY          "/usr/lib${MULTILIB}/libsndfile.a;/usr/lib${MULTILIB}/libFLAC.a" CACHE STRING "" FORCE)
84
85 # OpenAL libraries
86 set(OPENAL_ROOT_DIR           "/opt/lib/openal" CACHE STRING "" FORCE)
87 set(OPENAL_INCLUDE_DIR        "${OPENAL_ROOT_DIR}/include/AL" CACHE STRING "" FORCE)
88 set(OPENAL_LIBRARY
89         ${OPENAL_ROOT_DIR}/lib/libopenal.a
90         ${OPENAL_ROOT_DIR}/lib/libcommon.a
91         CACHE STRING "" FORCE
92 )
93
94 # OpenCollada libraries
95 set(OPENCOLLADA_UTF_LIBRARY   ""                              CACHE STRING "" FORCE)
96 set(PCRE_INCLUDE_DIR          "/usr/include"                  CACHE STRING "" FORCE)
97 set(PCRE_LIBRARY              "/usr/lib${MULTILIB}/libpcre.a" CACHE STRING "" FORCE)
98 set(XML2_INCLUDE_DIR          "/usr/include"                  CACHE STRING "" FORCE)
99 set(XML2_LIBRARY              "/usr/lib${MULTILIB}/libxml2.a" CACHE STRING "" FORCE)
100
101 # OpenColorIO libraries
102 set(OPENCOLORIO_ROOT_DIR      "/opt/lib/ocio" CACHE STRING "" FORCE)
103 set(OPENCOLORIO_OPENCOLORIO_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libOpenColorIO.a" CACHE STRING "" FORCE)
104 set(OPENCOLORIO_TINYXML_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libtinyxml.a"         CACHE STRING "" FORCE)
105 set(OPENCOLORIO_YAML-CPP_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp.a"       CACHE STRING "" FORCE)
106
107 # Freetype
108 set(FREETYPE_INCLUDE_DIRS "/usr/include/freetype2"       CACHE STRING "" FORCE)
109 set(FREETYPE_LIBRARY "/usr/lib${MULTILIB}/libfreetype.a" CACHE STRING "" FORCE)
110
111 # OpenImageIO
112 if(GLIBC EQUAL "2.19")
113         set(OPENIMAGEIO_LIBRARY
114                 /opt/lib/oiio/lib/libOpenImageIO.a
115                 /opt/lib/oiio/lib/libOpenImageIO_Util.a
116                 /usr/lib${MULTILIB}/libwebp.a
117                 /usr/lib${MULTILIB}/liblzma.a
118                 /usr/lib${MULTILIB}/libjbig.a
119                 ${FREETYPE_LIBRARY}
120                 CACHE STRING "" FORCE
121         )
122 endif()
123
124 # OpenSubdiv libraries
125 set(OPENSUBDIV_ROOT_DIR "/opt/lib/opensubdiv" CACHE STRING "" FORCE)
126 set(OPENSUBDIV_OSDCPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdCPU.a" CACHE STRING "" FORCE)
127 set(OPENSUBDIV_OSDGPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdGPU.a" CACHE STRING "" FORCE)
128
129 # OpenEXR libraries
130 set(OPENEXR_ROOT_DIR          "/opt/lib/openexr"                    CACHE STRING "" FORCE)
131 set(OPENEXR_HALF_LIBRARY      "/opt/lib/openexr/lib/libHalf.a"      CACHE STRING "" FORCE)
132 set(OPENEXR_IEX_LIBRARY       "/opt/lib/openexr/lib/libIex.a"       CACHE STRING "" FORCE)
133 set(OPENEXR_ILMIMF_LIBRARY    "/opt/lib/openexr/lib/libIlmImf.a"    CACHE STRING "" FORCE)
134 set(OPENEXR_ILMTHREAD_LIBRARY "/opt/lib/openexr/lib/libIlmThread.a" CACHE STRING "" FORCE)
135 set(OPENEXR_IMATH_LIBRARY     "/opt/lib/openexr/lib/libImath.a"     CACHE STRING "" FORCE)
136
137 # JeMalloc library
138 set(JEMALLOC_LIBRARY    "/opt/lib/jemalloc/lib/libjemalloc.a" CACHE STRING "" FORCE)
139
140 # Space navigation
141 set(SPACENAV_ROOT_DIR       "/opt/lib/libspnav" CACHE STRING "" FORCE)
142
143 # Force some system libraries to be static
144 set(FFTW3_LIBRARY       "/usr/lib${MULTILIB}/libfftw3.a" CACHE STRING "" FORCE)
145 set(JPEG_LIBRARY        "/usr/lib${MULTILIB}/libjpeg.a"  CACHE STRING "" FORCE)
146 set(PNG_LIBRARY         "/usr/lib${MULTILIB}/libpng.a"   CACHE STRING "" FORCE)
147 set(TIFF_LIBRARY        "/usr/lib${MULTILIB}/libtiff.a"  CACHE STRING "" FORCE)
148 set(ZLIB_LIBRARY        "/usr/lib${MULTILIB}/libz.a"     CACHE STRING "" FORCE)
149
150 # OpenVDB
151 set(OPENVDB_LIBRARY
152         /opt/lib/openvdb/lib/libopenvdb.a
153         CACHE BOOL "" FORCE
154 )
155
156 set(BLOSC_LIBRARY
157         /opt/lib/blosc/lib/libblosc.a
158         CACHE BOOL "" FORCE
159 )
160
161 else()
162
163 # Set path to precompiled libraries.
164 set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
165 string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
166 set(LIBDIR "/opt/blender-deps/${LIBDIR_NAME}")
167
168 # TODO(sergey): Remove once Python is oficially bumped to 3.7.
169 set(PYTHON_VERSION 3.7)
170
171 # Ensure specific configuration of various libraries.
172 set(Boost_USE_STATIC_LIBS    ON CACHE BOOL "" FORCE)
173
174 endif()
175
176 # Additional linking libraries
177 set(CMAKE_EXE_LINKER_FLAGS   "-lrt -static-libstdc++"  CACHE STRING "" FORCE)