PageRenderTime 11ms CodeModel.GetById 7ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/media_plugins/webkit/CMakeLists.txt

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 129 lines | 102 code | 21 blank | 6 comment | 7 complexity | 62fb327840c63f5801443c9bc8b7d79d MD5 | raw file
  1# -*- cmake -*-
  2
  3project(media_plugin_webkit)
  4
  5include(00-Common)
  6include(LLCommon)
  7include(LLImage)
  8include(LLPlugin)
  9include(LLMath)
 10include(LLRender)
 11include(LLWindow)
 12include(UI)
 13include(Linking)
 14include(PluginAPI)
 15include(MediaPluginBase)
 16include(FindOpenGL)
 17include(PulseAudio)
 18
 19include(WebKitLibPlugin)
 20
 21include_directories(
 22    ${PULSEAUDIO_INCLUDE_DIRS}
 23    ${LLPLUGIN_INCLUDE_DIRS}
 24    ${MEDIA_PLUGIN_BASE_INCLUDE_DIRS}
 25    ${LLCOMMON_INCLUDE_DIRS}
 26    ${LLMATH_INCLUDE_DIRS}
 27    ${LLIMAGE_INCLUDE_DIRS}
 28    ${LLRENDER_INCLUDE_DIRS}
 29    ${LLWINDOW_INCLUDE_DIRS}
 30    ${LLQTWEBKIT_INCLUDE_DIR}
 31)
 32
 33
 34### media_plugin_webkit
 35
 36if(NOT WORD_SIZE EQUAL 32)
 37  if(WINDOWS)
 38    add_definitions(/FIXED:NO)
 39  else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
 40    add_definitions(-fPIC)
 41  endif(WINDOWS)
 42endif(NOT WORD_SIZE EQUAL 32)
 43
 44set(media_plugin_webkit_SOURCE_FILES
 45    media_plugin_webkit.cpp
 46    )
 47
 48set(media_plugin_webkit_HEADER_FILES
 49    volume_catcher.h
 50    )
 51
 52set(media_plugin_webkit_LINK_LIBRARIES
 53  ${LLPLUGIN_LIBRARIES}
 54  ${MEDIA_PLUGIN_BASE_LIBRARIES}
 55  ${LLCOMMON_LIBRARIES}
 56  ${WEBKIT_PLUGIN_LIBRARIES}
 57  ${PLUGIN_API_WINDOWS_LIBRARIES}
 58  ${PULSEAUDIO_LIBRARIES}
 59)
 60
 61# Select which VolumeCatcher implementation to use
 62if (LINUX)
 63  if (PULSEAUDIO_FOUND)
 64    list(APPEND media_plugin_webkit_SOURCE_FILES linux_volume_catcher.cpp)
 65  else (PULSEAUDIO_FOUND)
 66    list(APPEND media_plugin_webkit_SOURCE_FILES dummy_volume_catcher.cpp)
 67  endif (PULSEAUDIO_FOUND)
 68  list(APPEND media_plugin_webkit_LINK_LIBRARIES
 69       ${UI_LIBRARIES}     # for glib/GTK
 70       )
 71elseif (DARWIN)
 72  list(APPEND media_plugin_webkit_SOURCE_FILES mac_volume_catcher.cpp)
 73  find_library(CORESERVICES_LIBRARY CoreServices)
 74  find_library(AUDIOUNIT_LIBRARY AudioUnit)
 75  list(APPEND media_plugin_webkit_LINK_LIBRARIES
 76       ${CORESERVICES_LIBRARY}     # for Component Manager calls
 77       ${AUDIOUNIT_LIBRARY}        # for AudioUnit calls
 78       )
 79elseif (WINDOWS)
 80  list(APPEND media_plugin_webkit_SOURCE_FILES windows_volume_catcher.cpp)
 81endif (LINUX)
 82
 83set_source_files_properties(${media_plugin_webkit_HEADER_FILES}
 84                            PROPERTIES HEADER_FILE_ONLY TRUE)
 85
 86list(APPEND media_plugin_webkit_SOURCE_FILES ${media_plugin_webkit_HEADER_FILES})
 87
 88add_library(media_plugin_webkit
 89    SHARED
 90    ${media_plugin_webkit_SOURCE_FILES}
 91)
 92
 93target_link_libraries(media_plugin_webkit ${media_plugin_webkit_LINK_LIBRARIES})
 94
 95add_dependencies(media_plugin_webkit
 96  ${LLPLUGIN_LIBRARIES}
 97  ${MEDIA_PLUGIN_BASE_LIBRARIES}
 98  ${LLCOMMON_LIBRARIES}
 99)
100
101if (WINDOWS)
102  set_target_properties(
103    media_plugin_webkit
104    PROPERTIES
105    LINK_FLAGS "/MANIFEST:NO"
106    )
107endif (WINDOWS)
108
109if (DARWIN)
110  # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name
111  set_target_properties(
112    media_plugin_webkit
113    PROPERTIES
114    PREFIX ""
115    BUILD_WITH_INSTALL_RPATH 1
116    INSTALL_NAME_DIR "@executable_path"
117    LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
118  )
119
120  # copy the webkit dylib to the build directory
121  add_custom_command(
122    TARGET media_plugin_webkit POST_BUILD
123#    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllqtwebkit.dylib
124    COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/
125    DEPENDS media_plugin_webkit ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
126    )
127    
128endif (DARWIN)
129