320edab65e8f0f1390d322887923e76c63bab334
[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.19.so")
9         message(STATUS "Building in GLibc-2.19 environment")
10         set(GLIBC "2.19")
11         set(MULTILIB "/x86_64-linux-gnu")
12 elseif (EXISTS "/lib/i386-linux-gnu//libc-2.19.so")
13         message(STATUS "Building in GLibc-2.19 environment")
14         set(GLIBC "2.19")
15         set(MULTILIB "/i386-linux-gnu")
16 elseif (EXISTS "/lib/libc-2.11.3.so")
17         message(STATUS "Building in GLibc-2.11 environment")
18         set(GLIBC "2.11")
19         set(MULTILIB "")
20 else()
21         message(FATAL_ERROR "Unknown build environment")
22 endif()
23
24 # Use backported version of the compiler instead of a system default one
25 set(CMAKE_C_COMPILER "/usr/bin/gcc-6" CACHE STRING "" FORCE)
26 set(CMAKE_CXX_COMPILER "/usr/bin/g++-6" CACHE STRING "" FORCE)
27
28 # Default to only build Blender, not the player
29 set(WITH_BLENDER             ON  CACHE BOOL "" FORCE)
30 set(WITH_PLAYER              OFF CACHE BOOL "" FORCE)
31
32 # ######## Linux-specific build options ########
33 # Options which are specific to Linux-only platforms
34 set(WITH_DOC_MANPAGE         OFF CACHE BOOL "" FORCE)
35
36 # ######## Official release-specific build options ########
37 # Options which are specific to Linux release builds only
38 set(WITH_JACK_DYNLOAD        ON  CACHE BOOL "" FORCE)
39 set(WITH_SDL_DYNLOAD         ON  CACHE BOOL "" FORCE)
40 set(WITH_SYSTEM_GLEW         OFF CACHE BOOL "" FORCE)
41
42 set(WITH_OPENMP_STATIC       ON  CACHE BOOL "" FORCE)
43
44 set(WITH_PYTHON_INSTALL_NUMPY    ON CACHE BOOL "" FORCE)
45 set(WITH_PYTHON_INSTALL_REQUESTS ON CACHE BOOL "" FORCE)
46
47 # ######## Release environment specific settings ########
48 # All the hardcoded libraru paths and such
49
50 # LLVM libraries
51 set(LLVM_VERSION             "3.4"  CACHE STRING "" FORCE)
52 set(LLVM_ROOT_DIR            "/opt/lib/llvm-${LLVM_VERSION}"  CACHE STRING "" FORCE)
53 set(LLVM_STATIC              ON  CACHE BOOL "" FORCE)
54
55 # BOOST libraries
56 set(BOOST_ROOT               "/opt/lib/boost" CACHE STRING "" FORCE)
57 set(Boost_USE_STATIC_LIBS    ON CACHE BOOL "" FORCE)
58
59 # FFmpeg libraries
60 set(FFMPEG                   "/opt/lib/ffmpeg" CACHE STRING "" FORCE)
61 set(FFMPEG_LIBRARIES
62         avdevice avformat avcodec avutil avfilter swscale swresample
63         /usr/lib${MULTILIB}/libxvidcore.a
64         /usr/lib${MULTILIB}/libx264.a
65         /usr/lib${MULTILIB}/libmp3lame.a
66         /usr/lib${MULTILIB}/libvpx.a
67         /usr/lib${MULTILIB}/libvorbis.a
68         /usr/lib${MULTILIB}/libogg.a
69         /usr/lib${MULTILIB}/libvorbisenc.a
70         /usr/lib${MULTILIB}/libtheora.a
71         /usr/lib${MULTILIB}/libschroedinger-1.0.a
72         /usr/lib${MULTILIB}/liborc-0.4.a
73         CACHE STRING "" FORCE
74 )
75
76 # SndFile libraries
77 set(SNDFILE_LIBRARY          "/usr/lib/libsndfile.a;/usr/lib/libFLAC.a" CACHE STRING "" FORCE)
78
79 # OpenAL libraries
80 set(OPENAL_ROOT_DIR           "/opt/lib/openal" CACHE STRING "" FORCE)
81 set(OPENAL_INCLUDE_DIR        "${OPENAL_ROOT_DIR}/include" CACHE STRING "" FORCE)
82 set(OPENAL_LIBRARY
83         ${OPENAL_ROOT_DIR}/lib/libopenal.a
84         ${OPENAL_ROOT_DIR}/lib/libcommon.a
85         CACHE STRING "" FORCE
86 )
87
88 # OpenCollada libraries
89 set(OPENCOLLADA_UTF_LIBRARY   ""                              CACHE STRING "" FORCE)
90 set(PCRE_INCLUDE_DIR          "/usr/include"                  CACHE STRING "" FORCE)
91 set(PCRE_LIBRARY              "/usr/lib${MULTILIB}/libpcre.a" CACHE STRING "" FORCE)
92 set(XML2_INCLUDE_DIR          "/usr/include"                  CACHE STRING "" FORCE)
93 set(XML2_LIBRARY              "/usr/lib${MULTILIB}/libxml2.a" CACHE STRING "" FORCE)
94
95 # OpenColorIO libraries
96 set(OPENCOLORIO_ROOT_DIR      "/opt/lib/ocio" CACHE STRING "" FORCE)
97 set(OPENCOLORIO_OPENCOLORIO_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libOpenColorIO.a" CACHE STRING "" FORCE)
98 set(OPENCOLORIO_TINYXML_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libtinyxml.a"         CACHE STRING "" FORCE)
99 set(OPENCOLORIO_YAML-CPP_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp.a"       CACHE STRING "" FORCE)
100
101 # OpenImageIO
102 if(GLIBC EQUAL "2.19")
103         set(OPENIMAGEIO_LIBRARY
104                 /opt/lib/oiio/lib/libOpenImageIO.a
105                 /opt/lib/oiio/lib/libOpenImageIO_Util.a
106                 /usr/lib${MULTILIB}/libwebp.a
107                 /usr/lib${MULTILIB}/liblzma.a
108                 /usr/lib${MULTILIB}/libjbig.a
109                 CACHE STRING "" FORCE
110         )
111 endif()
112
113 # OpenSubdiv libraries
114 set(OPENSUBDIV_ROOT_DIR "/opt/lib/opensubdiv" CACHE STRING "" FORCE)
115 set(OPENSUBDIV_OSDCPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdCPU.a" CACHE STRING "" FORCE)
116 set(OPENSUBDIV_OSDGPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdGPU.a" CACHE STRING "" FORCE)
117
118 # OpenEXR libraries
119 set(OPENEXR_ROOT_DIR          "/opt/lib/openexr"                    CACHE STRING "" FORCE)
120 set(OPENEXR_HALF_LIBRARY      "/opt/lib/openexr/lib/libHalf.a"      CACHE STRING "" FORCE)
121 set(OPENEXR_IEX_LIBRARY       "/opt/lib/openexr/lib/libIex.a"       CACHE STRING "" FORCE)
122 set(OPENEXR_ILMIMF_LIBRARY    "/opt/lib/openexr/lib/libIlmImf.a"    CACHE STRING "" FORCE)
123 set(OPENEXR_ILMTHREAD_LIBRARY "/opt/lib/openexr/lib/libIlmThread.a" CACHE STRING "" FORCE)
124 set(OPENEXR_IMATH_LIBRARY     "/opt/lib/openexr/lib/libImath.a"     CACHE STRING "" FORCE)
125
126 # JeMalloc library
127 set(JEMALLOC_LIBRARY    "/opt/lib/jemalloc/lib/libjemalloc.a" CACHE STRING "" FORCE)
128
129 # Space navigation
130 set(SPACENAV_ROOT_DIR       "/opt/lib/libspnav" CACHE STRING "" FORCE)
131
132 # Force some system libraries to be static
133 set(FFTW3_LIBRARY       "/usr/lib${MULTILIB}/libfftw3.a" CACHE STRING "" FORCE)
134 set(JPEG_LIBRARY        "/usr/lib${MULTILIB}/libjpeg.a"  CACHE STRING "" FORCE)
135 set(PNG_LIBRARY         "/usr/lib${MULTILIB}/libpng.a"   CACHE STRING "" FORCE)
136 set(TIFF_LIBRARY        "/usr/lib${MULTILIB}/libtiff.a"  CACHE STRING "" FORCE)
137 set(ZLIB_LIBRARY        "/usr/lib${MULTILIB}/libz.a"     CACHE STRING "" FORCE)
138
139 # OpenVDB
140 set(OPENVDB_LIBRARY
141         /opt/lib/openvdb/lib/libopenvdb.a
142         /opt/lib/blosc/lib/libblosc.a
143         CACHE BOOL "" FORCE
144 )
145
146 # Additional linking libraries
147 set(CMAKE_EXE_LINKER_FLAGS   "-lrt -static-libstdc++"  CACHE STRING "" FORCE)