From a17ca8260aa4a1e414b6a19d3faeb18f914c3f31 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Mon, 26 Oct 2009 16:08:43 -0400 Subject: Beginning work for DEV-41722 normalizing shared lib staging on all 3 platforms. Renamed CopyWinLibs.cmake to Copy3rdPartyLibs.cmake. --- indra/cmake/CMakeLists.txt | 2 +- indra/cmake/Copy3rdPartyLibs.cmake | 223 +++++++++++++++++++++++++++++++++++++ indra/llcommon/CMakeLists.txt | 4 +- 3 files changed, 225 insertions(+), 4 deletions(-) create mode 100644 indra/cmake/Copy3rdPartyLibs.cmake diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 4563b59ad2..4fc25dcc24 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -16,7 +16,7 @@ set(cmake_SOURCE_FILES CARes.cmake CURL.cmake CMakeCopyIfDifferent.cmake - CopyWinLibs.cmake + Copy3rdPartyLibs.cmake CSharpMacros.cmake DBusGlib.cmake DirectX.cmake diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake new file mode 100644 index 0000000000..8f27c70610 --- /dev/null +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -0,0 +1,223 @@ +# -*- 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. + +include(CMakeCopyIfDifferent) + +if(WINDOWS) +#******************************* +# VIVOX - *NOTE: no debug version +set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") +set(vivox_files + SLVoice.exe + alut.dll + vivoxsdk.dll + ortp.dll + wrap_oal.dll + ) +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR}/Debug" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR}/Release" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +#******************************* +# Misc shared libs +set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") +set(debug_files + openjpegd.dll + libtcmalloc_minimal-debug.dll + libapr-1.dll + libaprutil-1.dll + libapriconv-1.dll + ) +if (FMOD_SDK_DIR) + set(fmod_files fmod.dll) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/Debug" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/Release" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) + copy_if_different( + ${FMOD_SDK_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo" + out_targets + ${fmod_files} + ) + set(all_targets ${all_targets} ${out_targets}) +endif (FMOD_SDK_DIR) + +copy_if_different( + ${debug_src_dir} + "${SHARED_LIB_STAGING_DIR}/Debug" + out_targets + ${debug_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") +set(release_files + openjpeg.dll + libtcmalloc_minimal.dll + libapr-1.dll + libaprutil-1.dll + libapriconv-1.dll + ) + +copy_if_different( + ${release_src_dir} + "${SHARED_LIB_STAGING_DIR}/Release" + out_targets + ${release_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${release_src_dir} + "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + out_targets + ${release_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +#******************************* +# LLKDU +set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") +if(NOT EXISTS ${internal_llkdu_path}) + if (EXISTS "${debug_src_dir}/llkdu.dll") + set(debug_llkdu_src "${debug_src_dir}/llkdu.dll") + set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Debug/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${debug_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst} + DEPENDS ${debug_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Debug" + ) + set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst}) + endif (EXISTS "${debug_src_dir}/llkdu.dll") + + if (EXISTS "${release_src_dir}/llkdu.dll") + set(release_llkdu_src "${release_src_dir}/llkdu.dll") + set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Release/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${release_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Release" + ) + set(third_party_targets ${third_party_targets} ${release_llkdu_dst}) + + set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/llkdu.dll") + ADD_CUSTOM_COMMAND( + OUTPUT ${relwithdebinfo_llkdu_dst} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst} + DEPENDS ${release_llkdu_src} + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + ) + set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst}) + endif (EXISTS "${release_src_dir}/llkdu.dll") + +endif (NOT EXISTS ${internal_llkdu_path}) + +#******************************* +# Copy MS C runtime dlls, required for packaging. +# *TODO - Adapt this to support VC9 +if (MSVC80) + FIND_PATH(debug_msvc8_redist_path msvcr80d.dll + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT + NO_DEFAULT_PATH + NO_DEFAULT_PATH + ) + + if(EXISTS ${debug_msvc8_redist_path}) + set(debug_msvc8_files + msvcr80d.dll + msvcp80d.dll + Microsoft.VC80.DebugCRT.manifest + ) + + copy_if_different( + ${debug_msvc8_redist_path} + "${SHARED_LIB_STAGING_DIR}/Debug" + out_targets + ${debug_msvc8_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + endif (EXISTS ${debug_msvc8_redist_path}) + + FIND_PATH(release_msvc8_redist_path msvcr80.dll + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT + NO_DEFAULT_PATH + NO_DEFAULT_PATH + ) + + if(EXISTS ${release_msvc8_redist_path}) + set(release_msvc8_files + msvcr80.dll + msvcp80.dll + Microsoft.VC80.CRT.manifest + ) + + copy_if_different( + ${release_msvc8_redist_path} + "${SHARED_LIB_STAGING_DIR}/Release" + out_targets + ${release_msvc8_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + copy_if_different( + ${release_msvc8_redist_path} + "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + out_targets + ${release_msvc8_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + endif (EXISTS ${release_msvc8_redist_path}) +endif (MSVC80) + +elseif(DARWIN) + +elseif(LINUX) + +else(WINDOWS) + message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...") +endif(WINDOWS) + +add_custom_target(stage_third_party_libs ALL + DEPENDS + ${third_party_targets} + ) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index e7aaf3c984..7a7281a4a7 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -8,9 +8,7 @@ include(Linking) include(Boost) include (Pth) -if (WINDOWS) - include(CopyWinLibs) -endif (WINDOWS) +include(Copy3rdPartyLibs) include_directories( ${EXPAT_INCLUDE_DIRS} -- cgit v1.2.3 From 89e3523052a9b1ac5534e3e30fa312ef11a78f69 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Mon, 26 Oct 2009 18:13:20 -0400 Subject: More work for DEV-41722 normalizing shared lib staging on all 3 platforms. Started refactoring Copy3rdPartyLibs.cmake to use common commands with platform specific variables. --- indra/cmake/Copy3rdPartyLibs.cmake | 177 +++++++++++++++++++++++-------------- 1 file changed, 111 insertions(+), 66 deletions(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 8f27c70610..cb8ed4f05f 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -7,6 +7,10 @@ include(CMakeCopyIfDifferent) if(WINDOWS) + set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug") + set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo") + set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release") + #******************************* # VIVOX - *NOTE: no debug version set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") @@ -17,32 +21,11 @@ set(vivox_files ortp.dll wrap_oal.dll ) -copy_if_different( - ${vivox_src_dir} - "${SHARED_LIB_STAGING_DIR}/Debug" - out_targets - ${vivox_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) - -copy_if_different( - ${vivox_src_dir} - "${SHARED_LIB_STAGING_DIR}/Release" - out_targets - ${vivox_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) - -copy_if_different( - ${vivox_src_dir} - "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" - out_targets - ${vivox_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) #******************************* # Misc shared libs + +# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") set(debug_files openjpegd.dll @@ -51,6 +34,17 @@ set(debug_files libaprutil-1.dll libapriconv-1.dll ) + +# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables +set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") +set(release_files + openjpeg.dll + libtcmalloc_minimal.dll + libapr-1.dll + libaprutil-1.dll + libapriconv-1.dll + ) + if (FMOD_SDK_DIR) set(fmod_files fmod.dll) copy_if_different( @@ -76,38 +70,6 @@ if (FMOD_SDK_DIR) set(all_targets ${all_targets} ${out_targets}) endif (FMOD_SDK_DIR) -copy_if_different( - ${debug_src_dir} - "${SHARED_LIB_STAGING_DIR}/Debug" - out_targets - ${debug_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) - -set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") -set(release_files - openjpeg.dll - libtcmalloc_minimal.dll - libapr-1.dll - libaprutil-1.dll - libapriconv-1.dll - ) - -copy_if_different( - ${release_src_dir} - "${SHARED_LIB_STAGING_DIR}/Release" - out_targets - ${release_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) - -copy_if_different( - ${release_src_dir} - "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" - out_targets - ${release_files} - ) -set(third_party_targets ${third_party_targets} ${out_targets}) #******************************* # LLKDU @@ -115,33 +77,33 @@ set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu") if(NOT EXISTS ${internal_llkdu_path}) if (EXISTS "${debug_src_dir}/llkdu.dll") set(debug_llkdu_src "${debug_src_dir}/llkdu.dll") - set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Debug/llkdu.dll") + set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/llkdu.dll") ADD_CUSTOM_COMMAND( OUTPUT ${debug_llkdu_dst} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst} DEPENDS ${debug_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Debug" + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_DEBUG}" ) set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst}) endif (EXISTS "${debug_src_dir}/llkdu.dll") if (EXISTS "${release_src_dir}/llkdu.dll") set(release_llkdu_src "${release_src_dir}/llkdu.dll") - set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Release/llkdu.dll") + set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/llkdu.dll") ADD_CUSTOM_COMMAND( OUTPUT ${release_llkdu_dst} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst} DEPENDS ${release_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Release" + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELEASE}" ) set(third_party_targets ${third_party_targets} ${release_llkdu_dst}) - set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/llkdu.dll") + set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/llkdu.dll") ADD_CUSTOM_COMMAND( OUTPUT ${relwithdebinfo_llkdu_dst} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst} DEPENDS ${release_llkdu_src} - COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" ) set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst}) endif (EXISTS "${release_src_dir}/llkdu.dll") @@ -168,7 +130,7 @@ if (MSVC80) copy_if_different( ${debug_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR}/Debug" + "${SHARED_LIB_STAGING_DIR_DEBUG}" out_targets ${debug_msvc8_files} ) @@ -192,7 +154,7 @@ if (MSVC80) copy_if_different( ${release_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR}/Release" + "${SHARED_LIB_STAGING_DIR_RELEASE}" out_targets ${release_msvc8_files} ) @@ -200,7 +162,7 @@ if (MSVC80) copy_if_different( ${release_msvc8_redist_path} - "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo" + "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" out_targets ${release_msvc8_files} ) @@ -210,13 +172,96 @@ if (MSVC80) endif (MSVC80) elseif(DARWIN) - + set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/universal-darwin") + set(vivox_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/debug") + set(debug_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/release") + set(release_files + ) elseif(LINUX) - + set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") + set(vivox_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug") + set(debug_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") + set(release_files + ) else(WINDOWS) message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...") + set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") + set(vivox_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug") + set(debug_files + ) + # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables + set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release") + set(release_files + ) endif(WINDOWS) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR_DEBUG}" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR_RELEASE}" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${vivox_src_dir} + "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" + out_targets + ${vivox_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + + + +copy_if_different( + ${debug_src_dir} + "${SHARED_LIB_STAGING_DIR_DEBUG}" + out_targets + ${debug_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${release_src_dir} + "${SHARED_LIB_STAGING_DIR_RELEASE}" + out_targets + ${release_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + +copy_if_different( + ${release_src_dir} + "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" + out_targets + ${release_files} + ) +set(third_party_targets ${third_party_targets} ${out_targets}) + + add_custom_target(stage_third_party_libs ALL DEPENDS ${third_party_targets} -- cgit v1.2.3