PageRenderTime 37ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/cmake/Copy3rdPartyLibs.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 388 lines | 312 code | 47 blank | 29 comment | 12 complexity | 10ed2f1c8299b1f8b51ce156feaf2d29 MD5 | raw file
Possible License(s): LGPL-2.1
  1. # -*- cmake -*-
  2. # The copy_win_libs folder contains file lists and a script used to
  3. # copy dlls, exes and such needed to run the SecondLife from within
  4. # VisualStudio.
  5. include(CMakeCopyIfDifferent)
  6. include(Linking)
  7. ###################################################################
  8. # set up platform specific lists of files that need to be copied
  9. ###################################################################
  10. if(WINDOWS)
  11. set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug")
  12. set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
  13. set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release")
  14. #*******************************
  15. # VIVOX - *NOTE: no debug version
  16. set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
  17. set(vivox_files
  18. SLVoice.exe
  19. libsndfile-1.dll
  20. vivoxplatform.dll
  21. vivoxsdk.dll
  22. ortp.dll
  23. zlib1.dll
  24. vivoxoal.dll
  25. )
  26. #*******************************
  27. # Misc shared libs
  28. set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
  29. set(debug_files
  30. openjpegd.dll
  31. libapr-1.dll
  32. libaprutil-1.dll
  33. libapriconv-1.dll
  34. ssleay32.dll
  35. libeay32.dll
  36. libcollada14dom22-d.dll
  37. glod.dll
  38. )
  39. set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
  40. set(release_files
  41. openjpeg.dll
  42. libapr-1.dll
  43. libaprutil-1.dll
  44. libapriconv-1.dll
  45. ssleay32.dll
  46. libeay32.dll
  47. libcollada14dom22.dll
  48. glod.dll
  49. )
  50. if(USE_GOOGLE_PERFTOOLS)
  51. set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
  52. set(release_files ${release_files} libtcmalloc_minimal.dll)
  53. endif(USE_GOOGLE_PERFTOOLS)
  54. if (FMOD)
  55. set(debug_files ${debug_files} fmod.dll)
  56. set(release_files ${release_files} fmod.dll)
  57. endif (FMOD)
  58. #*******************************
  59. # Copy MS C runtime dlls, required for packaging.
  60. # *TODO - Adapt this to support VC9
  61. if (MSVC80)
  62. FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
  63. PATHS
  64. ${MSVC_DEBUG_REDIST_PATH}
  65. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
  66. NO_DEFAULT_PATH
  67. NO_DEFAULT_PATH
  68. )
  69. if(EXISTS ${debug_msvc8_redist_path})
  70. set(debug_msvc8_files
  71. msvcr80d.dll
  72. msvcp80d.dll
  73. Microsoft.VC80.DebugCRT.manifest
  74. )
  75. copy_if_different(
  76. ${debug_msvc8_redist_path}
  77. "${SHARED_LIB_STAGING_DIR_DEBUG}"
  78. out_targets
  79. ${debug_msvc8_files}
  80. )
  81. set(third_party_targets ${third_party_targets} ${out_targets})
  82. endif (EXISTS ${debug_msvc8_redist_path})
  83. FIND_PATH(release_msvc8_redist_path msvcr80.dll
  84. PATHS
  85. ${MSVC_REDIST_PATH}
  86. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
  87. NO_DEFAULT_PATH
  88. NO_DEFAULT_PATH
  89. )
  90. if(EXISTS ${release_msvc8_redist_path})
  91. set(release_msvc8_files
  92. msvcr80.dll
  93. msvcp80.dll
  94. Microsoft.VC80.CRT.manifest
  95. )
  96. copy_if_different(
  97. ${release_msvc8_redist_path}
  98. "${SHARED_LIB_STAGING_DIR_RELEASE}"
  99. out_targets
  100. ${release_msvc8_files}
  101. )
  102. set(third_party_targets ${third_party_targets} ${out_targets})
  103. copy_if_different(
  104. ${release_msvc8_redist_path}
  105. "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
  106. out_targets
  107. ${release_msvc8_files}
  108. )
  109. set(third_party_targets ${third_party_targets} ${out_targets})
  110. endif (EXISTS ${release_msvc8_redist_path})
  111. elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010
  112. FIND_PATH(debug_msvc10_redist_path msvcr100d.dll
  113. PATHS
  114. ${MSVC_DEBUG_REDIST_PATH}
  115. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC100.DebugCRT
  116. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
  117. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
  118. NO_DEFAULT_PATH
  119. )
  120. if(EXISTS ${debug_msvc10_redist_path})
  121. set(debug_msvc10_files
  122. msvcr100d.dll
  123. msvcp100d.dll
  124. )
  125. copy_if_different(
  126. ${debug_msvc10_redist_path}
  127. "${SHARED_LIB_STAGING_DIR_DEBUG}"
  128. out_targets
  129. ${debug_msvc10_files}
  130. )
  131. set(third_party_targets ${third_party_targets} ${out_targets})
  132. endif ()
  133. FIND_PATH(release_msvc10_redist_path msvcr100.dll
  134. PATHS
  135. ${MSVC_REDIST_PATH}
  136. [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC100.CRT
  137. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
  138. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
  139. NO_DEFAULT_PATH
  140. )
  141. if(EXISTS ${release_msvc10_redist_path})
  142. set(release_msvc10_files
  143. msvcr100.dll
  144. msvcp100.dll
  145. )
  146. copy_if_different(
  147. ${release_msvc10_redist_path}
  148. "${SHARED_LIB_STAGING_DIR_RELEASE}"
  149. out_targets
  150. ${release_msvc10_files}
  151. )
  152. set(third_party_targets ${third_party_targets} ${out_targets})
  153. copy_if_different(
  154. ${release_msvc10_redist_path}
  155. "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
  156. out_targets
  157. ${release_msvc10_files}
  158. )
  159. set(third_party_targets ${third_party_targets} ${out_targets})
  160. endif ()
  161. endif (MSVC80)
  162. elseif(DARWIN)
  163. set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
  164. set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
  165. set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release/Resources")
  166. set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
  167. set(vivox_files
  168. SLVoice
  169. libsndfile.dylib
  170. libvivoxoal.dylib
  171. libortp.dylib
  172. libvivoxplatform.dylib
  173. libvivoxsdk.dylib
  174. )
  175. set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
  176. set(debug_files
  177. )
  178. set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
  179. set(release_files
  180. libapr-1.0.dylib
  181. libapr-1.dylib
  182. libaprutil-1.0.dylib
  183. libaprutil-1.dylib
  184. libexpat.1.5.2.dylib
  185. libexpat.dylib
  186. libGLOD.dylib
  187. libllqtwebkit.dylib
  188. libminizip.a
  189. libndofdev.dylib
  190. libexception_handler.dylib
  191. libcollada14dom.dylib
  192. )
  193. # fmod is statically linked on darwin
  194. set(fmod_files "")
  195. elseif(LINUX)
  196. # linux is weird, multiple side by side configurations aren't supported
  197. # and we don't seem to have any debug shared libs built yet anyways...
  198. set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}")
  199. set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}")
  200. set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}")
  201. set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
  202. set(vivox_files
  203. libsndfile.so.1
  204. libortp.so
  205. libvivoxoal.so.1
  206. libvivoxplatform.so
  207. libvivoxsdk.so
  208. SLVoice
  209. )
  210. # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
  211. # or ARCH_PREBUILT_DIRS
  212. set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
  213. set(debug_files
  214. )
  215. # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
  216. # or ARCH_PREBUILT_DIRS
  217. set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
  218. # *FIX - figure out what to do with duplicate libalut.so here -brad
  219. set(release_files
  220. libapr-1.so.0
  221. libaprutil-1.so.0
  222. libatk-1.0.so
  223. libbreakpad_client.so.0
  224. libcollada14dom.so
  225. libcrypto.so.1.0.0
  226. libdb-5.1.so
  227. libexpat.so
  228. libexpat.so.1
  229. libglod.so
  230. libgmock_main.so
  231. libgmock.so.0
  232. libgmodule-2.0.so
  233. libgobject-2.0.so
  234. libgtest_main.so
  235. libgtest.so.0
  236. libminizip.so
  237. libopenal.so
  238. libopenjpeg.so
  239. libssl.so
  240. libtcmalloc_minimal.so
  241. libuuid.so.16
  242. libuuid.so.16.0.22
  243. libssl.so.1.0.0
  244. libfontconfig.so.1.4.4
  245. )
  246. if (FMOD)
  247. set(release_files ${release_files} "libfmod-3.75.so")
  248. endif (FMOD)
  249. else(WINDOWS)
  250. message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
  251. set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
  252. set(vivox_files "")
  253. # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
  254. # or ARCH_PREBUILT_DIRS
  255. set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
  256. set(debug_files "")
  257. # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
  258. # or ARCH_PREBUILT_DIRS
  259. set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
  260. set(release_files "")
  261. set(fmod_files "")
  262. set(debug_llkdu_src "")
  263. set(debug_llkdu_dst "")
  264. set(release_llkdu_src "")
  265. set(release_llkdu_dst "")
  266. set(relwithdebinfo_llkdu_dst "")
  267. endif(WINDOWS)
  268. ################################################################
  269. # Done building the file lists, now set up the copy commands.
  270. ################################################################
  271. copy_if_different(
  272. ${vivox_src_dir}
  273. "${SHARED_LIB_STAGING_DIR_DEBUG}"
  274. out_targets
  275. ${vivox_files}
  276. )
  277. set(third_party_targets ${third_party_targets} ${out_targets})
  278. copy_if_different(
  279. ${vivox_src_dir}
  280. "${SHARED_LIB_STAGING_DIR_RELEASE}"
  281. out_targets
  282. ${vivox_files}
  283. )
  284. set(third_party_targets ${third_party_targets} ${out_targets})
  285. copy_if_different(
  286. ${vivox_src_dir}
  287. "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
  288. out_targets
  289. ${vivox_files}
  290. )
  291. set(third_party_targets ${third_party_targets} ${out_targets})
  292. copy_if_different(
  293. ${debug_src_dir}
  294. "${SHARED_LIB_STAGING_DIR_DEBUG}"
  295. out_targets
  296. ${debug_files}
  297. )
  298. set(third_party_targets ${third_party_targets} ${out_targets})
  299. copy_if_different(
  300. ${release_src_dir}
  301. "${SHARED_LIB_STAGING_DIR_RELEASE}"
  302. out_targets
  303. ${release_files}
  304. )
  305. set(third_party_targets ${third_party_targets} ${out_targets})
  306. copy_if_different(
  307. ${release_src_dir}
  308. "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
  309. out_targets
  310. ${release_files}
  311. )
  312. set(third_party_targets ${third_party_targets} ${out_targets})
  313. if (FMOD_SDK_DIR)
  314. copy_if_different(
  315. ${FMOD_SDK_DIR}
  316. "${CMAKE_CURRENT_BINARY_DIR}/Debug"
  317. out_targets
  318. ${fmod_files}
  319. )
  320. set(all_targets ${all_targets} ${out_targets})
  321. copy_if_different(
  322. ${FMOD_SDK_DIR}
  323. "${CMAKE_CURRENT_BINARY_DIR}/Release"
  324. out_targets
  325. ${fmod_files}
  326. )
  327. set(all_targets ${all_targets} ${out_targets})
  328. copy_if_different(
  329. ${FMOD_SDK_DIR}
  330. "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo"
  331. out_targets
  332. ${fmod_files}
  333. )
  334. set(all_targets ${all_targets} ${out_targets})
  335. endif (FMOD_SDK_DIR)
  336. if(NOT STANDALONE)
  337. add_custom_target(
  338. stage_third_party_libs ALL
  339. DEPENDS ${third_party_targets}
  340. )
  341. endif(NOT STANDALONE)