PageRenderTime 40ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/test_apps/llplugintest/CMakeLists.txt

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 538 lines | 263 code | 50 blank | 225 comment | 8 complexity | 8e576bd77996348f3625456d2dd8d0af MD5 | raw file
Possible License(s): LGPL-2.1
  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. # create the Contents/Resources directory
  290. add_custom_command(
  291. TARGET llmediaplugintest POST_BUILD
  292. COMMAND ${CMAKE_COMMAND}
  293. ARGS
  294. -E
  295. make_directory
  296. ${PLUGINS_DESTINATION_DIR}
  297. COMMENT "Creating Resources directory in app bundle."
  298. )
  299. else (DARWIN)
  300. set(PLUGINS_DESTINATION_DIR
  301. ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/
  302. )
  303. endif (DARWIN)
  304. get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION)
  305. add_custom_command(TARGET llmediaplugintest POST_BUILD
  306. COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN} ${PLUGINS_DESTINATION_DIR}
  307. DEPENDS ${BUILT_SLPLUGIN}
  308. )
  309. get_target_property(BUILT_LLCOMMON llcommon LOCATION)
  310. add_custom_command(TARGET llmediaplugintest POST_BUILD
  311. COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON} ${PLUGINS_DESTINATION_DIR}
  312. DEPENDS ${BUILT_LLCOMMON}
  313. )
  314. if (DARWIN OR WINDOWS)
  315. get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
  316. add_custom_command(TARGET llmediaplugintest POST_BUILD
  317. COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${PLUGINS_DESTINATION_DIR}
  318. DEPENDS ${BUILT_WEBKIT_PLUGIN}
  319. )
  320. get_target_property(BUILT_QUICKTIME_PLUGIN media_plugin_quicktime LOCATION)
  321. add_custom_command(TARGET llmediaplugintest POST_BUILD
  322. COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_QUICKTIME_PLUGIN} ${PLUGINS_DESTINATION_DIR}
  323. DEPENDS ${BUILT_QUICKTIME_PLUGIN}
  324. )
  325. get_target_property(BUILT_EXAMPLE_PLUGIN media_plugin_example LOCATION)
  326. add_custom_command(TARGET llmediaplugintest POST_BUILD
  327. COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_EXAMPLE_PLUGIN} ${PLUGINS_DESTINATION_DIR}
  328. DEPENDS ${BUILT_EXAMPLE_PLUGIN}
  329. )
  330. # copy over bookmarks file if llmediaplugintest gets built
  331. get_target_property(BUILT_LLMEDIAPLUGINTEST llmediaplugintest LOCATION)
  332. add_custom_command(TARGET llmediaplugintest POST_BUILD
  333. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/
  334. DEPENDS ${BUILT_LLMEDIAPLUGINTEST}
  335. )
  336. # also copy it to the same place as SLPlugin, which is what the mac wants...
  337. add_custom_command(TARGET llmediaplugintest POST_BUILD
  338. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${PLUGINS_DESTINATION_DIR}
  339. DEPENDS ${BUILT_LLMEDIAPLUGINTEST}
  340. )
  341. endif (DARWIN OR WINDOWS)
  342. if (DARWIN)
  343. add_custom_command(TARGET llmediaplugintest POST_BUILD
  344. COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ${PLUGINS_DESTINATION_DIR}
  345. DEPENDS ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
  346. )
  347. endif (DARWIN)
  348. if(WINDOWS)
  349. #********************
  350. # Plugin test library deploy
  351. #
  352. # Debug config runtime files required for the plugin test mule
  353. set(plugintest_debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
  354. set(plugintest_debug_files
  355. libeay32.dll
  356. libglib-2.0-0.dll
  357. libgmodule-2.0-0.dll
  358. libgobject-2.0-0.dll
  359. libgthread-2.0-0.dll
  360. qtcored4.dll
  361. qtguid4.dll
  362. qtnetworkd4.dll
  363. qtopengld4.dll
  364. qtwebkitd4.dll
  365. ssleay32.dll
  366. )
  367. copy_if_different(
  368. ${plugintest_debug_src_dir}
  369. "${CMAKE_CURRENT_BINARY_DIR}/Debug"
  370. out_targets
  371. ${plugintest_debug_files}
  372. )
  373. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  374. # Debug config runtime files required for the plugin test mule (Qt image format plugins)
  375. set(plugintest_debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}/imageformats")
  376. set(plugintest_debug_files
  377. qgifd4.dll
  378. qicod4.dll
  379. qjpegd4.dll
  380. qmngd4.dll
  381. qsvgd4.dll
  382. qtiffd4.dll
  383. )
  384. copy_if_different(
  385. ${plugintest_debug_src_dir}
  386. "${CMAKE_CURRENT_BINARY_DIR}/Debug/imageformats"
  387. out_targets
  388. ${plugintest_debug_files}
  389. )
  390. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  391. # Debug config runtime files required for the plugin test mule (Qt codec plugins)
  392. set(plugintest_debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}/codecs")
  393. set(plugintest_debug_files
  394. qcncodecsd4.dll
  395. qjpcodecsd4.dll
  396. qkrcodecsd4.dll
  397. qtwcodecsd4.dll
  398. )
  399. copy_if_different(
  400. ${plugintest_debug_src_dir}
  401. "${CMAKE_CURRENT_BINARY_DIR}/Debug/codecs"
  402. out_targets
  403. ${plugintest_debug_files}
  404. )
  405. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  406. # Release & ReleaseDebInfo config runtime files required for the plugin test mule
  407. set(plugintest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
  408. set(plugintest_release_files
  409. libeay32.dll
  410. libglib-2.0-0.dll
  411. libgmodule-2.0-0.dll
  412. libgobject-2.0-0.dll
  413. libgthread-2.0-0.dll
  414. qtcore4.dll
  415. qtgui4.dll
  416. qtnetwork4.dll
  417. qtopengl4.dll
  418. qtwebkit4.dll
  419. qtxmlpatterns4.dll
  420. ssleay32.dll
  421. )
  422. copy_if_different(
  423. ${plugintest_release_src_dir}
  424. "${CMAKE_CURRENT_BINARY_DIR}/Release"
  425. out_targets
  426. ${plugintest_release_files}
  427. )
  428. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  429. copy_if_different(
  430. ${plugintest_release_src_dir}
  431. "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
  432. out_targets
  433. ${plugintest_release_files}
  434. )
  435. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  436. # Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
  437. set(plugintest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}/imageformats")
  438. set(plugintest_release_files
  439. qgif4.dll
  440. qico4.dll
  441. qjpeg4.dll
  442. qmng4.dll
  443. qsvg4.dll
  444. qtiff4.dll
  445. )
  446. copy_if_different(
  447. ${plugintest_release_src_dir}
  448. "${CMAKE_CURRENT_BINARY_DIR}/Release/imageformats"
  449. out_targets
  450. ${plugintest_release_files}
  451. )
  452. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  453. copy_if_different(
  454. ${plugintest_release_src_dir}
  455. "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/imageformats"
  456. out_targets
  457. ${plugintest_release_files}
  458. )
  459. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  460. # Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt codec plugins)
  461. set(plugintest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}/codecs")
  462. set(plugintest_release_files
  463. qcncodecs4.dll
  464. qjpcodecs4.dll
  465. qkrcodecs4.dll
  466. qtwcodecs4.dll
  467. )
  468. copy_if_different(
  469. ${plugintest_release_src_dir}
  470. "${CMAKE_CURRENT_BINARY_DIR}/Release/codecs"
  471. out_targets
  472. ${plugintest_release_files}
  473. )
  474. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  475. copy_if_different(
  476. ${plugintest_release_src_dir}
  477. "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/codecs"
  478. out_targets
  479. ${plugintest_release_files}
  480. )
  481. set(plugin_test_targets ${plugin_test_targets} ${out_targets})
  482. add_custom_target(copy_plugintest_libs ALL
  483. DEPENDS
  484. ${plugin_test_targets}
  485. )
  486. add_dependencies(llmediaplugintest copy_plugintest_libs)
  487. endif(WINDOWS)
  488. ll_deploy_sharedlibs_command(llmediaplugintest)