Files
SingularityViewer/indra/cmake/CopyWinLibs.cmake.in

239 lines
7.5 KiB
CMake

# -*- cmake -*-
# The copy_win_libs folder contains file lists and a script used to
# copy dlls, exes and such needed to run the SecondLife from within
# VisualStudio.
set(LIBS_PREBUILT_DIR "@LIBS_PREBUILT_DIR@")
set(LIBS_PREBUILT_LEGACY_DIR "@LIBS_PREBUILT_LEGACY_DIR@")
set(FMODSTUDIO_SDK_DIR "@FMODSTUDIO_SDK_DIR@")
set(FMODEX_SDK_DIR "@FMODEX_SDK_DIR@")
set(FMODSTUDIO @FMODSTUDIO@)
set(FMODEX @FMODEX@)
set(MSVC10 "@MSVC10@")
set(WORD_SIZE "@WORD_SIZE@")
set(LIBS_RELEASE_DIR
${LIBS_PREBUILT_DIR}/lib/release
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
)
set(LIBS_DEBUG_DIR
${LIBS_PREBUILT_DIR}/lib/debug
${LIBS_PREBUILT_LEGACY_DIR}/lib/debug
)
function(copy_files paths names dest)
foreach(f ${names})
foreach(p ${paths})
set(from_file "${p}/${f}")
set(to_dest "${CMAKE_BINARY_DIR}/newview/${dest}")
if(EXISTS ${from_file})
message("Copying ${from_file} to ${to_dest}")
if(NOT EXISTS ${to_dest})
execute_process(COMMAND mkdir -p "${to_dest}")
endif(NOT EXISTS ${to_dest})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${from_file} ${to_dest} RESULT_VARIABLE result)
if(${result})
message(SEND_ERROR "Unsuccessful.")
endif(${result})
set(found 1)
break()
endif(EXISTS ${from_file})
endforeach(p)
if(NOT found)
message(SEND_ERROR "Failed to find library: ${f}")
endif(NOT found)
endforeach(f)
endfunction(copy_files)
set(vivox_files
ca-bundle.crt
libsndfile-1.dll
ortp.dll
SLVoice.exe
vivoxoal.dll
vivoxplatform.dll
vivoxsdk.dll
zlib1.dll
)
copy_files("${LIBS_RELEASE_DIR}" "${vivox_files}" "Release" )
copy_files("${LIBS_RELEASE_DIR}" "${vivox_files}" "RelWithDebInfo")
copy_files("${LIBS_DEBUG_DIR}" "${vivox_files}" "Debug")
set(release_files
libhunspell.dll
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
libeay32.dll
ssleay32.dll
glod.dll
qtcore4.dll
)
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "Release")
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "RelWithDebInfo")
copy_files("${LIBS_DEBUG_DIR}" "${release_files}" "Debug")
if(MSVC10)
copy_files("${LIBS_DEBUG_DIR}" "libcollada14dom22-d.dll" "Debug")
endif(MSVC10)
if(WORD_SIZE EQUAL 32)
set(release_files
libcollada14dom22.dll
libtcmalloc_minimal.dll
)
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "Release")
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "RelWithDebInfo")
endif(WORD_SIZE EQUAL 32)
set(plugins_release_files
libeay32.dll
qtcore4.dll
qtgui4.dll
qtnetwork4.dll
qtopengl4.dll
qtwebkit4.dll
ssleay32.dll
qtxmlpatterns4.dll
)
copy_files("${LIBS_RELEASE_DIR}" "${plugins_release_files}" "Release/llplugin")
copy_files("${LIBS_RELEASE_DIR}" "${plugins_release_files}" "RelWithDebInfo/llplugin")
if(0)
copy_files("${LIBS_RELEASE_DIR}" "${plugin_release_files}" "../test_apps/llplugintest/Release")
copy_files("${LIBS_RELEASE_DIR}" "${plugin_release_files}" "../test_apps/llplugintest/RelWithDebInfo")
endif(0)
# Debug config runtime files required for the plugins
set(plugins_debug_files
libeay32.dll
qtcored4.dll
qtguid4.dll
qtnetworkd4.dll
qtopengld4.dll
qtwebkitd4.dll
ssleay32.dll
qtxmlpatternsd4.dll
)
copy_files("${LIBS_DEBUG_DIR}" "${plugins_debug_files}" "Debug/llplugin")
if(0)
copy_files("${LIBS_DEBUG_DIR}" "${plugins_debug_files}" "../test_apps/llplugintest/Debug")
endif(0)
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
set(plugin_image_release_files
qgif4.dll
qico4.dll
qjpeg4.dll
qmng4.dll
qsvg4.dll
qtiff4.dll
)
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "Release/llplugin/imageformats")
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "RelWithDebInfo/llplugin/imageformats")
if(0)
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "../test_apps/llplugintest/imageformats/Release")
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "../test_apps/llplugintest/imageformats/RelWithDebInfo")
endif(0)
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
set(plugin_image_debug_files
qgifd4.dll
qicod4.dll
qjpegd4.dll
qmngd4.dll
qsvgd4.dll
qtiffd4.dll
)
copy_files("${LIBS_DEBUG_DIR}/imageformats" "${plugin_image_debug_files}" "Debug/llplugin/imageformats")
if(0)
copy_files("${LIBS_DEBUG_DIR}/imageformats" "${plugin_image_debug_files}" "../test_apps/llplugintest/imageformats/Debug")
endif(0)
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
set(plugin_codec_release_files
qcncodecs4.dll
qjpcodecs4.dll
qkrcodecs4.dll
qtwcodecs4.dll
)
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "Release/llplugin/codecs")
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "RelWithDebInfo/llplugin/codecs")
if(0)
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "../test_apps/llplugintest/codecs/Release")
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "../test_apps/llplugintest/codecs/RelWithDebInfo")
endif(0)
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
set(plugin_codec_debug_files
qcncodecsd4.dll
qjpcodecsd4.dll
qkrcodecsd4.dll
qtwcodecsd4.dll
)
copy_files("${LIBS_DEBUG_DIR}/codecs" "${plugin_codec_debug_files}" "Debug/llplugin/codecs")
if(0)
copy_files("${LIBS_DEBUG_DIR}/codecs" "${plugin_codec_debug_files}" "../test_apps/llplugintest/codecs/Debug")
endif(0)
if(FMODSTUDIO)
if (WORD_SIZE EQUAL 32)
set(fmodstudio_dll_file "fmod.dll")
else (WORD_SIZE EQUAL 32)
set(fmodstudio_dll_file "fmod64.dll")
endif (WORD_SIZE EQUAL 32)
find_path(FMODSTUDIO_BINARY_RELEASE_DIR "${fmodstudio_dll_file}"
${LIBS_RELEASE_DIR}
"${FMODSTUDIO_SDK_DIR}/api/lowlevel/lib"
"${FMODSTUDIO_SDK_DIR}"
NO_DEFAULT_PATH
)
find_path(FMODSTUDIO_BINARY_DEBUG_DIR "${fmodstudio_dll_file}"
${LIBS_DEBUG_DIR}
"${FMODSTUDIO_SDK_DIR}/api/lowlevel/lib"
"${FMODSTUDIO_SDK_DIR}"
NO_DEFAULT_PATH
)
if(FMODSTUDIO_BINARY_RELEASE_DIR)
copy_files(${FMODSTUDIO_BINARY_RELEASE_DIR} ${fmodstudio_dll_file} "Release")
copy_files(${FMODSTUDIO_BINARY_RELEASE_DIR} ${fmodstudio_dll_file} "RelWithDebInfo")
endif(FMODSTUDIO_BINARY_RELEASE_DIR)
if(FMODSTUDIO_BINARY_DEBUG_DIR)
copy_files(${FMODSTUDIO_BINARY_DEBUG_DIR} ${fmodstudio_dll_file} "Debug")
endif(FMODSTUDIO_BINARY_DEBUG_DIR)
endif(FMODSTUDIO)
if(FMODEX)
if (WORD_SIZE EQUAL 32)
set(fmodex_dll_file "fmodex.dll")
else (WORD_SIZE EQUAL 32)
set(fmodex_dll_file "fmodex64.dll")
endif (WORD_SIZE EQUAL 32)
find_path(FMODEX_BINARY_RELEASE_DIR "${fmodex_dll_file}"
${LIBS_RELEASE_DIR}
"${FMODEX_SDK_DIR}/api"
"${FMODEX_SDK_DIR}"
NO_DEFAULT_PATH
)
find_path(FMODEX_BINARY_DEBUG_DIR "${fmodex_dll_file}"
${LIBS_DEBUG_DIR}
"${FMODSTUDIO_SDK_DIR}/api"
"${FMODSTUDIO_SDK_DIR}"
NO_DEFAULT_PATH
)
if(FMODEX_BINARY_RELEASE_DIR)
copy_files(${FMODEX_BINARY_RELEASE_DIR ${fmodex_dll_file} "Release")
copy_files(${FMODEX_BINARY_RELEASE_DIR ${fmodex_dll_file} "RelWithDebInfo")
endif(FMODEX_BINARY_RELEASE_DIR)
if(FMODEX_BINARY_DEBUG_DIR)
copy_files(${FMODEX_BINARY_DEBUG_DIR ${fmodex_dll_file} "Debug")
endif(FMODEX_BINARY_DEBUG_DIR)
endif(FMODEX)