CMakeLists.txt
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:13k
源码类别:

游戏引擎

开发平台:

C++ Builder

  1. # -*- cmake -*-
  2. project(llplugintest)
  3. include(00-Common)
  4. include(FindOpenGL)
  5. include(LLCommon)
  6. include(LLPlugin)
  7. include(Linking)
  8. include(LLSharedLibs)
  9. include(PluginAPI)
  10. include(LLImage)
  11. include(LLMath)
  12. include(LLMessage)
  13. include(LLRender)
  14. include(LLWindow)
  15. include(Glut)
  16. include(Glui)
  17. include_directories(
  18.     ${LLPLUGIN_INCLUDE_DIRS}
  19.     ${LLCOMMON_INCLUDE_DIRS}
  20.     ${LLIMAGE_INCLUDE_DIRS}
  21.     ${LLMATH_INCLUDE_DIRS}
  22.     ${LLMESSAGE_INCLUDE_DIRS}
  23.     ${LLRENDER_INCLUDE_DIRS}
  24.     ${LLWINDOW_INCLUDE_DIRS}
  25. )
  26. if (DARWIN)
  27.     include(CMakeFindFrameworks)
  28.     find_library(COREFOUNDATION_LIBRARY CoreFoundation)
  29. endif (DARWIN)
  30. ### demo_plugin
  31. #set(demo_plugin_SOURCE_FILES
  32. #    demo_plugin.cpp
  33. #    )
  34. #
  35. #add_library(demo_plugin
  36. #    SHARED
  37. #    ${demo_plugin_SOURCE_FILES}
  38. #)
  39. #
  40. #target_link_libraries(demo_plugin
  41. #  ${LLPLUGIN_LIBRARIES}
  42. #  ${LLCOMMON_LIBRARIES}
  43. #  ${PLUGIN_API_WINDOWS_LIBRARIES}
  44. #)
  45. #
  46. #add_dependencies(demo_plugin
  47. #  ${LLPLUGIN_LIBRARIES}
  48. #  ${LLCOMMON_LIBRARIES}
  49. #)
  50. #
  51. #if (DARWIN)
  52. #  # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name
  53. #  set_target_properties(
  54. #    demo_plugin
  55. #    PROPERTIES
  56. #    PREFIX ""
  57. #    BUILD_WITH_INSTALL_RPATH 1
  58. #    INSTALL_NAME_DIR "@executable_path"
  59. #  )
  60. #endif (DARWIN)
  61. ### plugin_host
  62. #set(plugin_host_SOURCE_FILES
  63. #    plugin_host.cpp
  64. #    )
  65. #
  66. #add_executable(plugin_host
  67. #    WIN32
  68. #    ${plugin_host_SOURCE_FILES}
  69. #)
  70. #
  71. #set_target_properties(plugin_host
  72. #    PROPERTIES
  73. #    WIN32_EXECUTABLE
  74. #    FALSE
  75. #)
  76. #
  77. #target_link_libraries(plugin_host
  78. #  ${LLPLUGIN_LIBRARIES}
  79. #  ${LLCOMMON_LIBRARIES}
  80. #  ${PLUGIN_API_WINDOWS_LIBRARIES}
  81. #)
  82. #
  83. #add_dependencies(plugin_host
  84. #  demo_plugin
  85. #  ${LLPLUGIN_LIBRARIES}
  86. #  ${LLCOMMON_LIBRARIES}
  87. #)
  88. ### plugin_process_launcher
  89. #set(plugin_process_launcher_SOURCE_FILES
  90. #    plugin_process_launcher.cpp
  91. #    )
  92. #
  93. #add_executable(plugin_process_launcher
  94. #    WIN32
  95. #    ${plugin_process_launcher_SOURCE_FILES}
  96. #)
  97. #
  98. #set_target_properties(plugin_process_launcher
  99. #    PROPERTIES
  100. #    WIN32_EXECUTABLE
  101. #    FALSE
  102. #)
  103. #
  104. #target_link_libraries(plugin_process_launcher
  105. #  ${LLPLUGIN_LIBRARIES}
  106. #  ${LLMESSAGE_LIBRARIES}
  107. #  ${LLCOMMON_LIBRARIES}
  108. #  ${PLUGIN_API_WINDOWS_LIBRARIES}
  109. #)
  110. #
  111. #add_dependencies(plugin_process_launcher
  112. #  SLPlugin
  113. #  demo_plugin
  114. #  ${LLPLUGIN_LIBRARIES}
  115. #  ${LLMESSAGE_LIBRARIES}
  116. #  ${LLCOMMON_LIBRARIES}
  117. #)
  118. ### media_simple_test
  119. #set(media_simple_test_SOURCE_FILES
  120. #    media_simple_test.cpp
  121. #    )
  122. #
  123. #add_executable(media_simple_test
  124. #    WIN32
  125. #    ${media_simple_test_SOURCE_FILES}
  126. #)
  127. #
  128. #add_dependencies(media_simple_test stage_third_party_libs)
  129. #
  130. #set_target_properties(media_simple_test
  131. #    PROPERTIES
  132. #    WIN32_EXECUTABLE
  133. #    FALSE
  134. #)
  135. #
  136. #target_link_libraries(media_simple_test
  137. #  ${GLUT_LIBRARY}
  138. #  ${OPENGL_LIBRARIES}
  139. #  ${LLCOMMON_LIBRARIES}
  140. #)
  141. ### media_plugin_test
  142. #set(media_plugin_test_SOURCE_FILES
  143. #    media_plugin_test.cpp
  144. #    )
  145. #
  146. #add_executable(media_plugin_test
  147. #    WIN32
  148. #    ${media_plugin_test_SOURCE_FILES}
  149. #)
  150. #
  151. #set_target_properties(media_plugin_test
  152. #    PROPERTIES
  153. #    WIN32_EXECUTABLE
  154. #    FALSE
  155. #)
  156. #
  157. #target_link_libraries(media_plugin_test
  158. #  ${GLUT_LIBRARY}
  159. #  ${OPENGL_LIBRARIES}
  160. #  ${LLPLUGIN_LIBRARIES}
  161. #  ${LLMESSAGE_LIBRARIES}
  162. #  ${LLCOMMON_LIBRARIES}
  163. #  ${PLUGIN_API_WINDOWS_LIBRARIES}
  164. #)
  165. #
  166. #add_dependencies(media_plugin_test
  167. #  stage_third_party_libs
  168. #  SLPlugin
  169. #  demo_media_plugin
  170. #  ${LLPLUGIN_LIBRARIES}
  171. #  ${LLMESSAGE_LIBRARIES}
  172. #  ${LLCOMMON_LIBRARIES}
  173. #)
  174. ### demo_media_plugin
  175. #set(demo_media_plugin_SOURCE_FILES
  176. #    demo_media_plugin.cpp
  177. #    )
  178. #
  179. #add_library(demo_media_plugin
  180. #    SHARED
  181. #    ${demo_media_plugin_SOURCE_FILES}
  182. #)
  183. #
  184. #target_link_libraries(demo_media_plugin
  185. #  ${LLPLUGIN_LIBRARIES}
  186. #  ${LLCOMMON_LIBRARIES}
  187. #  ${PLUGIN_API_WINDOWS_LIBRARIES}
  188. #)
  189. #
  190. #add_dependencies(demo_media_plugin
  191. #  ${LLPLUGIN_LIBRARIES}
  192. #  ${LLCOMMON_LIBRARIES}
  193. #)
  194. #
  195. #if (DARWIN)
  196. #  # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name
  197. #  set_target_properties(
  198. #    demo_media_plugin
  199. #    PROPERTIES
  200. #    PREFIX ""
  201. #    BUILD_WITH_INSTALL_RPATH 1
  202. #    INSTALL_NAME_DIR "@executable_path"
  203. #  )
  204. #endif (DARWIN)
  205. ### demo_media_plugin_2
  206. #set(demo_media_plugin_2_SOURCE_FILES
  207. #    demo_media_plugin_2.cpp
  208. #    )
  209. #
  210. #add_library(demo_media_plugin_2
  211. #    SHARED
  212. #    ${demo_media_plugin_2_SOURCE_FILES}
  213. #)
  214. #
  215. #target_link_libraries(demo_media_plugin_2
  216. #  ${LLPLUGIN_LIBRARIES}
  217. #  ${LLCOMMON_LIBRARIES}
  218. #  ${PLUGIN_API_WINDOWS_LIBRARIES}
  219. #)
  220. #
  221. #add_dependencies(demo_media_plugin_2
  222. #  ${LLPLUGIN_LIBRARIES}
  223. #  ${LLCOMMON_LIBRARIES}
  224. #)
  225. #
  226. #if (DARWIN)
  227. #  # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name
  228. #  set_target_properties(
  229. #    demo_media_plugin_2
  230. #    PROPERTIES
  231. #    PREFIX ""
  232. #    BUILD_WITH_INSTALL_RPATH 1
  233. #    INSTALL_NAME_DIR "@executable_path"
  234. #  )
  235. #endif (DARWIN)
  236. ### llmediaplugintest
  237. set(llmediaplugintest_SOURCE_FILES
  238.     llmediaplugintest.cpp
  239.     llmediaplugintest.h
  240.     bookmarks.txt
  241.     )
  242. add_executable(llmediaplugintest
  243.     WIN32
  244.     MACOSX_BUNDLE
  245.     ${llmediaplugintest_SOURCE_FILES}
  246. )
  247. set_target_properties(llmediaplugintest
  248.     PROPERTIES
  249.     WIN32_EXECUTABLE
  250.     FALSE
  251. )
  252. target_link_libraries(llmediaplugintest
  253.   ${GLUT_LIBRARY}
  254.   ${GLUI_LIBRARY}
  255.   ${OPENGL_LIBRARIES}
  256.   ${LLPLUGIN_LIBRARIES}
  257.   ${LLMESSAGE_LIBRARIES}
  258.   ${LLCOMMON_LIBRARIES}
  259.   ${PLUGIN_API_WINDOWS_LIBRARIES}
  260. )
  261. if (DARWIN)
  262.   # The testbed needs to use a couple of CoreFoundation calls now, to deal with being a bundled app.
  263.   target_link_libraries(llmediaplugintest
  264.     ${COREFOUNDATION_LIBRARY}
  265.   )
  266. endif (DARWIN)
  267. add_dependencies(llmediaplugintest
  268.   stage_third_party_libs
  269.   SLPlugin
  270.   media_plugin_quicktime
  271.   media_plugin_webkit
  272.   media_plugin_example
  273.   ${LLPLUGIN_LIBRARIES}
  274.   ${LLMESSAGE_LIBRARIES}
  275.   ${LLCOMMON_LIBRARIES}
  276. )
  277. # turn off weird GLUI pragma 
  278. add_definitions(-DGLUI_NO_LIB_PRAGMA)
  279. if (DARWIN OR LINUX)
  280.   # glui.h contains code that triggers the "overloaded-virtual" warning in gcc.  
  281.   set_source_files_properties(llmediaplugintest.cpp PROPERTIES COMPILE_FLAGS "-Wno-overloaded-virtual")
  282. endif (DARWIN OR LINUX)
  283. # Gather build products of the various dependencies into the build directory for the testbed.
  284. if (DARWIN)
  285.   # path inside the app bundle where we'll need to copy plugins and other related files
  286.   set(PLUGINS_DESTINATION_DIR
  287.     ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llmediaplugintest.app/Contents/Resources
  288.   )
  289.   
  290.   # create the Contents/Resources directory
  291.   add_custom_command(
  292.     TARGET llmediaplugintest POST_BUILD
  293.     COMMAND ${CMAKE_COMMAND}
  294.     ARGS
  295.       -E
  296.       make_directory
  297.       ${PLUGINS_DESTINATION_DIR}
  298.     COMMENT "Creating Resources directory in app bundle."
  299.   ) 
  300. else (DARWIN)
  301.   set(PLUGINS_DESTINATION_DIR
  302.     ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/
  303.   )
  304. endif (DARWIN)
  305. get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION)
  306. add_custom_command(TARGET llmediaplugintest POST_BUILD
  307.   COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN}  ${PLUGINS_DESTINATION_DIR}
  308.   DEPENDS ${BUILT_SLPLUGIN}
  309. )
  310. get_target_property(BUILT_LLCOMMON llcommon LOCATION)
  311. add_custom_command(TARGET llmediaplugintest POST_BUILD
  312.   COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON}  ${PLUGINS_DESTINATION_DIR}
  313.   DEPENDS ${BUILT_LLCOMMON}
  314. )
  315. if (DARWIN OR WINDOWS)
  316.   get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
  317.   add_custom_command(TARGET llmediaplugintest POST_BUILD
  318.     COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN}  ${PLUGINS_DESTINATION_DIR}
  319.     DEPENDS ${BUILT_WEBKIT_PLUGIN}
  320.   )
  321.   get_target_property(BUILT_QUICKTIME_PLUGIN media_plugin_quicktime LOCATION)
  322.   add_custom_command(TARGET llmediaplugintest POST_BUILD
  323.     COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_QUICKTIME_PLUGIN}  ${PLUGINS_DESTINATION_DIR}
  324.     DEPENDS ${BUILT_QUICKTIME_PLUGIN}
  325.   )
  326.   
  327.   get_target_property(BUILT_EXAMPLE_PLUGIN media_plugin_example LOCATION)
  328.   add_custom_command(TARGET llmediaplugintest POST_BUILD
  329.     COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_EXAMPLE_PLUGIN}  ${PLUGINS_DESTINATION_DIR}
  330.     DEPENDS ${BUILT_EXAMPLE_PLUGIN}
  331.   )
  332.   
  333.   # copy over bookmarks file if llmediaplugintest gets built
  334.   get_target_property(BUILT_LLMEDIAPLUGINTEST llmediaplugintest LOCATION)
  335.   add_custom_command(TARGET llmediaplugintest POST_BUILD
  336.     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/
  337.     DEPENDS ${BUILT_LLMEDIAPLUGINTEST}
  338.   )
  339.   # also copy it to the same place as SLPlugin, which is what the mac wants...
  340.   add_custom_command(TARGET llmediaplugintest POST_BUILD
  341.     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${PLUGINS_DESTINATION_DIR}
  342.     DEPENDS ${BUILT_LLMEDIAPLUGINTEST}
  343.   )
  344. endif (DARWIN OR WINDOWS)
  345. if (DARWIN)
  346.   add_custom_command(TARGET llmediaplugintest POST_BUILD
  347.     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib ${PLUGINS_DESTINATION_DIR}
  348.     DEPENDS ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib
  349.   )
  350. endif (DARWIN)
  351. if(WINDOWS)
  352.   #********************
  353.   # Plugin test library deploy
  354.   #
  355.   # Debug config runtime files required for the plugin test mule
  356.   set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
  357.   set(plugintest_debug_files
  358.     libeay32.dll
  359.     libglib-2.0-0.dll
  360.     libgmodule-2.0-0.dll
  361.     libgobject-2.0-0.dll
  362.     libgthread-2.0-0.dll
  363.     qtcored4.dll
  364.     qtguid4.dll
  365.     qtnetworkd4.dll
  366.     qtopengld4.dll
  367.     qtwebkitd4.dll
  368.     ssleay32.dll
  369.     )
  370.   copy_if_different(
  371.     ${plugintest_debug_src_dir}
  372.     "${CMAKE_CURRENT_BINARY_DIR}/Debug"
  373.     out_targets
  374.     ${plugintest_debug_files}
  375.     )
  376.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  377.   
  378.   # Debug config runtime files required for the plugin test mule (Qt image format plugins)
  379.   set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug/imageformats")
  380.   set(plugintest_debug_files
  381.     qgifd4.dll
  382.     qicod4.dll
  383.     qjpegd4.dll
  384.     qmngd4.dll
  385.     qsvgd4.dll
  386.     qtiffd4.dll
  387.     )
  388.   copy_if_different(
  389.     ${plugintest_debug_src_dir}
  390.     "${CMAKE_CURRENT_BINARY_DIR}/Debug/imageformats"
  391.     out_targets
  392.     ${plugintest_debug_files}
  393.     )
  394.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  395.   # Debug config runtime files required for the plugin test mule (Qt codec plugins)
  396.   set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug/codecs")
  397.   set(plugintest_debug_files
  398.     qcncodecsd4.dll
  399.     qjpcodecsd4.dll
  400.     qkrcodecsd4.dll
  401.     qtwcodecsd4.dll
  402.     )
  403.   copy_if_different(
  404.     ${plugintest_debug_src_dir}
  405.     "${CMAKE_CURRENT_BINARY_DIR}/Debug/codecs"
  406.     out_targets
  407.     ${plugintest_debug_files}
  408.     )
  409.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  410.  
  411.   # Release & ReleaseDebInfo config runtime files required for the plugin test mule
  412.   set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
  413.   set(plugintest_release_files
  414.     libeay32.dll
  415.     libglib-2.0-0.dll
  416.     libgmodule-2.0-0.dll
  417.     libgobject-2.0-0.dll
  418.     libgthread-2.0-0.dll
  419.     qtcore4.dll
  420.     qtgui4.dll
  421.     qtnetwork4.dll
  422.     qtopengl4.dll
  423.     qtwebkit4.dll
  424.     qtxmlpatterns4.dll
  425.     ssleay32.dll
  426.     )
  427.   copy_if_different(
  428.     ${plugintest_release_src_dir}
  429.     "${CMAKE_CURRENT_BINARY_DIR}/Release"
  430.     out_targets
  431.     ${plugintest_release_files}
  432.     )
  433.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  434.   copy_if_different(
  435.     ${plugintest_release_src_dir}
  436.     "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
  437.     out_targets
  438.     ${plugintest_release_files}
  439.     )
  440.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  441.   # Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
  442.   set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release/imageformats")
  443.   set(plugintest_release_files
  444.     qgif4.dll
  445.     qico4.dll
  446.     qjpeg4.dll
  447.     qmng4.dll
  448.     qsvg4.dll
  449.     qtiff4.dll
  450.     )
  451.   copy_if_different(
  452.     ${plugintest_release_src_dir}
  453.     "${CMAKE_CURRENT_BINARY_DIR}/Release/imageformats"
  454.     out_targets
  455.     ${plugintest_release_files}
  456.     )
  457.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  458.   copy_if_different(
  459.     ${plugintest_release_src_dir}
  460.     "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/imageformats"
  461.     out_targets
  462.     ${plugintest_release_files}
  463.     )
  464.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  465.   # Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt codec plugins)
  466.   set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release/codecs")
  467.   set(plugintest_release_files
  468.     qcncodecs4.dll  
  469.     qjpcodecs4.dll  
  470.     qkrcodecs4.dll  
  471.     qtwcodecs4.dll  
  472.     )
  473.   copy_if_different(
  474.     ${plugintest_release_src_dir}
  475.     "${CMAKE_CURRENT_BINARY_DIR}/Release/codecs"
  476.     out_targets
  477.     ${plugintest_release_files}
  478.     )
  479.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  480.   copy_if_different(
  481.     ${plugintest_release_src_dir}
  482.     "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/codecs"
  483.     out_targets
  484.     ${plugintest_release_files}
  485.     )
  486.   set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  487.  
  488.    add_custom_target(copy_plugintest_libs ALL
  489.      DEPENDS 
  490.      ${plugin_test_targets}
  491.      )
  492.   add_dependencies(llmediaplugintest copy_plugintest_libs)
  493. endif(WINDOWS)
  494. ll_deploy_sharedlibs_command(llmediaplugintest)