CMakeLists.txt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # -*- cmake -*-
  2. project(media_plugin_gstreamer)
  3. include(00-Common)
  4. include(LLCommon)
  5. include(LLImage)
  6. include(LLPlugin)
  7. include(LLMath)
  8. include(LLRender)
  9. include(LLWindow)
  10. include(Linking)
  11. include(MediaPluginBase)
  12. include(FindOpenGL)
  13. include(GStreamerPlugin)
  14. ### media_plugin_gstreamer
  15. if (NOT WINDOWS)
  16. add_definitions(-fPIC)
  17. endif (NOT WINDOWS)
  18. set(media_plugin_gstreamer_SOURCE_FILES
  19. media_plugin_gstreamer.cpp
  20. llmediaimplgstreamer_syms.cpp
  21. )
  22. set(media_plugin_gstreamer_HEADER_FILES
  23. llmediaimplgstreamer.h
  24. llmediaimplgstreamer_syms.h
  25. )
  26. set_source_files_properties(${media_plugin_gstreamer_HEADER_FILES}
  27. PROPERTIES HEADER_FILE_ONLY TRUE)
  28. list(APPEND media_plugin_gstreamer_SOURCE_FILES
  29. ${media_plugin_gstreamer_HEADER_FILES})
  30. add_library(media_plugin_gstreamer
  31. SHARED
  32. ${media_plugin_gstreamer_SOURCE_FILES}
  33. )
  34. if (DARWIN)
  35. # Do not prepend 'lib' to the executable name, and do not embed a full
  36. # install path (which would wrongly be the sources path) inside the library.
  37. set_target_properties(media_plugin_gstreamer
  38. PROPERTIES
  39. PREFIX ""
  40. BUILD_WITH_INSTALL_NAME_DIR 1
  41. BUILD_WITH_INSTALL_RPATH 1
  42. INSTALL_NAME_DIR "@executable_path"
  43. LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
  44. )
  45. endif (DARWIN)
  46. if (LINUX)
  47. set_target_properties(media_plugin_gstreamer
  48. # Do not prepend 'lib' to the executable name
  49. PROPERTIES
  50. PREFIX ""
  51. )
  52. endif (LINUX)
  53. if (WINDOWS)
  54. set_target_properties(media_plugin_gstreamer
  55. PROPERTIES
  56. LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT"
  57. )
  58. endif (WINDOWS)
  59. target_link_libraries(media_plugin_gstreamer
  60. ${LLPLUGIN_LIBRARIES}
  61. ${MEDIA_PLUGIN_BASE_LIBRARIES}
  62. ${LLCOMMON_LIBRARIES}
  63. ${GSTREAMER_LIBRARIES}
  64. ${PLUGIN_API_LIBRARIES}
  65. )
  66. get_directory_property(ALLDEFINES COMPILE_DEFINITIONS)
  67. message("media_plugins/gstreamer COMPILE_DEFINITIONS = ${ALLDEFINES}")