PageRenderTime 30ms CodeModel.GetById 2ms app.highlight 17ms RepoModel.GetById 2ms app.codeStats 1ms

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