blender_linux.cmake 5.8 KB

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