CMake: cleanup
[blender-staging.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 # Default to only build Blender, not the player
25 set(WITH_BLENDER             ON  CACHE BOOL "" FORCE)
26 set(WITH_PLAYER              OFF CACHE BOOL "" FORCE)
27
28 # ######## Linux-specific build options ########
29 # Options which are specific to Linux-only platforms
30 set(WITH_DOC_MANPAGE         OFF CACHE BOOL "" FORCE)
31
32 # ######## Official release-specific build options ########
33 # Options which are specific to Linux release builds only
34 set(WITH_JACK_DYNLOAD        ON  CACHE BOOL "" FORCE)
35 set(WITH_SDL_DYNLOAD         ON  CACHE BOOL "" FORCE)
36 set(WITH_SYSTEM_GLEW         OFF CACHE BOOL "" FORCE)
37
38 set(WITH_OPENMP_STATIC       ON  CACHE BOOL "" FORCE)
39
40 set(WITH_PYTHON_INSTALL_NUMPY    ON CACHE BOOL "" FORCE)
41 set(WITH_PYTHON_INSTALL_REQUESTS ON CACHE BOOL "" FORCE)
42
43 # ######## Release environment specific settings ########
44 # All the hardcoded libraru paths and such
45
46 # LLVM libraries
47 set(LLVM_VERSION             "3.4"  CACHE STRING "" FORCE)
48 set(LLVM_ROOT_DIR            "/opt/lib/llvm-${LLVM_VERSION}"  CACHE STRING "" FORCE)
49 set(LLVM_STATIC              ON  CACHE BOOL "" FORCE)
50
51 # BOOST libraries
52 set(BOOST_ROOT               "/opt/lib/boost" CACHE STRING "" FORCE)
53 set(Boost_USE_STATIC_LIBS    ON CACHE BOOL "" FORCE)
54
55 # FFmpeg libraries
56 set(FFMPEG                   "/opt/lib/ffmpeg" CACHE STRING "" FORCE)
57 set(FFMPEG_LIBRARIES
58         avdevice avformat avcodec avutil avfilter swscale swresample
59         /usr/lib${MULTILIB}/libxvidcore.a
60         /usr/lib${MULTILIB}/libx264.a
61         /usr/lib${MULTILIB}/libmp3lame.a
62         /usr/lib${MULTILIB}/libvpx.a
63         /usr/lib${MULTILIB}/libvorbis.a
64         /usr/lib${MULTILIB}/libogg.a
65         /usr/lib${MULTILIB}/libvorbisenc.a
66         /usr/lib${MULTILIB}/libtheora.a
67         /usr/lib${MULTILIB}/libschroedinger-1.0.a
68         /usr/lib${MULTILIB}/liborc-0.4.a
69         CACHE STRING "" FORCE
70 )
71
72 # SndFile libraries
73 set(SNDFILE_LIBRARY          "/usr/lib${MULTILIB}/libsndfile.a;/usr/lib${MULTILIB}/libFLAC.a" CACHE STRING "" FORCE)
74
75 # OpenAL libraries
76 set(OPENAL_ROOT_DIR           "/opt/lib/openal" CACHE STRING "" FORCE)
77 set(OPENAL_INCLUDE_DIR        "${OPENAL_ROOT_DIR}/include" CACHE STRING "" FORCE)
78 set(OPENAL_LIBRARY
79         ${OPENAL_ROOT_DIR}/lib/libopenal.a
80         ${OPENAL_ROOT_DIR}/lib/libcommon.a
81         CACHE STRING "" FORCE
82 )
83
84 # OpenCollada libraries
85 set(OPENCOLLADA_UTF_LIBRARY   ""                              CACHE STRING "" FORCE)
86 set(PCRE_INCLUDE_DIR          "/usr/include"                  CACHE STRING "" FORCE)
87 set(PCRE_LIBRARY              "/usr/lib${MULTILIB}/libpcre.a" CACHE STRING "" FORCE)
88 set(XML2_INCLUDE_DIR          "/usr/include"                  CACHE STRING "" FORCE)
89 set(XML2_LIBRARY              "/usr/lib${MULTILIB}/libxml2.a" CACHE STRING "" FORCE)
90
91 # OpenColorIO libraries
92 set(OPENCOLORIO_ROOT_DIR      "/opt/lib/ocio" CACHE STRING "" FORCE)
93 set(OPENCOLORIO_OPENCOLORIO_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libOpenColorIO.a" CACHE STRING "" FORCE)
94 set(OPENCOLORIO_TINYXML_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libtinyxml.a"         CACHE STRING "" FORCE)
95 set(OPENCOLORIO_YAML-CPP_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp.a"       CACHE STRING "" FORCE)
96
97 # Freetype
98 set(FREETYPE_INCLUDE_DIRS "/usr/include/freetype2"       CACHE STRING "" FORCE)
99 set(FREETYPE_LIBRARY "/usr/lib${MULTILIB}/libfreetype.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                 ${FREETYPE_LIBRARY}
110                 CACHE STRING "" FORCE
111         )
112 endif()
113
114 # OpenSubdiv libraries
115 set(OPENSUBDIV_ROOT_DIR "/opt/lib/opensubdiv" CACHE STRING "" FORCE)
116 set(OPENSUBDIV_OSDCPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdCPU.a" CACHE STRING "" FORCE)
117 set(OPENSUBDIV_OSDGPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdGPU.a" CACHE STRING "" FORCE)
118
119 # OpenEXR libraries
120 set(OPENEXR_ROOT_DIR          "/opt/lib/openexr"                    CACHE STRING "" FORCE)
121 set(OPENEXR_HALF_LIBRARY      "/opt/lib/openexr/lib/libHalf.a"      CACHE STRING "" FORCE)
122 set(OPENEXR_IEX_LIBRARY       "/opt/lib/openexr/lib/libIex.a"       CACHE STRING "" FORCE)
123 set(OPENEXR_ILMIMF_LIBRARY    "/opt/lib/openexr/lib/libIlmImf.a"    CACHE STRING "" FORCE)
124 set(OPENEXR_ILMTHREAD_LIBRARY "/opt/lib/openexr/lib/libIlmThread.a" CACHE STRING "" FORCE)
125 set(OPENEXR_IMATH_LIBRARY     "/opt/lib/openexr/lib/libImath.a"     CACHE STRING "" FORCE)
126
127 # JeMalloc library
128 set(JEMALLOC_LIBRARY    "/opt/lib/jemalloc/lib/libjemalloc.a" CACHE STRING "" FORCE)
129
130 # Space navigation
131 set(SPACENAV_ROOT_DIR       "/opt/lib/libspnav" CACHE STRING "" FORCE)
132
133 # Force some system libraries to be static
134 set(FFTW3_LIBRARY       "/usr/lib${MULTILIB}/libfftw3.a" CACHE STRING "" FORCE)
135 set(JPEG_LIBRARY        "/usr/lib${MULTILIB}/libjpeg.a"  CACHE STRING "" FORCE)
136 set(PNG_LIBRARY         "/usr/lib${MULTILIB}/libpng.a"   CACHE STRING "" FORCE)
137 set(TIFF_LIBRARY        "/usr/lib${MULTILIB}/libtiff.a"  CACHE STRING "" FORCE)
138 set(ZLIB_LIBRARY        "/usr/lib${MULTILIB}/libz.a"     CACHE STRING "" FORCE)
139
140 # OpenVDB
141 set(OPENVDB_LIBRARY
142         /opt/lib/openvdb/lib/libopenvdb.a
143         /opt/lib/blosc/lib/libblosc.a
144         CACHE BOOL "" FORCE
145 )
146
147 # Additional linking libraries
148 set(CMAKE_EXE_LINKER_FLAGS   "-lrt -static-libstdc++"  CACHE STRING "" FORCE)