Compare commits
10 Commits
release-1.
...
Translate
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8d38cbdd0 | ||
|
|
21c24431db | ||
|
|
f2a059e985 | ||
|
|
1c4b1149e2 | ||
|
|
454be02eab | ||
|
|
072742cba5 | ||
|
|
9812bfc25f | ||
|
|
cbc7782b3a | ||
|
|
40afac6ae0 | ||
|
|
891457c11a |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* text=auto
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
/installed.xml
|
||||
/indra/llcommon/llversionviewer.h
|
||||
/indra/build-*
|
||||
/indra/tools/vstool/obj/
|
||||
*.aps
|
||||
@@ -10,14 +12,13 @@
|
||||
/indra/viewer-*
|
||||
/indra/newview/vivox-runtime/
|
||||
/indra/newview/dbghelp.dll
|
||||
indra/newview/res/viewer_icon.*
|
||||
indra/newview/res-sdl/viewer_icon.*
|
||||
/libraries/
|
||||
/lib/
|
||||
*.pyc
|
||||
*.orig
|
||||
*.rej
|
||||
*.bak
|
||||
*~
|
||||
*.DS_Store
|
||||
/LICENSES/
|
||||
/edited-files.txt
|
||||
@@ -25,5 +26,12 @@ qtcreator-build/
|
||||
/.pc
|
||||
/build-*
|
||||
/viewer-*
|
||||
/indra/newview/res/viewerRes.rc
|
||||
/indra/newview/res/viewerRes_bc.rc
|
||||
/indra/newview/English.lproj/InfoPlist.strings
|
||||
/indra/newview/linux_tools/handle_secondlifeprotocol.sh
|
||||
/indra/newview/linux_tools/install.sh
|
||||
/indra/newview/linux_tools/refresh_desktop_app_entry.sh
|
||||
/indra/newview/linux_tools/wrapper.sh
|
||||
|
||||
|
||||
|
||||
81
AscentChangelog.txt
Normal file
81
AscentChangelog.txt
Normal file
@@ -0,0 +1,81 @@
|
||||
->> Features implemented in Ascent:
|
||||
|
||||
In-World:
|
||||
-------------------------------------------------
|
||||
* Alpha skins and Tattoo Layers
|
||||
* Inventory Pre-caching
|
||||
* Avatar Radar
|
||||
* Multiple Attachment Points
|
||||
* Idle time of avatars around you (Not perfect)
|
||||
* Client tags/coloring for various clients, and extra client definitions
|
||||
* Force Away button to fake being away if you really want to avoid someone :V
|
||||
* Double-Click teleport (Not all the functionality of Emerald yet)
|
||||
Preferences (Options are in Ascent Options):
|
||||
* Disable Look At
|
||||
* Disable Point At and beam end
|
||||
* Fetch inventory in background on login (No waiting for caching when searching)
|
||||
* Display your client tag to yourself
|
||||
* Display your client tag color to yourself
|
||||
* Rez objects as land group when possible
|
||||
* Some settings can now be saved per account after changing an option in the preferences. Currently affected settings:
|
||||
Edit Beam color
|
||||
Client Tag Color
|
||||
Communication Window:
|
||||
- Friend List:
|
||||
* Friend List Online/Total counts (Not perfect)
|
||||
* Shows what rights your friends have given you (Mod, See on map, Online)
|
||||
|
||||
Chat Bar:
|
||||
* Emerald-style Chatbar as Commandline (See Preferences)
|
||||
* MU-style poses.
|
||||
* OOC Auto-close.
|
||||
|
||||
Instant Messages:
|
||||
* MU-style poses.
|
||||
* OOC Auto-close.
|
||||
|
||||
Advanced -> Ascent:
|
||||
* Fake Away Status
|
||||
* Force Ground Sit (Lets you sit anywhere)
|
||||
* Phantom Avatar (Prevents you visually from being pushed.)
|
||||
* Toggle IM Notification (Ability to hide '%n is typing...' notification from being sent.)
|
||||
* Close All Dialogs
|
||||
* Message Log
|
||||
* Message Builder
|
||||
* Sound Explorer
|
||||
* Asset Blacklist
|
||||
* AO options
|
||||
|
||||
Object Pie Menus:
|
||||
* Measure: Select on one object, then another, to get the exact distance between the two
|
||||
* Data: Reports prim rotation and position in a format usable in LSL scripts.
|
||||
* Script Counter
|
||||
|
||||
Self Pie Menu:
|
||||
* Animation Explorer
|
||||
|
||||
Agent Pie Menus:
|
||||
* Script Counter
|
||||
* Copy Agent UUID
|
||||
* Debug
|
||||
|
||||
Parcel Window:
|
||||
-------------------------------------------------
|
||||
- General tab:
|
||||
- Objects tab:
|
||||
* In Sim/Online/Offline indicators for Parcel Object Owner listings (Online is currently wonky - This is an issue with SL, Emerald has the same problem.)
|
||||
|
||||
Build Window:
|
||||
-------------------------------------------------
|
||||
- General tab:
|
||||
* Last Owner shown in Build "General" Tab
|
||||
* Group object is set to has a "View" button to see the group's profile
|
||||
* Copy Object Key button
|
||||
- Build Tab:
|
||||
* Copy/Paste Position buttons
|
||||
* Copy/Paste Size buttons
|
||||
* Copy/Paste Rotation buttons
|
||||
* Copy/Paste Primitive Parameters buttons
|
||||
|
||||
Known issues:
|
||||
Online/Total counts in the friends list sometimes go haywire. Not often or by a large margin, but it happens.
|
||||
3228
autobuild.xml
3228
autobuild.xml
File diff suppressed because it is too large
Load Diff
5
doc/asset_urls.txt
Normal file
5
doc/asset_urls.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
SLASSET_LIBS_WIN32=http://automated-builds-secondlife-com.s3.amazonaws.com/oss-viewer/export/slviewer-win32-libs-oss-viewer-1.23.4.0.zip
|
||||
SLASSET_MD5=http://automated-builds-secondlife-com.s3.amazonaws.com/oss-viewer/export/md5sums-oss-viewer-1.23.4.0.txt
|
||||
SLASSET_LIBS_DARWIN=http://automated-builds-secondlife-com.s3.amazonaws.com/oss-viewer/export/slviewer-darwin-libs-oss-viewer-1.23.4.0.tar.gz
|
||||
SLASSET_ART=http://automated-builds-secondlife-com.s3.amazonaws.com/oss-viewer/export/slviewer-artwork-oss-viewer-1.23.4.0.zip
|
||||
SLASSET_LIBS_LINUXI386=http://automated-builds-secondlife-com.s3.amazonaws.com/oss-viewer/export/slviewer-linux-libs-oss-viewer-1.23.4.0.tar.gz
|
||||
5
doc/releasenotes-where.txt
Normal file
5
doc/releasenotes-where.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
For full release notes, see:
|
||||
http://wiki.secondlife.com/wiki/Release_Notes
|
||||
|
||||
For a log of viewer changes, see:
|
||||
doc/viewer-changes.txt
|
||||
0
doc/viewer-changes.txt
Normal file
0
doc/viewer-changes.txt
Normal file
@@ -3,12 +3,19 @@
|
||||
# cmake_minimum_required should appear before any
|
||||
# other commands to guarantee full compatibility
|
||||
# with the version specified
|
||||
## prior to 2.8, the add_custom_target commands used in setting the version did not work correctly
|
||||
if(WIN32)
|
||||
cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
|
||||
else()
|
||||
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
|
||||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
|
||||
|
||||
# Eventually the third-party support modules (cmake/*.cmake) should
|
||||
# know the full path to all libraries. Until that happens we need
|
||||
# per-configuration link directory "libraries/<arch>/lib/debug" for
|
||||
# Debug and "libraries/<arch>/lib/release" for Release,
|
||||
# RelWithDebInfo, and MinSizeRel. CMake 2.6 does not directly support
|
||||
# per-configuration link directory specification. However, we can set
|
||||
# CMP0003 to OLD and link to one library (apr) on a per-configuration
|
||||
# basis to convince CMake to add the proper link directory. This line
|
||||
# can be removed when we use full paths for all libraries.
|
||||
#cmake_policy(SET CMP0003 OLD)
|
||||
|
||||
set(ROOT_PROJECT_NAME "Singularity" CACHE STRING
|
||||
"The root project/makefile/solution name. Defaults to Singularity.")
|
||||
@@ -17,12 +24,26 @@ project(${ROOT_PROJECT_NAME})
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
include(Variables)
|
||||
include(BuildVersion)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
||||
# Load versions now. Install locations need them.
|
||||
include(BuildVersion)
|
||||
include(UnixInstall)
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
||||
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
|
||||
endif (NOT CMAKE_BUILD_TYPE)
|
||||
endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
# Create a 'prepare' target in which to perform setup actions. This
|
||||
# must be the first target created so other targets can depend on it.
|
||||
if(NOT STANDALONE)
|
||||
# We prepare prebuilt binaries when not building standalone.
|
||||
set(prepare_depends ${CMAKE_BINARY_DIR}/prepare/prebuilt)
|
||||
endif(NOT STANDALONE)
|
||||
if(WINDOWS)
|
||||
set(prepare_depends ${prepare_depends} copy_win_libs)
|
||||
endif(WINDOWS)
|
||||
add_custom_target(prepare DEPENDS ${prepare_depends})
|
||||
|
||||
add_subdirectory(cmake)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}aistatemachine)
|
||||
@@ -45,6 +66,12 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
|
||||
|
||||
if(STANDALONE)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llqtwebkit)
|
||||
endif(STANDALONE)
|
||||
|
||||
#add_subdirectory(${LIBS_OPEN_PREFIX}lscript)
|
||||
|
||||
if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
|
||||
add_subdirectory(${LIBS_CLOSED_PREFIX}copy_win_scripts)
|
||||
endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
|
||||
@@ -56,7 +83,42 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llui)
|
||||
# viewer plugins directory
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
|
||||
|
||||
# llplugin testbed code (is this the right way to include it?)
|
||||
#if (NOT LINUX)
|
||||
# add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
|
||||
#endif (NOT LINUX)
|
||||
|
||||
add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
|
||||
add_subdirectory(${VIEWER_PREFIX}newview)
|
||||
add_dependencies(viewer singularity-bin)
|
||||
add_dependencies(viewer secondlife-bin)
|
||||
|
||||
# The use_prebuilt_binary macro in cmake/Prebuilt.cmake records
|
||||
# packages in the PREBUILT property of the 'prepare' target.
|
||||
get_property(PREBUILT_PACKAGES TARGET prepare PROPERTY PREBUILT)
|
||||
|
||||
# Create a script to download the needed binaries.
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/DownloadPrebuilt.cmake.in
|
||||
${CMAKE_BINARY_DIR}/DownloadPrebuilt.cmake @ONLY)
|
||||
|
||||
# Drive the download script at build time. Depend on 'install.xml'
|
||||
# to aqcuire new binaries when needed.
|
||||
add_custom_command(
|
||||
COMMENT "Obtaining prebuilt binaries..."
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/prepare/prebuilt
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/DownloadPrebuilt.cmake
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/../install.xml
|
||||
${CMAKE_BINARY_DIR}/DownloadPrebuilt.cmake
|
||||
)
|
||||
|
||||
|
||||
if(WINDOWS)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/CopyWinLibs.cmake.in
|
||||
${CMAKE_BINARY_DIR}/CopyWinLibs.cmake @ONLY)
|
||||
add_custom_command(
|
||||
COMMENT "Copying prebuilt libraries to viewer executable directory"
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/CopyWinLibs
|
||||
COMMAND ${CMAKE_COMMAND} -DCUR_CONFIG:STRING=${CMAKE_CFG_INTDIR} -P ${CMAKE_BINARY_DIR}/CopyWinLibs.cmake
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/prepare/prebuilt ${CMAKE_BINARY_DIR}/CopyWinLibs.cmake
|
||||
)
|
||||
add_custom_target(copy_win_libs DEPENDS ${CMAKE_BINARY_DIR}/CopyWinLibs)
|
||||
endif(WINDOWS)
|
||||
@@ -39,3 +39,5 @@ set_source_files_properties(${aistatemachine_HEADER_FILES}
|
||||
list(APPEND aistatemachine_SOURCE_FILES ${aistatemachine_HEADER_FILES})
|
||||
|
||||
add_library (aistatemachine ${aistatemachine_SOURCE_FILES})
|
||||
add_dependencies(aistatemachine prepare)
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ void print_statemachine_diagnostics(U64 total_clocks, AIStateMachine::StateTimer
|
||||
|
||||
AIStateMachine::StateTimerBase::DumpTimers(msg);
|
||||
|
||||
LL_WARNS() << msg.str() << LL_ENDL;
|
||||
llwarns << msg.str() << llendl;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1264,7 +1264,7 @@ void AIStateMachine::abort(void)
|
||||
// Block until the current run finished.
|
||||
if (!mRunMutex.try_lock())
|
||||
{
|
||||
LL_WARNS() << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << LL_ENDL;
|
||||
llwarns << "AIStateMachine::abort() blocks because the statemachine is still executing code in another thread." << llendl;
|
||||
mRunMutex.lock();
|
||||
}
|
||||
mRunMutex.unlock();
|
||||
@@ -1463,6 +1463,6 @@ void stopEngineThread(void)
|
||||
{
|
||||
ms_sleep(10);
|
||||
}
|
||||
LL_INFOS() << "State machine thread" << (!AIEngineThread::sInstance->isStopped() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << LL_ENDL;
|
||||
llinfos << "State machine thread" << (!AIEngineThread::sInstance->isStopped() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << llendl;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ void AIStateMachineThreadBase::abort_impl(void)
|
||||
{
|
||||
// The thread is still happily running (and will clean up itself).
|
||||
// Lets make sure we're not flooded with this situation.
|
||||
LL_WARNS() << "Thread state machine aborted while the thread is still running. That is a waste of CPU and should be avoided." << LL_ENDL;
|
||||
llwarns << "Thread state machine aborted while the thread is still running. That is a waste of CPU and should be avoided." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "aistatemachine.h"
|
||||
#include "llthread.h"
|
||||
#include "aithreadsafe.h"
|
||||
#include <boost/format.hpp>
|
||||
|
||||
#ifdef EXAMPLE_CODE // undefined
|
||||
|
||||
@@ -236,7 +235,7 @@ class AIStateMachineThread : public AIStateMachineThreadBase {
|
||||
/*virtual*/ const char* getName() const
|
||||
{
|
||||
#define STRIZE(arg) #arg
|
||||
return (boost::format("%1%%2%%3%") % "AIStateMachineThread<" % STRIZE(THREAD_IMPL) % ">").str().c_str();
|
||||
return "AIStateMachineThread<"STRIZE(THREAD_IMPL)">";
|
||||
#undef STRIZE
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,22 @@ set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
|
||||
# Platform-specific compilation flags.
|
||||
|
||||
if (WINDOWS)
|
||||
# Various libs are compiler specific, generate some variables here we can just use
|
||||
# when we require them instead of reimplementing the test each time.
|
||||
if (MSVC10)
|
||||
set(MSVC_DIR 10.0)
|
||||
set(MSVC_SUFFIX 100)
|
||||
elseif (MSVC12)
|
||||
set(MSVC_DIR 12.0)
|
||||
set(MSVC_SUFFIX 120)
|
||||
endif (MSVC10)
|
||||
|
||||
# Remove default /Zm1000 flag that cmake inserts
|
||||
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
# Always use /Zm140
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm140")
|
||||
|
||||
# Don't build DLLs.
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
@@ -49,78 +65,56 @@ if (WINDOWS)
|
||||
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP"
|
||||
CACHE STRING "C++ compiler release-with-debug options" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE
|
||||
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /Zo /MD /MP /Ob2 /Zc:inline /fp:fast -D_ITERATOR_DEBUG_LEVEL=0"
|
||||
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /fp:fast -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
|
||||
CACHE STRING "C++ compiler release options" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE
|
||||
"${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /fp:fast"
|
||||
CACHE STRING "C compiler release options" FORCE)
|
||||
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
|
||||
if (USE_LTO)
|
||||
if(INCREMENTAL_LINK)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG:INCREMENTAL")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG:INCREMENTAL")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /LTCG:INCREMENTAL")
|
||||
else(INCREMENTAL_LINK)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /LTCG")
|
||||
endif(INCREMENTAL_LINK)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:REF /OPT:ICF /LTCG")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:REF /OPT:ICF /LTCG")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /LTCG")
|
||||
elseif (INCREMENTAL_LINK)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS} /INCREMENTAL /VERBOSE:INCR")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL /VERBOSE:INCR")
|
||||
else ()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:REF /INCREMENTAL:NO")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:REF /INCREMENTAL:NO")
|
||||
endif ()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "")
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "")
|
||||
|
||||
add_definitions(
|
||||
/DLL_WINDOWS=1
|
||||
/DNOMINMAX
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
/D_UNICODE
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
/c
|
||||
/Zc:forScope
|
||||
/Zc:rvalueCast
|
||||
/Zc:wchar_t
|
||||
/Zc:wchar_t-
|
||||
/nologo
|
||||
/Oy-
|
||||
/Zm140
|
||||
/wd4267
|
||||
/wd4244
|
||||
)
|
||||
|
||||
# SSE2 is implied on win64
|
||||
if(WORD_SIZE EQUAL 32)
|
||||
add_definitions(/arch:SSE2 /D_ATL_XP_TARGETING)
|
||||
else(WORD_SIZE EQUAL 32)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244")
|
||||
endif(WORD_SIZE EQUAL 32)
|
||||
|
||||
if (USE_LTO)
|
||||
add_compile_options(
|
||||
/GL
|
||||
/Gy
|
||||
/Gw
|
||||
)
|
||||
endif (USE_LTO)
|
||||
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
add_compile_options(/arch:SSE2)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
if (MSVC12)
|
||||
# configure win32 API for windows vista+ compatibility
|
||||
set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
||||
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
|
||||
else (MSVC12)
|
||||
# configure win32 API for windows XP+ compatibility
|
||||
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
||||
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
|
||||
endif (MSVC12)
|
||||
|
||||
# Are we using the crummy Visual Studio KDU build workaround?
|
||||
if (NOT DISABLE_FATAL_WARNINGS)
|
||||
add_definitions(/WX)
|
||||
endif (NOT DISABLE_FATAL_WARNINGS)
|
||||
|
||||
# configure win32 API for windows Vista+ compatibility
|
||||
set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
|
||||
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO")
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
|
||||
|
||||
endif (WINDOWS)
|
||||
|
||||
set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math")
|
||||
@@ -141,10 +135,7 @@ if (LINUX)
|
||||
-pthread
|
||||
)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ")
|
||||
|
||||
# Don't catch SIGCHLD in our base application class for the viewer
|
||||
# some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh!
|
||||
@@ -199,14 +190,16 @@ if (LINUX)
|
||||
|
||||
# End of hacks.
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
||||
|
||||
if (NOT STANDALONE)
|
||||
# this stops us requiring a really recent glibc at runtime
|
||||
add_definitions(-fno-stack-protector)
|
||||
endif (NOT STANDALONE)
|
||||
if (${ARCH} STREQUAL "x86_64")
|
||||
add_definitions(-pipe)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffast-math")
|
||||
add_definitions(-DLINUX64=1 -pipe)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -ffast-math -funroll-loops")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer -ffast-math -funroll-loops")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ffast-math")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ffast-math")
|
||||
else (${ARCH} STREQUAL "x86_64")
|
||||
@@ -221,6 +214,11 @@ if (LINUX)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
endif (${ARCH} STREQUAL "x86_64")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
if (NOT STANDALONE)
|
||||
# this stops us requiring a really recent glibc at runtime
|
||||
add_definitions(-fno-stack-protector)
|
||||
endif (NOT STANDALONE)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
|
||||
@@ -228,6 +226,12 @@ if (LINUX)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
|
||||
if (NOT STANDALONE)
|
||||
# this stops us requiring a really recent glibc at runtime
|
||||
add_definitions(-fno-stack-protector)
|
||||
endif (NOT STANDALONE)
|
||||
|
||||
if (NOT STANDALONE)
|
||||
set(MARCH_FLAG " -axsse4.1 -msse2")
|
||||
endif (NOT STANDALONE)
|
||||
@@ -307,14 +311,13 @@ if (STANDALONE)
|
||||
add_definitions(-DLL_STANDALONE=1)
|
||||
else (STANDALONE)
|
||||
set(${ARCH}_linux_INCLUDES
|
||||
ELFIO
|
||||
atk-1.0
|
||||
cairo
|
||||
glib-2.0
|
||||
gdk-pixbuf-2.0
|
||||
gstreamer-0.10
|
||||
gtk-2.0
|
||||
freetype2
|
||||
pango-1.0
|
||||
pixman-1
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
include(BerkeleyDB)
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
|
||||
@@ -12,41 +13,39 @@ if (STANDALONE)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(apr_suite)
|
||||
if (WINDOWS)
|
||||
if (LLCOMMON_LINK_SHARED)
|
||||
set(APR_selector "lib")
|
||||
else (LLCOMMON_LINK_SHARED)
|
||||
set(APR_selector "")
|
||||
endif (LLCOMMON_LINK_SHARED)
|
||||
set(APR_LIBRARIES
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
|
||||
debug libapr-1.lib
|
||||
optimized libapr-1.lib
|
||||
)
|
||||
set(APRICONV_LIBRARIES
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib
|
||||
debug libapriconv-1.lib
|
||||
optimized libapriconv-1.lib
|
||||
)
|
||||
set(APRUTIL_LIBRARIES
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
|
||||
debug libaprutil-1.lib
|
||||
optimized libaprutil-1.lib
|
||||
)
|
||||
if(NOT LLCOMMON_LINK_SHARED)
|
||||
list(APPEND APR_LIBRARIES Rpcrt4)
|
||||
endif(NOT LLCOMMON_LINK_SHARED)
|
||||
elseif (DARWIN)
|
||||
if (LLCOMMON_LINK_SHARED)
|
||||
set(APR_selector "0.dylib")
|
||||
set(APRUTIL_selector "0.dylib")
|
||||
else (LLCOMMON_LINK_SHARED)
|
||||
set(APR_selector "a")
|
||||
set(APRUTIL_selector "a")
|
||||
endif (LLCOMMON_LINK_SHARED)
|
||||
set(APR_LIBRARIES libapr-1.${APR_selector})
|
||||
set(APRUTIL_LIBRARIES libaprutil-1.${APRUTIL_selector})
|
||||
set(APR_LIBRARIES
|
||||
debug libapr-1.0.dylib
|
||||
optimized libapr-1.0.dylib
|
||||
)
|
||||
set(APRUTIL_LIBRARIES
|
||||
debug libaprutil-1.dylib
|
||||
optimized libaprutil-1.dylib
|
||||
)
|
||||
set(APRICONV_LIBRARIES iconv)
|
||||
else (WINDOWS)
|
||||
set(APR_LIBRARIES apr-1)
|
||||
set(APRUTIL_LIBRARIES aprutil-1)
|
||||
set(APRICONV_LIBRARIES iconv)
|
||||
endif (WINDOWS)
|
||||
set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/apr-1)
|
||||
set(APR_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include/apr-1
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/apr-1
|
||||
)
|
||||
|
||||
if (LINUX)
|
||||
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES})
|
||||
endif (LINUX)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -8,8 +8,11 @@ if (STANDALONE)
|
||||
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
|
||||
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(ogg_vorbis)
|
||||
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
use_prebuilt_binary(ogg-vorbis)
|
||||
set(VORBIS_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
|
||||
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
|
||||
|
||||
|
||||
20
indra/cmake/BerkeleyDB.cmake
Normal file
20
indra/cmake/BerkeleyDB.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
include(Prebuilt)
|
||||
|
||||
set(DB_FIND_QUIETLY ON)
|
||||
set(DB_FIND_REQUIRED ON)
|
||||
|
||||
if (STANDALONE)
|
||||
include(FindBerkeleyDB)
|
||||
else (STANDALONE)
|
||||
if (LINUX)
|
||||
# Need to add dependency pthread explicitely to support ld.gold.
|
||||
use_prebuilt_binary(db)
|
||||
set(DB_LIBRARIES db-5.1 pthread)
|
||||
else (LINUX)
|
||||
set(DB_LIBRARIES db-4.2)
|
||||
endif (LINUX)
|
||||
set(DB_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (STANDALONE)
|
||||
@@ -11,8 +11,11 @@ if (STANDALONE)
|
||||
find_package(Boost 1.51.0 COMPONENTS date_time filesystem program_options regex system thread wave context)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(boost)
|
||||
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(Boost_VERSION "1.60")
|
||||
set(Boost_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
set(Boost_VERSION "1.52")
|
||||
|
||||
if (WINDOWS)
|
||||
set(Boost_CONTEXT_LIBRARY
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
# Construct the version and copyright information based on package data.
|
||||
include(Python)
|
||||
include(Variables)
|
||||
|
||||
add_custom_command(OUTPUT packages-info.txt
|
||||
COMMENT "Generating packages-info.txt for the about box"
|
||||
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py -p=${AUTOBUILD_PLATFORM_NAME} > packages-info.txt
|
||||
)
|
||||
@@ -1,54 +1,81 @@
|
||||
# -*- cmake -*-
|
||||
# Construct the viewer version number based on the indra/VIEWER_VERSION file
|
||||
|
||||
if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/newview/
|
||||
set(VIEWER_VERSION_BASE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/newview/VIEWER_VERSION.txt")
|
||||
# Read version components from the header file.
|
||||
file(STRINGS ${LIBS_OPEN_DIR}/llcommon/llversionviewer.h.in lines
|
||||
REGEX " LL_VERSION_")
|
||||
foreach(line ${lines})
|
||||
string(REGEX REPLACE ".*LL_VERSION_([A-Z]+).*" "\\1" comp "${line}")
|
||||
string(REGEX REPLACE ".* = ([0-9]+);.*" "\\1" value "${line}")
|
||||
set(v${comp} "${value}")
|
||||
endforeach(line)
|
||||
|
||||
if ( EXISTS ${VIEWER_VERSION_BASE_FILE} )
|
||||
file(STRINGS ${VIEWER_VERSION_BASE_FILE} VIEWER_SHORT_VERSION REGEX "^[0-9]+\\.[0-9]+\\.[0-9]+")
|
||||
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VIEWER_VERSION_MAJOR ${VIEWER_SHORT_VERSION})
|
||||
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" VIEWER_VERSION_MINOR ${VIEWER_SHORT_VERSION})
|
||||
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" VIEWER_VERSION_PATCH ${VIEWER_SHORT_VERSION})
|
||||
execute_process(
|
||||
COMMAND git rev-list HEAD
|
||||
OUTPUT_VARIABLE GIT_REV_LIST_STR
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if (DEFINED ENV{revision})
|
||||
set(VIEWER_VERSION_REVISION $ENV{revision})
|
||||
message("Revision (from environment): ${VIEWER_VERSION_REVISION}")
|
||||
if(GIT_REV_LIST_STR)
|
||||
string(REPLACE "\n" ";" GIT_REV_LIST ${GIT_REV_LIST_STR})
|
||||
else()
|
||||
string(REPLACE "\n" ";" GIT_REV_LIST "")
|
||||
endif()
|
||||
|
||||
else (DEFINED ENV{revision})
|
||||
execute_process(
|
||||
COMMAND git rev-list HEAD
|
||||
OUTPUT_VARIABLE GIT_REV_LIST_STR
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(GIT_REV_LIST)
|
||||
list(LENGTH GIT_REV_LIST vBUILD)
|
||||
else()
|
||||
set(vBUILD 99)
|
||||
endif()
|
||||
|
||||
if(GIT_REV_LIST_STR)
|
||||
string(REPLACE "\n" ";" GIT_REV_LIST ${GIT_REV_LIST_STR})
|
||||
else()
|
||||
string(REPLACE "\n" ";" GIT_REV_LIST "")
|
||||
endif()
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h.in
|
||||
${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h
|
||||
)
|
||||
|
||||
if(GIT_REV_LIST)
|
||||
list(LENGTH GIT_REV_LIST VIEWER_VERSION_REVISION)
|
||||
else(GIT_REV_LIST)
|
||||
set(VIEWER_VERSION_REVISION 99)
|
||||
endif(GIT_REV_LIST)
|
||||
endif (DEFINED ENV{revision})
|
||||
message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
|
||||
else ( EXISTS ${VIEWER_VERSION_BASE_FILE} )
|
||||
message(SEND_ERROR "Cannot get viewer version from '${VIEWER_VERSION_BASE_FILE}'")
|
||||
endif ( EXISTS ${VIEWER_VERSION_BASE_FILE} )
|
||||
if (WINDOWS)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in
|
||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
||||
if ("${VIEWER_VERSION_REVISION}" STREQUAL "")
|
||||
message("Ultimate fallback, revision was blank or not set: will use 0")
|
||||
set(VIEWER_VERSION_REVISION 0)
|
||||
endif ("${VIEWER_VERSION_REVISION}" STREQUAL "")
|
||||
if (DARWIN)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings.in
|
||||
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings
|
||||
)
|
||||
endif (DARWIN)
|
||||
|
||||
if (LINUX)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh.in
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh.in
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh.in
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh.in
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh
|
||||
@ONLY
|
||||
)
|
||||
endif (LINUX)
|
||||
|
||||
|
||||
# Compose the version.
|
||||
set(${ROOT_PROJECT_NAME}_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
|
||||
if (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||
message(STATUS "Version is ${${ROOT_PROJECT_NAME}_VERSION}")
|
||||
else (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||
message(FATAL_ERROR "Could not determine version (${${ROOT_PROJECT_NAME}_VERSION})")
|
||||
endif (${ROOT_PROJECT_NAME}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||
|
||||
set(VIEWER_CHANNEL_VERSION_DEFINES
|
||||
"LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\""
|
||||
"LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}"
|
||||
"LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}"
|
||||
"LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}"
|
||||
"LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}"
|
||||
)
|
||||
endif (NOT DEFINED VIEWER_SHORT_VERSION)
|
||||
|
||||
@@ -20,5 +20,8 @@ else (STANDALONE)
|
||||
else (WINDOWS)
|
||||
set(CARES_LIBRARIES cares)
|
||||
endif (WINDOWS)
|
||||
set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/ares)
|
||||
set(CARES_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/ares
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/ares
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
|
||||
if (USESYSTEMLIBS)
|
||||
set(CEFPLUGIN OFF CACHE BOOL
|
||||
"CEFPLUGIN support for the llplugin/llmedia test apps.")
|
||||
else (USESYSTEMLIBS)
|
||||
use_prebuilt_binary(llceflib)
|
||||
set(CEFPLUGIN ON CACHE BOOL
|
||||
"CEFPLUGIN support for the llplugin/llmedia test apps.")
|
||||
set(CEF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/cef)
|
||||
endif (USESYSTEMLIBS)
|
||||
|
||||
if (WINDOWS)
|
||||
set(CEF_PLUGIN_LIBRARIES
|
||||
libcef.lib
|
||||
libcef_dll_wrapper.lib
|
||||
llceflib.lib
|
||||
)
|
||||
elseif (DARWIN)
|
||||
FIND_LIBRARY(APPKIT_LIBRARY AppKit)
|
||||
if (NOT APPKIT_LIBRARY)
|
||||
message(FATAL_ERROR "AppKit not found")
|
||||
endif()
|
||||
|
||||
FIND_LIBRARY(CEF_LIBRARY "Chromium Embedded Framework" ${ARCH_PREBUILT_DIRS_RELEASE})
|
||||
if (NOT CEF_LIBRARY)
|
||||
message(FATAL_ERROR "CEF not found")
|
||||
endif()
|
||||
|
||||
set(CEF_PLUGIN_LIBRARIES
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}/libLLCefLib.a
|
||||
${APPKIT_LIBRARY}
|
||||
${CEF_LIBRARY}
|
||||
)
|
||||
|
||||
elseif (LINUX)
|
||||
set(CEF_PLUGIN_LIBRARIES
|
||||
llceflib
|
||||
cef_dll_wrapper
|
||||
cef
|
||||
)
|
||||
endif (WINDOWS)
|
||||
@@ -12,30 +12,36 @@ set(cmake_SOURCE_FILES
|
||||
APR.cmake
|
||||
Audio.cmake
|
||||
BasicPluginBase.cmake
|
||||
BerkeleyDB.cmake
|
||||
Boost.cmake
|
||||
BuildVersion.cmake
|
||||
CARes.cmake
|
||||
CEFPlugin.cmake
|
||||
CMakeCopyIfDifferent.cmake
|
||||
CURL.cmake
|
||||
Colladadom.cmake
|
||||
ConfigurePkgConfig.cmake
|
||||
Copy3rdPartyLibs.cmake
|
||||
CopyBackToSource.cmake
|
||||
CopyWinLibs.cmake
|
||||
Cwdebug.cmake
|
||||
DBusGlib.cmake
|
||||
DeploySharedLibs.cmake
|
||||
DirectX.cmake
|
||||
DownloadPrebuilt.cmake.in
|
||||
ELFIO.cmake
|
||||
EXPAT.cmake
|
||||
ExamplePlugin.cmake
|
||||
FMODEX.cmake
|
||||
FMODSTUDIO.cmake
|
||||
FindAPR.cmake
|
||||
FindAutobuild.cmake
|
||||
FindBerkeleyDB.cmake
|
||||
FindCARes.cmake
|
||||
FindColladadom.cmake
|
||||
FindELFIO.cmake
|
||||
FindGLOD.cmake
|
||||
FindGoogleBreakpad.cmake
|
||||
FindGooglePerfTools.cmake
|
||||
FindHunSpell.cmake
|
||||
FindJsonCpp.cmake
|
||||
FindLLQtWebkit.cmake
|
||||
FindNDOF.cmake
|
||||
FindOpenJPEG.cmake
|
||||
FindTut.cmake
|
||||
@@ -65,8 +71,8 @@ set(cmake_SOURCE_FILES
|
||||
LLPrimitive.cmake
|
||||
LLPhysicsExtensions.cmake
|
||||
LLSharedLibs.cmake
|
||||
LLQtWebkit.cmake
|
||||
LLRender.cmake
|
||||
LLSharedLibs.cmake
|
||||
LLUI.cmake
|
||||
LLVFS.cmake
|
||||
LLWindow.cmake
|
||||
@@ -85,6 +91,7 @@ set(cmake_SOURCE_FILES
|
||||
Prebuilt.cmake
|
||||
PulseAudio.cmake
|
||||
Python.cmake
|
||||
Qt4.cmake
|
||||
QuickTimePlugin.cmake
|
||||
RunBuildTest.cmake
|
||||
StateMachine.cmake
|
||||
@@ -94,7 +101,7 @@ set(cmake_SOURCE_FILES
|
||||
UnixInstall.cmake
|
||||
Variables.cmake
|
||||
ViewerMiscLibs.cmake
|
||||
WinManifest.cmake
|
||||
WebKitLibPlugin.cmake
|
||||
XmlRpcEpi.cmake
|
||||
ZLIB.cmake
|
||||
)
|
||||
@@ -103,6 +110,7 @@ source_group("Shared Rules" FILES ${cmake_SOURCE_FILES})
|
||||
|
||||
set(master_SOURCE_FILES
|
||||
../CMakeLists.txt
|
||||
../develop.py
|
||||
)
|
||||
|
||||
source_group("Master Rules" FILES ${master_SOURCE_FILES})
|
||||
|
||||
@@ -13,8 +13,13 @@ else (STANDALONE)
|
||||
debug libcurld
|
||||
optimized libcurl)
|
||||
else (WINDOWS)
|
||||
use_prebuilt_binary(libidn)
|
||||
set(CURL_LIBRARIES curl idn)
|
||||
set(CURL_LIBRARIES curl)
|
||||
if(LINUX AND WORD_SIZE EQUAL 64)
|
||||
list(APPEND CURL_LIBRARIES idn)
|
||||
endif(LINUX AND WORD_SIZE EQUAL 64)
|
||||
endif (WINDOWS)
|
||||
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(CURL_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -10,22 +10,49 @@ if (STANDALONE)
|
||||
include (FindColladadom)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(colladadom)
|
||||
|
||||
if (NOT WINDOWS AND NOT LINUX)
|
||||
use_prebuilt_binary(pcre)
|
||||
endif (NOT WINDOWS AND NOT LINUX)
|
||||
|
||||
if (NOT DARWIN AND NOT WINDOWS)
|
||||
use_prebuilt_binary(libxml)
|
||||
endif (NOT DARWIN AND NOT WINDOWS)
|
||||
|
||||
set(COLLADADOM_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/collada
|
||||
${LIBS_PREBUILT_DIR}/include/collada/1.4
|
||||
)
|
||||
${LIBS_PREBUILT_DIR}/include/collada
|
||||
${LIBS_PREBUILT_DIR}/include/collada/1.4
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/collada
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/collada/1.4
|
||||
)
|
||||
|
||||
if (WINDOWS)
|
||||
set(COLLADADOM_LIBRARIES
|
||||
debug libcollada14dom23-sd
|
||||
optimized libcollada14dom23-s
|
||||
)
|
||||
else(WINDOWS)
|
||||
set(COLLADADOM_LIBRARIES
|
||||
debug collada14dom-d
|
||||
optimized collada14dom
|
||||
minizip
|
||||
)
|
||||
if(MSVC12)
|
||||
use_prebuilt_binary(pcre)
|
||||
use_prebuilt_binary(libxml)
|
||||
set(COLLADADOM_LIBRARIES
|
||||
debug libcollada14dom23-sd
|
||||
optimized libcollada14dom23-s
|
||||
libxml2_a
|
||||
debug pcrecppd
|
||||
optimized pcrecpp
|
||||
debug pcred
|
||||
optimized pcre
|
||||
${BOOST_SYSTEM_LIBRARIES}
|
||||
)
|
||||
else(MSVC12)
|
||||
add_definitions(-DDOM_DYNAMIC)
|
||||
set(COLLADADOM_LIBRARIES
|
||||
debug libcollada14dom22-d
|
||||
optimized libcollada14dom22
|
||||
)
|
||||
endif(MSVC12)
|
||||
else (WINDOWS)
|
||||
set(COLLADADOM_LIBRARIES
|
||||
collada14dom
|
||||
minizip
|
||||
xml2
|
||||
)
|
||||
endif (WINDOWS)
|
||||
endif (STANDALONE)
|
||||
|
||||
|
||||
@@ -1,241 +0,0 @@
|
||||
# -*- 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)
|
||||
include(Linking)
|
||||
|
||||
###################################################################
|
||||
# set up platform specific lists of files that need to be copied
|
||||
###################################################################
|
||||
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 "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
set(vivox_files
|
||||
SLVoice.exe
|
||||
ca-bundle.crt
|
||||
libsndfile-1.dll
|
||||
vivoxplatform.dll
|
||||
vivoxsdk.dll
|
||||
ortp.dll
|
||||
zlib1.dll
|
||||
vivoxoal.dll
|
||||
)
|
||||
|
||||
#*******************************
|
||||
# Misc shared libs
|
||||
|
||||
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
|
||||
set(debug_files
|
||||
libapr-1.dll
|
||||
libaprutil-1.dll
|
||||
libapriconv-1.dll
|
||||
ssleay32.dll
|
||||
libeay32.dll
|
||||
glod.dll
|
||||
libhunspell.dll
|
||||
)
|
||||
|
||||
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
set(release_files
|
||||
libapr-1.dll
|
||||
libaprutil-1.dll
|
||||
libapriconv-1.dll
|
||||
ssleay32.dll
|
||||
libeay32.dll
|
||||
glod.dll
|
||||
libhunspell.dll
|
||||
)
|
||||
|
||||
if(NOT DISABLE_TCMALLOC)
|
||||
set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
|
||||
set(release_files ${release_files} libtcmalloc_minimal.dll)
|
||||
endif(NOT DISABLE_TCMALLOC)
|
||||
|
||||
if (FMODSTUDIO)
|
||||
if(WORD_SIZE STREQUAL 64)
|
||||
set(debug_files ${debug_files} fmodL64.dll)
|
||||
set(release_files ${release_files} fmod64.dll)
|
||||
else(WORD_SIZE STREQUAL 64)
|
||||
set(debug_files ${debug_files} fmodL.dll)
|
||||
set(release_files ${release_files} fmod.dll)
|
||||
endif(WORD_SIZE STREQUAL 64)
|
||||
endif (FMODSTUDIO)
|
||||
elseif(DARWIN)
|
||||
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
|
||||
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
|
||||
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release/Resources")
|
||||
|
||||
set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
set(vivox_files
|
||||
SLVoice
|
||||
ca-bundle.crt
|
||||
libsndfile.dylib
|
||||
libvivoxoal.dylib
|
||||
libortp.dylib
|
||||
libvivoxplatform.dylib
|
||||
libvivoxsdk.dylib
|
||||
)
|
||||
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
|
||||
set(debug_files
|
||||
)
|
||||
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
set(release_files
|
||||
libapr-1.0.dylib
|
||||
libapr-1.dylib
|
||||
libaprutil-1.0.dylib
|
||||
libaprutil-1.dylib
|
||||
libexception_handler.dylib
|
||||
libexpat.1.5.2.dylib
|
||||
libexpat.dylib
|
||||
libGLOD.dylib
|
||||
libhunspell-1.3.0.dylib
|
||||
libndofdev.dylib
|
||||
)
|
||||
|
||||
if (FMODSTUDIO)
|
||||
set(debug_files ${debug_files} libfmodL.dylib)
|
||||
set(release_files ${release_files} libfmod.dylib)
|
||||
endif (FMODSTUDIO)
|
||||
|
||||
elseif(LINUX)
|
||||
# linux is weird, multiple side by side configurations aren't supported
|
||||
# and we don't seem to have any debug shared libs built yet anyways...
|
||||
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}")
|
||||
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}")
|
||||
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}")
|
||||
|
||||
set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
set(vivox_files
|
||||
libsndfile.so.1
|
||||
libortp.so
|
||||
libvivoxoal.so.1
|
||||
libvivoxplatform.so
|
||||
libvivoxsdk.so
|
||||
SLVoice
|
||||
# ca-bundle.crt #No cert for linux. It is actually still 3.2SDK.
|
||||
)
|
||||
# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
|
||||
# or ARCH_PREBUILT_DIRS
|
||||
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
|
||||
set(debug_files
|
||||
)
|
||||
# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
|
||||
# or ARCH_PREBUILT_DIRS
|
||||
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
# *FIX - figure out what to do with duplicate libalut.so here -brad
|
||||
set(release_files
|
||||
libapr-1.so.0
|
||||
libaprutil-1.so.0
|
||||
libatk-1.0.so
|
||||
libexpat.so
|
||||
libexpat.so.1
|
||||
libfreetype.so.6.12.3
|
||||
libfreetype.so.6
|
||||
libfreetype.so
|
||||
libGLOD.so
|
||||
libgmodule-2.0.so
|
||||
libgobject-2.0.so
|
||||
libopenal.so
|
||||
libfontconfig.so.1.8.0
|
||||
libfontconfig.so.1
|
||||
libfontconfig.so
|
||||
)
|
||||
|
||||
if (USE_TCMALLOC)
|
||||
set(release_files ${release_files} "libtcmalloc_minimal.so")
|
||||
endif (USE_TCMALLOC)
|
||||
|
||||
if (FMODSTUDIO)
|
||||
set(debug_files ${debug_files} "libfmodL.so")
|
||||
set(release_files ${release_files} "libfmod.so")
|
||||
endif (FMODSTUDIO)
|
||||
|
||||
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
|
||||
# or ARCH_PREBUILT_DIRS
|
||||
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
|
||||
# or ARCH_PREBUILT_DIRS
|
||||
set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
|
||||
set(release_files "")
|
||||
|
||||
set(debug_llkdu_src "")
|
||||
set(debug_llkdu_dst "")
|
||||
set(release_llkdu_src "")
|
||||
set(release_llkdu_dst "")
|
||||
set(relwithdebinfo_llkdu_dst "")
|
||||
endif(WINDOWS)
|
||||
|
||||
|
||||
################################################################
|
||||
# Done building the file lists, now set up the copy commands.
|
||||
################################################################
|
||||
|
||||
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})
|
||||
|
||||
if(NOT USESYSTEMLIBS)
|
||||
add_custom_target(
|
||||
stage_third_party_libs ALL
|
||||
DEPENDS ${third_party_targets}
|
||||
)
|
||||
endif(NOT USESYSTEMLIBS)
|
||||
16
indra/cmake/CopyBackToSource.cmake
Normal file
16
indra/cmake/CopyBackToSource.cmake
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- cmake -*-
|
||||
# Copies a binary back to the source directory
|
||||
|
||||
MACRO(COPY_BACK_TO_SOURCE target)
|
||||
SET(FROM $<TARGET_FILE:${target}>)
|
||||
SET(TO ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
#MESSAGE("TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}
|
||||
DEPENDS ${FROM}
|
||||
COMMENT "Copying ${target} to ${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
ENDMACRO(COPY_BACK_TO_SOURCE)
|
||||
|
||||
|
||||
181
indra/cmake/CopyWinLibs.cmake.in
Normal file
181
indra/cmake/CopyWinLibs.cmake.in
Normal file
@@ -0,0 +1,181 @@
|
||||
# -*- 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(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)
|
||||
string(FIND ${dest} ${CUR_CONFIG} idx)
|
||||
if(${idx} LESS 0)
|
||||
return()
|
||||
endif(${idx} LESS 0)
|
||||
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 md "${to_dest}")
|
||||
endif(NOT EXISTS ${to_dest})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${from_file}" "${to_dest}${f}" 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)
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,12 @@ if (STANDALONE)
|
||||
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
|
||||
|
||||
elseif (LINUX)
|
||||
use_prebuilt_binary(dbus-glib)
|
||||
use_prebuilt_binary(dbusglib)
|
||||
set(DBUSGLIB_FOUND ON FORCE BOOL)
|
||||
set(DBUSGLIB_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/dbus
|
||||
)
|
||||
${LIBS_PREBUILT_DIR}/include/dbus
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/dbus
|
||||
)
|
||||
# We don't need to explicitly link against dbus-glib itself, because
|
||||
# the viewer probes for the system's copy at runtime.
|
||||
set(DBUSGLIB_LIBRARIES
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
# DeploySharedLibs.cmake
|
||||
# This is a script to be run at build time! Its not part of the cmake configuration!
|
||||
# See indra/cmake/LLSharedLibs.cmake for a macro that simplifies adding a command to a target to run this script.
|
||||
|
||||
# This script requires a few cmake variable to be set on the command line:
|
||||
# BIN_NAME= The full path the the binary to search for dependecies.
|
||||
# SEARCH_DIRS= The full paths to dirs to search for dependencies.
|
||||
# DST_PATH= The full path where the dependecies will be copied.
|
||||
get_filename_component(current_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
include(GetPrerequisites)
|
||||
|
||||
message("Getting recursive dependencies for file: ${BIN_NAME}")
|
||||
|
||||
set(EXCLUDE_SYSTEM 1)
|
||||
set(RECURSE 0)
|
||||
get_filename_component(EXE_PATH ${BIN_NAME} PATH)
|
||||
|
||||
get_prerequisites( ${BIN_NAME} RESULTS ${EXCLUDE_SYSTEM} ${RECURSE} "${EXE_PATH}" "${SEARCH_DIRS}" )
|
||||
|
||||
foreach(DEP ${RESULTS})
|
||||
Message("Processing dependency: ${DEP}")
|
||||
get_filename_component(DEP_FILE ${DEP} NAME)
|
||||
set(DEP_FILES ${DEP_FILES} ${DEP_FILE})
|
||||
endforeach(DEP)
|
||||
|
||||
if(DEP_FILES)
|
||||
list(REMOVE_DUPLICATES DEP_FILES)
|
||||
endif(DEP_FILES)
|
||||
|
||||
foreach(DEP_FILE ${DEP_FILES})
|
||||
if(FOUND_FILES)
|
||||
list(FIND FOUND_FILES ${DEP_FILE} FOUND)
|
||||
else(FOUND_FILES)
|
||||
set(FOUND -1)
|
||||
endif(FOUND_FILES)
|
||||
|
||||
if(FOUND EQUAL -1)
|
||||
find_path(DEP_PATH ${DEP_FILE} PATHS ${SEARCH_DIRS} NO_DEFAULT_PATH)
|
||||
if(DEP_PATH)
|
||||
set(FOUND_FILES ${FOUND_FILES} "${DEP_PATH}/${DEP_FILE}")
|
||||
set(DEP_PATH NOTFOUND) #reset DEP_PATH for the next find_path call.
|
||||
else(DEP_PATH)
|
||||
set(MISSING_FILES ${MISSING_FILES} ${DEP_FILE})
|
||||
endif(DEP_PATH)
|
||||
endif(FOUND EQUAL -1)
|
||||
endforeach(DEP_FILE)
|
||||
|
||||
if(MISSING_FILES)
|
||||
message("Missing:")
|
||||
foreach(FILE ${MISSING_FILES})
|
||||
message(" ${FILE}")
|
||||
endforeach(FILE)
|
||||
message("Searched in:")
|
||||
foreach(SEARCH_DIR ${SEARCH_DIRS})
|
||||
message(" ${SEARCH_DIR}")
|
||||
endforeach(SEARCH_DIR)
|
||||
message(FATAL_ERROR "Failed")
|
||||
endif(MISSING_FILES)
|
||||
|
||||
if(FOUND_FILES)
|
||||
foreach(FILE ${FOUND_FILES})
|
||||
get_filename_component(DST_FILE ${FILE} NAME)
|
||||
set(DST_FILE "${DST_PATH}/${DST_FILE}")
|
||||
message("Copying ${FILE} to ${DST_FILE}")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FILE} ${DST_FILE}
|
||||
)
|
||||
endforeach(FILE ${FOUND_FILES})
|
||||
endif(FOUND_FILES)
|
||||
message("Success!")
|
||||
82
indra/cmake/DirectX.cmake
Normal file
82
indra/cmake/DirectX.cmake
Normal file
@@ -0,0 +1,82 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Variables)
|
||||
|
||||
if (WINDOWS)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set (DIRECTX_ARCHITECTURE x86)
|
||||
elseif (WORD_SIZE EQUAL 64)
|
||||
set (DIRECTX_ARCHITECTURE x64)
|
||||
else (WORD_SIZE EQUAL 32)
|
||||
set (DIRECTX_ARCHITECTURE x86)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
|
||||
SET(program_files $ENV{ProgramW6432})
|
||||
if(NOT program_files)
|
||||
SET(program_files $ENV{ProgramFiles})
|
||||
endif(NOT program_files)
|
||||
SET(program_files_x86 "ProgramFiles(x86)")
|
||||
SET(program_files_x86 $ENV{${program_files_x86}})
|
||||
|
||||
find_path(DIRECTX_ROOT_DIR Include/dxdiag.h
|
||||
PATHS
|
||||
"$ENV{DXSDK_DIR}"
|
||||
"${program_files}/Microsoft DirectX SDK (June 2010)"
|
||||
"${program_files_x86}/Microsoft DirectX SDK (June 2010)"
|
||||
"${program_files}/Microsoft DirectX SDK (February 2010)"
|
||||
"${program_files_x86}/Microsoft DirectX SDK (February 2010)"
|
||||
"${program_files}/Microsoft DirectX SDK (March 2009)"
|
||||
"${program_files_x86}/Microsoft DirectX SDK (March 2009)"
|
||||
"${program_files}/Microsoft DirectX SDK (August 2008)"
|
||||
"${program_files_x86}/Microsoft DirectX SDK (August 2008)"
|
||||
"${program_files}/Microsoft DirectX SDK (June 2008)"
|
||||
"${program_files_x86}/Microsoft DirectX SDK (June 2008)"
|
||||
"${program_files}/Microsoft DirectX SDK (March 2008)"
|
||||
"${program_files_x86}/Microsoft DirectX SDK (March 2008)"
|
||||
"${program_files}/Microsoft DirectX SDK (November 2007)"
|
||||
"${program_files_x86}/Microsoft DirectX SDK (November 2007)"
|
||||
"${program_files}/Microsoft DirectX SDK (August 2007)"
|
||||
"${program_files_x86}/Microsoft DirectX SDK (August 2007)"
|
||||
)
|
||||
|
||||
if (DIRECTX_ROOT_DIR)
|
||||
set (DIRECTX_INCLUDE_DIR "${DIRECTX_ROOT_DIR}/Include")
|
||||
set (DIRECTX_LIBRARY_DIR "${DIRECTX_ROOT_DIR}/Lib/${DIRECTX_ARCHITECTURE}")
|
||||
else (DIRECTX_ROOT_DIR)
|
||||
find_path (WIN_KIT_ROOT_DIR Include/um/windows.h
|
||||
PATHS
|
||||
"${program_files}/Windows Kits/8.1"
|
||||
"${program_files_x86}/Windows Kits/8.1"
|
||||
"${program_files}/Windows Kits/8.0"
|
||||
"${program_files_x86}/Windows Kits/8.0"
|
||||
)
|
||||
|
||||
find_path (WIN_KIT_LIB_DIR dxguid.lib
|
||||
"${WIN_KIT_ROOT_DIR}/Lib/winv6.3/um/${DIRECTX_ARCHITECTURE}"
|
||||
"${WIN_KIT_ROOT_DIR}/Lib/Win8/um/${DIRECTX_ARCHITECTURE}"
|
||||
)
|
||||
|
||||
if (WIN_KIT_ROOT_DIR AND WIN_KIT_LIB_DIR)
|
||||
set (DIRECTX_INCLUDE_DIR "${WIN_KIT_ROOT_DIR}/Include/um" "${WIN_KIT_ROOT_DIR}/Include/shared")
|
||||
set (DIRECTX_LIBRARY_DIR "${WIN_KIT_LIB_DIR}")
|
||||
endif (WIN_KIT_ROOT_DIR AND WIN_KIT_LIB_DIR)
|
||||
endif (DIRECTX_ROOT_DIR)
|
||||
|
||||
if (DIRECTX_INCLUDE_DIR)
|
||||
include_directories(${DIRECTX_INCLUDE_DIR})
|
||||
if (DIRECTX_FIND_QUIETLY)
|
||||
message(STATUS "Found DirectX include: ${DIRECTX_INCLUDE_DIR}")
|
||||
endif (DIRECTX_FIND_QUIETLY)
|
||||
else (DIRECTX_INCLUDE_DIR)
|
||||
message(FATAL_ERROR "Could not find DirectX SDK Include")
|
||||
endif (DIRECTX_INCLUDE_DIR)
|
||||
|
||||
if (DIRECTX_LIBRARY_DIR)
|
||||
if (DIRECTX_FIND_QUIETLY)
|
||||
message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}")
|
||||
endif (DIRECTX_FIND_QUIETLY)
|
||||
else (DIRECTX_LIBRARY_DIR)
|
||||
message(FATAL_ERROR "Could not find DirectX SDK Libraries")
|
||||
endif (DIRECTX_LIBRARY_DIR)
|
||||
|
||||
endif (WINDOWS)
|
||||
45
indra/cmake/DownloadPrebuilt.cmake.in
Normal file
45
indra/cmake/DownloadPrebuilt.cmake.in
Normal file
@@ -0,0 +1,45 @@
|
||||
# This script drives download of prebuilt packages during the build.
|
||||
# The top-level CMakeLists.txt configures packages and tool locations.
|
||||
set(packages "@PREBUILT_PACKAGES@")
|
||||
set(python "@PYTHON_EXECUTABLE@")
|
||||
set(install_dir "@CMAKE_BINARY_DIR@/packages")
|
||||
set(scp "@SCP_EXECUTABLE@")
|
||||
set(scripts_dir "@SCRIPTS_DIR@")
|
||||
set(sentinel_dir "@CMAKE_BINARY_DIR@/prepare")
|
||||
set(prebuilt_type "@PREBUILT_TYPE@")
|
||||
|
||||
# In proprietary mode we use scp for download.
|
||||
set(proprietary "@INSTALL_PROPRIETARY@")
|
||||
if(proprietary)
|
||||
set(scp_option "--scp=${scp}")
|
||||
set(proprietary_message " proprietary")
|
||||
endif(proprietary)
|
||||
|
||||
foreach(package ${packages})
|
||||
if(${install_dir}/install.xml IS_NEWER_THAN ${sentinel_dir}/${package}_installed)
|
||||
# This package is missing or out of date.
|
||||
message(STATUS "Obtaining${proprietary_message} prebuilt '${package}'")
|
||||
execute_process(
|
||||
COMMAND ${python} install.py -p${prebuilt_type} --install-dir=${install_dir} --installed-manifest=${install_dir}/installed.xml ${scp_option} ${package}
|
||||
WORKING_DIRECTORY ${scripts_dir}
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
if(result STREQUAL 0)
|
||||
# Write a sentinel to avoid attempting a download again.
|
||||
file(WRITE ${sentinel_dir}/${package}_installed "Obtained '${package}'")
|
||||
else(result STREQUAL 0)
|
||||
# Remove the sentinel to ensure a download is attempted again.
|
||||
file(REMOVE ${sentinel_dir}/prebuilt
|
||||
${sentinel_dir}/${package}_installed)
|
||||
message(FATAL_ERROR
|
||||
"Failed to download or unpack prebuilt '${package}'. "
|
||||
"Process returned: ${result}")
|
||||
endif(result STREQUAL 0)
|
||||
else(${install_dir}/install.xml IS_NEWER_THAN ${sentinel_dir}/${package}_installed)
|
||||
# This package is ready.
|
||||
message(STATUS "Prebuilt '${package}' is up-to-date")
|
||||
endif(${install_dir}/install.xml IS_NEWER_THAN ${sentinel_dir}/${package}_installed)
|
||||
endforeach(package)
|
||||
|
||||
# Store a sentinel to avoid running this script unnecessarily.
|
||||
file(WRITE ${sentinel_dir}/prebuilt "All prebuilts obtained successfully\n")
|
||||
22
indra/cmake/ELFIO.cmake
Normal file
22
indra/cmake/ELFIO.cmake
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
set(ELFIO_FIND_QUIETLY ON)
|
||||
|
||||
if (STANDALONE)
|
||||
include(FindELFIO)
|
||||
elseif (LINUX)
|
||||
use_prebuilt_binary(elfio)
|
||||
set(ELFIO_LIBRARIES ELFIO)
|
||||
set(ELFIO_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
set(ELFIO_FOUND "YES")
|
||||
endif (STANDALONE)
|
||||
|
||||
if (ELFIO_FOUND)
|
||||
add_definitions(-DLL_ELFBIN=1)
|
||||
else (ELFIO_FOUND)
|
||||
set(ELFIO_INCLUDE_DIR "")
|
||||
endif (ELFIO_FOUND)
|
||||
@@ -9,9 +9,16 @@ if (STANDALONE)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(expat)
|
||||
if (WINDOWS)
|
||||
set(EXPAT_LIBRARIES expat)
|
||||
if (MSVC12)
|
||||
set(EXPAT_LIBRARIES expat)
|
||||
else (MSVC12)
|
||||
set(EXPAT_LIBRARIES libexpatMT)
|
||||
endif (MSVC12)
|
||||
else (WINDOWS)
|
||||
set(EXPAT_LIBRARIES expat)
|
||||
endif (WINDOWS)
|
||||
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(EXPAT_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
116
indra/cmake/FMODEX.cmake
Normal file
116
indra/cmake/FMODEX.cmake
Normal file
@@ -0,0 +1,116 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Linking)
|
||||
|
||||
if (FMODEX AND FMODSTUDIO)
|
||||
message( FATAL_ERROR "You can not enable two FMOD variants at the same time." )
|
||||
endif (FMODEX AND FMODSTUDIO)
|
||||
|
||||
unset(FMOD_LIBRARY_RELEASE CACHE)
|
||||
unset(FMOD_LIBRARY_DEBUG CACHE)
|
||||
unset(FMOD_INCLUDE_DIR CACHE)
|
||||
|
||||
set(FMOD_EXTERNAL_LIB OFF)
|
||||
|
||||
if(STANDALONE OR WINDOWS)
|
||||
if (NOT FMODEX_SDK_DIR AND WINDOWS)
|
||||
GET_FILENAME_COMPONENT(REG_DIR [HKEY_CURRENT_USER\\Software\\FMOD\ Programmers\ API\ Windows] ABSOLUTE)
|
||||
set(FMODEX_SDK_DIR ${REG_DIR} CACHE PATH "Path to the FMOD Ex SDK." FORCE)
|
||||
endif (NOT FMODEX_SDK_DIR AND WINDOWS)
|
||||
if(NOT FMODEX_SDK_DIR AND STANDALONE)
|
||||
message(FATAL_ERROR "FMODEX_SDK_DIR not set!")
|
||||
endif(NOT FMODEX_SDK_DIR AND STANDALONE)
|
||||
endif(STANDALONE OR WINDOWS)
|
||||
|
||||
if(FMODEX_SDK_DIR)
|
||||
set(fmod_lib_paths "${FMODEX_SDK_DIR}/api" "${FMODEX_SDK_DIR}/api/lib" )
|
||||
set(fmod_inc_paths "${FMODEX_SDK_DIR}/api/inc")
|
||||
|
||||
if(WINDOWS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
|
||||
endif(WINDOWS)
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
find_library(FMOD_LIBRARY_RELEASE fmodex64 PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
find_library(FMOD_LIBRARY_DEBUG fmodexL64 PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
else(WORD_SIZE EQUAL 64)#Check if CMAKE_FIND_LIBRARY_PREFIXES is set to 'lib' for darwin.
|
||||
find_library(FMOD_LIBRARY_RELEASE fmodex PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
find_library(FMOD_LIBRARY_DEBUG fmodexL PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
if(WINDOWS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
find_library(FMOD_LINK_LIBRARY_RELEASE fmodex64_vc PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
find_library(FMOD_LINK_LIBRARY_DEBUG fmodexL64_vc PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
else(WORD_SIZE EQUAL 64)#Check if CMAKE_FIND_LIBRARY_PREFIXES is set to 'lib' for darwin.
|
||||
find_library(FMOD_LINK_LIBRARY_RELEASE fmodex_vc PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
find_library(FMOD_LINK_LIBRARY_DEBUG fmodexL_vc PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
else(WINDOWS)
|
||||
set(FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||
set(FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||
endif(WINDOWS)
|
||||
find_path(FMOD_INCLUDE_DIR fmod.hpp ${fmod_inc_paths})
|
||||
if(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
if(STANDALONE)
|
||||
message(FATAL_ERROR "Provided FMODEX_SDK_DIR path not found '{$FMODEX_SDK_DIR}'")
|
||||
else(STANDALONE)
|
||||
message(STATUS "Provided FMODEX_SDK_DIR path not found '${FMODEX_SDK_DIR}'. Falling back to prebuilts")
|
||||
endif(STANDALONE)
|
||||
else(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
message(STATUS "Using system-provided FMOD Ex Libraries")
|
||||
set(FMOD_EXTERNAL_LIB ON)
|
||||
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
endif (FMODEX_SDK_DIR)
|
||||
|
||||
if (NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
if(WINDOWS)
|
||||
set(lib_suffix .dll)
|
||||
elseif(DARWIN)
|
||||
set(lib_suffix .dylib)
|
||||
else(WINDOWS)
|
||||
set(lib_suffix .so)
|
||||
endif(WINDOWS)
|
||||
if(WINDOWS)
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmodex64${lib_suffix})
|
||||
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodexL64${lib_suffix})
|
||||
else(WORD_SIZE EQUAL 64)
|
||||
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmodex${lib_suffix})
|
||||
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodexL${lib_suffix})
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
else(WINDOWS)
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/libfmodex64${lib_suffix})
|
||||
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/libfmodex64L${lib_suffix})
|
||||
else(WORD_SIZE EQUAL 64)
|
||||
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/libfmodex${lib_suffix})
|
||||
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/libfmodexL${lib_suffix})
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
endif(WINDOWS)
|
||||
set(FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||
set(FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||
if(WINDOWS)
|
||||
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||
endif(WINDOWS)
|
||||
use_prebuilt_binary(fmodex)
|
||||
set(FMOD_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include/fmodex)
|
||||
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
|
||||
if(FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||
set(FMOD ON)
|
||||
if (NOT FMOD_LIBRARY_DEBUG) #Use release library in debug configuration if debug library is absent.
|
||||
set(FMOD_LIBRARY_DEBUG ${FMOD_LIBRARY_RELEASE})
|
||||
endif (NOT FMOD_LIBRARY_DEBUG)
|
||||
else (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||
message(STATUS "No support for FMOD EX audio (need to set FMODEX_SDK_DIR?)")
|
||||
set(FMOD OFF)
|
||||
set(FMODEX OFF)
|
||||
endif (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||
|
||||
if (FMOD)
|
||||
message(STATUS "Building with FMOD Ex audio support")
|
||||
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODEX")
|
||||
endif (FMOD)
|
||||
@@ -1,8 +1,70 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Variables)
|
||||
if (FMODSTUDIO)
|
||||
use_prebuilt_binary(fmodstudio)
|
||||
include(Linking)
|
||||
|
||||
if (FMODEX AND FMODSTUDIO)
|
||||
message( FATAL_ERROR "You can not enable two FMOD variants at the same time." )
|
||||
endif (FMODEX AND FMODSTUDIO)
|
||||
|
||||
unset(FMOD_LIBRARY_RELEASE CACHE)
|
||||
unset(FMOD_LIBRARY_DEBUG CACHE)
|
||||
unset(FMOD_INCLUDE_DIR CACHE)
|
||||
|
||||
set(FMOD_EXTERNAL_LIB OFF)
|
||||
|
||||
if(STANDALONE OR WINDOWS)
|
||||
if (NOT FMODSTUDIO_SDK_DIR AND WINDOWS)
|
||||
#GET_FILENAME_COMPONENT(REG_DIR [HKEY_CURRENT_USER\\Software\\FMOD\ Studio\ API\ Windows] ABSOLUTE)
|
||||
#set(FMODSTUDIO_SDK_DIR ${REG_DIR} CACHE PATH "Path to the FMOD Studio SDK." FORCE)
|
||||
endif (NOT FMODSTUDIO_SDK_DIR AND WINDOWS)
|
||||
if(NOT FMODSTUDIO_SDK_DIR AND STANDALONE)
|
||||
message(FATAL_ERROR "FMODSTUDIO_SDK_DIR not set!")
|
||||
endif(NOT FMODSTUDIO_SDK_DIR AND STANDALONE)
|
||||
endif(STANDALONE OR WINDOWS)
|
||||
|
||||
if(FMODSTUDIO_SDK_DIR)
|
||||
if(LINUX AND WORD_SIZE EQUAL 32)
|
||||
set(fmod_lib_paths "${FMODSTUDIO_SDK_DIR}/api/lowlevel/lib/x86" )
|
||||
elseif(LINUX)
|
||||
set(fmod_lib_paths "${FMODSTUDIO_SDK_DIR}/api/lowlevel/lib/x86_64")
|
||||
else(LINUX AND WORD_SIZE EQUAL 32)
|
||||
set(fmod_lib_paths "${FMODSTUDIO_SDK_DIR}/api/lowlevel/lib")
|
||||
endif(LINUX AND WORD_SIZE EQUAL 32)
|
||||
set(fmod_inc_paths "${FMODSTUDIO_SDK_DIR}/api/lowlevel/inc")
|
||||
|
||||
if(WINDOWS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
|
||||
endif(WINDOWS)
|
||||
if(WORD_SIZE EQUAL 64 AND WINDOWS)
|
||||
find_library(FMOD_LIBRARY_RELEASE fmod64 PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
find_library(FMOD_LIBRARY_DEBUG fmodL64 PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
else(WORD_SIZE EQUAL 64 AND WINDOWS)#Check if CMAKE_FIND_LIBRARY_PREFIXES is set to 'lib' for darwin.
|
||||
find_library(FMOD_LIBRARY_RELEASE fmod PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
find_library(FMOD_LIBRARY_DEBUG fmodL PATHS ${fmod_lib_paths} NO_DEFAULT_PATH)
|
||||
endif(WORD_SIZE EQUAL 64 AND WINDOWS)
|
||||
if(WINDOWS)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
|
||||
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||
else(WINDOWS)
|
||||
set(FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||
set(FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||
endif(WINDOWS)
|
||||
find_path(FMOD_INCLUDE_DIR fmod.hpp ${fmod_inc_paths})
|
||||
if(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
if(STANDALONE)
|
||||
message(FATAL_ERROR "Provided FMODSTUDIO_SDK_DIR path not found '{$FMODSTUDIO_SDK_DIR}'")
|
||||
else(STANDALONE)
|
||||
message(STATUS "Provided FMODSTUDIO_SDK_DIR path not found '${FMODSTUDIO_SDK_DIR}'. Falling back to prebuilts")
|
||||
endif(STANDALONE)
|
||||
else(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
message(STATUS "Using system-provided FMOD Studio Libraries")
|
||||
set(FMOD_EXTERNAL_LIB ON)
|
||||
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
endif (FMODSTUDIO_SDK_DIR)
|
||||
|
||||
if (NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
if(WINDOWS)
|
||||
set(lib_suffix .dll)
|
||||
elseif(DARWIN)
|
||||
@@ -24,19 +86,14 @@ if (FMODSTUDIO)
|
||||
endif(WINDOWS)
|
||||
set(FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||
set(FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||
|
||||
if(WINDOWS)
|
||||
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_RELEASE ${FMOD_LIBRARY_RELEASE})
|
||||
string(REPLACE ".dll" "_vc.lib" FMOD_LINK_LIBRARY_DEBUG ${FMOD_LIBRARY_DEBUG})
|
||||
endif(WINDOWS)
|
||||
|
||||
set (FMOD_LIBRARY
|
||||
debug ${FMOD_LINK_LIBRARY_DEBUG}
|
||||
optimized ${FMOD_LINK_LIBRARY_RELEASE}
|
||||
)
|
||||
|
||||
set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio)
|
||||
endif(FMODSTUDIO)
|
||||
use_prebuilt_binary(fmodstudio)
|
||||
set(FMOD_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include/fmodstudio)
|
||||
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
|
||||
if(FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||
set(FMOD ON)
|
||||
@@ -51,6 +108,5 @@ endif (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||
|
||||
if (FMOD)
|
||||
message(STATUS "Building with FMOD Studio audio support")
|
||||
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODSTUDIO=1")
|
||||
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_FMODSTUDIO")
|
||||
endif (FMOD)
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
#
|
||||
# Find the autobuild tool
|
||||
#
|
||||
# Output variables:
|
||||
#
|
||||
# AUTOBUILD_EXECUTABLE - path to autobuild executable
|
||||
|
||||
|
||||
|
||||
IF (NOT AUTOBUILD_EXECUTABLE)
|
||||
|
||||
# If cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var
|
||||
IF (DEFINED ENV{AUTOBUILD})
|
||||
SET(AUTOBUILD_EXECUTABLE $ENV{AUTOBUILD})
|
||||
ELSE (DEFINED ENV{AUTOBUILD})
|
||||
IF(WIN32)
|
||||
SET(AUTOBUILD_EXE_NAMES autobuild.exe autobuild.cmd)
|
||||
ELSE(WIN32)
|
||||
SET(AUTOBUILD_EXE_NAMES autobuild)
|
||||
ENDIF(WIN32)
|
||||
|
||||
SET(AUTOBUILD_EXECUTABLE)
|
||||
FIND_PROGRAM(
|
||||
AUTOBUILD_EXECUTABLE
|
||||
NAMES ${AUTOBUILD_EXE_NAMES}
|
||||
PATHS
|
||||
ENV PATH
|
||||
${CMAKE_SOURCE_DIR}/..
|
||||
${CMAKE_SOURCE_DIR}/../..
|
||||
${CMAKE_SOURCE_DIR}/../../..
|
||||
PATH_SUFFIXES "/autobuild/bin/"
|
||||
)
|
||||
ENDIF (DEFINED ENV{AUTOBUILD})
|
||||
|
||||
IF (NOT AUTOBUILD_EXECUTABLE)
|
||||
IF (AUTOBUILD_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find autobuild executable")
|
||||
ENDIF (AUTOBUILD_FIND_REQUIRED)
|
||||
ENDIF (NOT AUTOBUILD_EXECUTABLE)
|
||||
|
||||
MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE)
|
||||
ENDIF (NOT AUTOBUILD_EXECUTABLE)
|
||||
50
indra/cmake/FindBerkeleyDB.cmake
Normal file
50
indra/cmake/FindBerkeleyDB.cmake
Normal file
@@ -0,0 +1,50 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# - Find BerkeleyDB
|
||||
# Find the BerkeleyDB includes and library
|
||||
# This module defines
|
||||
# DB_INCLUDE_DIR, where to find db.h, etc.
|
||||
# DB_LIBRARIES, the libraries needed to use BerkeleyDB.
|
||||
# DB_FOUND, If false, do not try to use BerkeleyDB.
|
||||
# also defined, but not for general use are
|
||||
# DB_LIBRARY, where to find the BerkeleyDB library.
|
||||
|
||||
FIND_PATH(DB_INCLUDE_DIR db.h
|
||||
/usr/local/include/db4
|
||||
/usr/local/include
|
||||
/usr/include/db4
|
||||
/usr/include
|
||||
)
|
||||
|
||||
SET(DB_NAMES ${DB_NAMES} db)
|
||||
FIND_LIBRARY(DB_LIBRARY
|
||||
NAMES ${DB_NAMES}
|
||||
PATHS /usr/lib /usr/local/lib
|
||||
)
|
||||
|
||||
IF (DB_LIBRARY AND DB_INCLUDE_DIR)
|
||||
SET(DB_LIBRARIES ${DB_LIBRARY})
|
||||
SET(DB_FOUND "YES")
|
||||
ELSE (DB_LIBRARY AND DB_INCLUDE_DIR)
|
||||
SET(DB_FOUND "NO")
|
||||
ENDIF (DB_LIBRARY AND DB_INCLUDE_DIR)
|
||||
|
||||
|
||||
IF (DB_FOUND)
|
||||
IF (NOT DB_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found BerkeleyDB: ${DB_LIBRARIES}")
|
||||
ENDIF (NOT DB_FIND_QUIETLY)
|
||||
ELSE (DB_FOUND)
|
||||
IF (DB_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find BerkeleyDB library")
|
||||
ENDIF (DB_FIND_REQUIRED)
|
||||
ENDIF (DB_FOUND)
|
||||
|
||||
# Deprecated declarations.
|
||||
SET (NATIVE_DB_INCLUDE_PATH ${DB_INCLUDE_DIR} )
|
||||
GET_FILENAME_COMPONENT (NATIVE_DB_LIB_PATH ${DB_LIBRARY} PATH)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
DB_LIBRARY
|
||||
DB_INCLUDE_DIR
|
||||
)
|
||||
48
indra/cmake/FindELFIO.cmake
Normal file
48
indra/cmake/FindELFIO.cmake
Normal file
@@ -0,0 +1,48 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# - Find ELFIO
|
||||
# Find the ELFIO includes and library
|
||||
# This module defines
|
||||
# ELFIO_INCLUDE_DIR, where to find elfio.h, etc.
|
||||
# ELFIO_LIBRARIES, the libraries needed to use ELFIO.
|
||||
# ELFIO_FOUND, If false, do not try to use ELFIO.
|
||||
# also defined, but not for general use are
|
||||
# ELFIO_LIBRARY, where to find the ELFIO library.
|
||||
|
||||
FIND_PATH(ELFIO_INCLUDE_DIR ELFIO/ELFIO.h
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
|
||||
SET(ELFIO_NAMES ${ELFIO_NAMES} ELFIO)
|
||||
FIND_LIBRARY(ELFIO_LIBRARY
|
||||
NAMES ${ELFIO_NAMES}
|
||||
PATHS /usr/lib /usr/local/lib
|
||||
)
|
||||
|
||||
IF (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
|
||||
SET(ELFIO_LIBRARIES ${ELFIO_LIBRARY})
|
||||
SET(ELFIO_FOUND "YES")
|
||||
ELSE (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
|
||||
SET(ELFIO_FOUND "NO")
|
||||
ENDIF (ELFIO_LIBRARY AND ELFIO_INCLUDE_DIR)
|
||||
|
||||
|
||||
IF (ELFIO_FOUND)
|
||||
IF (NOT ELFIO_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found ELFIO: ${ELFIO_LIBRARIES}")
|
||||
ENDIF (NOT ELFIO_FIND_QUIETLY)
|
||||
ELSE (ELFIO_FOUND)
|
||||
IF (ELFIO_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find ELFIO library")
|
||||
ENDIF (ELFIO_FIND_REQUIRED)
|
||||
ENDIF (ELFIO_FOUND)
|
||||
|
||||
# Deprecated declarations.
|
||||
SET (NATIVE_ELFIO_INCLUDE_PATH ${ELFIO_INCLUDE_DIR} )
|
||||
GET_FILENAME_COMPONENT (NATIVE_ELFIO_LIB_PATH ${ELFIO_LIBRARY} PATH)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ELFIO_LIBRARY
|
||||
ELFIO_INCLUDE_DIR
|
||||
)
|
||||
62
indra/cmake/FindLLQtWebkit.cmake
Normal file
62
indra/cmake/FindLLQtWebkit.cmake
Normal file
@@ -0,0 +1,62 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# - Find llqtwebkit
|
||||
# Find the llqtwebkit includes and library
|
||||
# This module defines
|
||||
# LLQTWEBKIT_INCLUDE_DIR, where to find llqtwebkit.h, etc.
|
||||
# LLQTWEBKIT_LIBRARY, the llqtwebkit library with full path.
|
||||
# LLQTWEBKIT_FOUND, If false, do not try to use llqtwebkit.
|
||||
# also defined, but not for general use are
|
||||
# LLQTWEBKIT_LIBRARIES, the libraries needed to use llqtwebkit.
|
||||
# LLQTWEBKIT_LIBRARY_DIRS, where to find the llqtwebkit library.
|
||||
# LLQTWEBKIT_DEFINITIONS - You should add_definitions(${LLQTWEBKIT_DEFINITIONS})
|
||||
# before compiling code that includes llqtwebkit library files.
|
||||
|
||||
# Try to use pkg-config first.
|
||||
# This allows to have two different libllqtwebkit packages installed:
|
||||
# one for viewer 2.x and one for viewer 1.x.
|
||||
include(FindPkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
if (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
set(_PACKAGE_ARGS libllqtwebkit>=${LLQtWebkit_FIND_VERSION} REQUIRED)
|
||||
else (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
set(_PACKAGE_ARGS libllqtwebkit)
|
||||
endif (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
if (NOT "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS "2.8")
|
||||
# As virtually nobody will have a pkg-config file for this, do this check always quiet.
|
||||
# Unfortunately cmake 2.8 or higher is required for pkg_check_modules to have a 'QUIET'.
|
||||
set(_PACKAGE_ARGS ${_PACKAGE_ARGS} QUIET)
|
||||
endif ()
|
||||
pkg_check_modules(LLQTWEBKIT ${_PACKAGE_ARGS})
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
set(LLQTWEBKIT_DEFINITIONS ${LLQTWEBKIT_CFLAGS_OTHER})
|
||||
|
||||
find_path(LLQTWEBKIT_INCLUDE_DIR llqtwebkit.h NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_INCLUDE_DIRS})
|
||||
|
||||
find_library(LLQTWEBKIT_LIBRARY NAMES llqtwebkit NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_LIBRARY_DIRS})
|
||||
|
||||
if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) # If pkg-config couldn't find it, pretend we don't have pkg-config.
|
||||
set(LLQTWEBKIT_LIBRARIES llqtwebkit)
|
||||
get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH)
|
||||
endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set LLQTWEBKIT_FOUND
|
||||
# to TRUE if all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
LLQTWEBKIT
|
||||
DEFAULT_MSG
|
||||
LLQTWEBKIT_LIBRARY
|
||||
LLQTWEBKIT_INCLUDE_DIR
|
||||
LLQTWEBKIT_LIBRARIES
|
||||
LLQTWEBKIT_LIBRARY_DIRS
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
LLQTWEBKIT_LIBRARY
|
||||
LLQTWEBKIT_INCLUDE_DIR
|
||||
LLQTWEBKIT_LIBRARIES
|
||||
LLQTWEBKIT_LIBRARY_DIRS
|
||||
LLQTWEBKIT_DEFINITIONS
|
||||
)
|
||||
|
||||
@@ -7,7 +7,18 @@ if (STANDALONE)
|
||||
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(freetype)
|
||||
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/freetype2)
|
||||
if(MSVC12)
|
||||
set(FREETYPE_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/freetype2
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/freetype2
|
||||
)
|
||||
else(MSVC12)
|
||||
set(FREETYPE_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (MSVC12)
|
||||
|
||||
set(FREETYPE_LIBRARIES freetype)
|
||||
endif (STANDALONE)
|
||||
|
||||
|
||||
@@ -7,8 +7,10 @@ set(GLOD_FIND_REQUIRED ON)
|
||||
if (STANDALONE)
|
||||
include(FindGLOD)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(glod)
|
||||
|
||||
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/glod)
|
||||
set(GLOD_LIBRARIES GLOD)
|
||||
use_prebuilt_binary(GLOD)
|
||||
set(GLOD_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
set(GLOD_LIBRARIES glod)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -1,9 +1,30 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (STANDALONE)
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_check_modules(GSTREAMER010 REQUIRED gstreamer-0.10)
|
||||
pkg_check_modules(GSTREAMER010_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10)
|
||||
|
||||
else (STANDALONE)
|
||||
|
||||
# Possibly libxml and glib should have their own .cmake file instead...
|
||||
use_prebuilt_binary(glib) # gstreamer needs glib
|
||||
use_prebuilt_binary(libxml)
|
||||
use_prebuilt_binary(gstreamer)
|
||||
set(GSTREAMER010_FOUND ON FORCE BOOL)
|
||||
set(GSTREAMER010_PLUGINS_BASE_FOUND ON FORCE BOOL)
|
||||
set(GSTREAMER010_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/gstreamer-0.10
|
||||
${LIBS_PREBUILT_DIR}/includeg/lib-2.0
|
||||
${LIBS_PREBUILT_DIR}/include/libxml2
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/gstreamer-0.10
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/glib-2.0
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/libxml2
|
||||
)
|
||||
|
||||
endif (STANDALONE)
|
||||
|
||||
if (WINDOWS)
|
||||
# We don't need to explicitly link against gstreamer itself, because
|
||||
|
||||
@@ -4,12 +4,16 @@ include(Prebuilt)
|
||||
if (STANDALONE)
|
||||
include(FindHunSpell)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(libhunspell)
|
||||
use_prebuilt_binary(hunspell)
|
||||
|
||||
set(HUNSPELL_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include/hunspell
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/hunspell
|
||||
)
|
||||
|
||||
if (LINUX OR DARWIN)
|
||||
set(HUNSPELL_LIBRARY hunspell-1.3)
|
||||
else (LINUX OR DARWIN)
|
||||
set(HUNSPELL_LIBRARY libhunspell)
|
||||
endif (LINUX OR DARWIN)
|
||||
set(HUNSPELL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/hunspell)
|
||||
if (LINUX OR DARWIN)
|
||||
set(HUNSPELL_LIBRARY hunspell-1.3)
|
||||
else (LINUX OR DARWIN)
|
||||
set(HUNSPELL_LIBRARY libhunspell)
|
||||
endif (LINUX OR DARWIN)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -19,5 +19,8 @@ else (STANDALONE)
|
||||
elseif (WINDOWS)
|
||||
set(JPEG_LIBRARIES jpeglib)
|
||||
endif (LINUX)
|
||||
set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(JPEG_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -10,13 +10,22 @@ if (STANDALONE)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(jsoncpp)
|
||||
if (WINDOWS)
|
||||
set(JSONCPP_LIBRARIES
|
||||
debug jsoncppd.lib
|
||||
optimized jsoncpp.lib)
|
||||
if(MSVC12)
|
||||
set(JSONCPP_LIBRARIES
|
||||
debug json_vc${MSVC_SUFFIX}debug_libmt.lib
|
||||
optimized json_vc${MSVC_SUFFIX}_libmt)
|
||||
else(MSVC12)
|
||||
set(JSONCPP_LIBRARIES
|
||||
debug json_vc${MSVC_SUFFIX}d
|
||||
optimized json_vc${MSVC_SUFFIX})
|
||||
endif(MSVC12)
|
||||
elseif (DARWIN)
|
||||
set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt)
|
||||
elseif (LINUX)
|
||||
set(JSONCPP_LIBRARIES jsoncpp)
|
||||
endif (WINDOWS)
|
||||
set(JSONCPP_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/)
|
||||
set(JSONCPP_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include/jsoncpp
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/jsoncpp
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Audio)
|
||||
include(OPENAL)
|
||||
|
||||
set(LLAUDIO_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llaudio
|
||||
|
||||
@@ -28,7 +28,7 @@ else (LINUX)
|
||||
set(LLCOMMON_LIBRARIES llcommon)
|
||||
endif (LINUX)
|
||||
|
||||
set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a shared library.")
|
||||
set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.")
|
||||
if(LLCOMMON_LINK_SHARED)
|
||||
add_definitions(-DLL_COMMON_LINK_SHARED=1)
|
||||
endif(LLCOMMON_LINK_SHARED)
|
||||
|
||||
@@ -1,32 +1,22 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# these should be moved to their own cmake file
|
||||
include(Prebuilt)
|
||||
include(Boost)
|
||||
include(Colladadom)
|
||||
|
||||
|
||||
use_prebuilt_binary(libxml2)
|
||||
|
||||
set(LLPRIMITIVE_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llprimitive
|
||||
${COLLADADOM_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if (WINDOWS)
|
||||
set(LLPRIMITIVE_LIBRARIES
|
||||
llprimitive
|
||||
${COLLADADOM_LIBRARIES}
|
||||
libxml2_a
|
||||
${BOOST_SYSTEM_LIBRARIES}
|
||||
)
|
||||
set(LLPRIMITIVE_LIBRARIES
|
||||
debug llprimitive
|
||||
optimized llprimitive
|
||||
${COLLADADOM_LIBRARIES}
|
||||
)
|
||||
else (WINDOWS)
|
||||
set(LLPRIMITIVE_LIBRARIES
|
||||
llprimitive
|
||||
${COLLADADOM_LIBRARIES}
|
||||
${BOOST_SYSTEM_LIBRARIES}
|
||||
minizip
|
||||
xml2
|
||||
)
|
||||
set(LLPRIMITIVE_LIBRARIES
|
||||
llprimitive
|
||||
${COLLADADOM_LIBRARIES}
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
||||
|
||||
11
indra/cmake/LLQtWebkit.cmake
Normal file
11
indra/cmake/LLQtWebkit.cmake
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
if (STANDALONE)
|
||||
set(LLQTWEBKIT_INCLUDE_DIR
|
||||
${LIBS_OPEN_DIR}/llqtwebkit
|
||||
)
|
||||
|
||||
set(LLQTWEBKIT_LIBRARY
|
||||
llqtwebkit
|
||||
)
|
||||
endif (STANDALONE)
|
||||
@@ -1,12 +1,13 @@
|
||||
# ll_deploy_sharedlibs_command
|
||||
# target_exe: the cmake target of the executable for which the shared libs will be deployed.
|
||||
macro(ll_deploy_sharedlibs_command target_exe)
|
||||
set(OUTPUT_PATH $<TARGET_FILE_DIR:${target_exe}>)
|
||||
|
||||
SET(OUTPUT_PATH $<TARGET_FILE:${target_exe}>)
|
||||
|
||||
if(DARWIN)
|
||||
SET_TEST_PATH(SEARCH_DIRS)
|
||||
get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE)
|
||||
if(IS_BUNDLE)
|
||||
# If its a bundle the exe is not in the target location, this should find it.
|
||||
set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
|
||||
endif(IS_BUNDLE)
|
||||
elseif(WINDOWS)
|
||||
@@ -37,7 +38,8 @@ macro(ll_stage_sharedlib DSO_TARGET)
|
||||
# Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
|
||||
set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
|
||||
if(NOT WINDOWS)
|
||||
get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
|
||||
|
||||
SET(DSO_PATH $<TARGET_FILE:${DSO_TARGET}>)
|
||||
get_filename_component(DSO_FILE ${DSO_PATH} NAME)
|
||||
if(DARWIN)
|
||||
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
|
||||
|
||||
@@ -14,10 +14,18 @@ if (STANDALONE)
|
||||
)
|
||||
else (STANDALONE)
|
||||
if (LINUX)
|
||||
use_prebuilt_binary(mesa)
|
||||
use_prebuilt_binary(SDL)
|
||||
set (SDL_FOUND TRUE)
|
||||
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
|
||||
set (SDL_LIBRARY SDL)
|
||||
set (SDL_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
set (SDL_LIBRARY SDL)
|
||||
else(WORD_SIZE EQUAL 64)
|
||||
set (SDL_LIBRARY SDL directfb fusion direct)
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
endif (LINUX)
|
||||
endif (STANDALONE)
|
||||
|
||||
|
||||
@@ -1,50 +1,42 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
|
||||
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
|
||||
|
||||
include(Variables)
|
||||
|
||||
set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
|
||||
set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins)
|
||||
set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release)
|
||||
set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug)
|
||||
if (WINDOWS)
|
||||
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
|
||||
set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
|
||||
elseif (LINUX)
|
||||
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/lib)
|
||||
set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin)
|
||||
elseif (DARWIN)
|
||||
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
|
||||
set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs")
|
||||
endif (WINDOWS)
|
||||
if (NOT STANDALONE)
|
||||
|
||||
# Autobuild packages must provide 'release' versions of libraries, but may provide versions for
|
||||
# specific build types. AUTOBUILD_LIBS_INSTALL_DIRS lists first the build type directory and then
|
||||
# the 'release' directory (as a default fallback).
|
||||
# *NOTE - we have to take special care to use CMAKE_CFG_INTDIR on IDE generators (like mac and
|
||||
# windows) and CMAKE_BUILD_TYPE on Makefile based generators (like linux). The reason for this is
|
||||
# that CMAKE_BUILD_TYPE is essentially meaningless at configuration time for IDE generators and
|
||||
# CMAKE_CFG_INTDIR is meaningless at build time for Makefile generators
|
||||
if(WINDOWS OR DARWIN)
|
||||
# the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us
|
||||
# fortunately both windows and darwin are case insensitive filesystems so this works.
|
||||
set(AUTOBUILD_LIBS_INSTALL_DIRS "${AUTOBUILD_INSTALL_DIR}/lib/")
|
||||
else(WINDOWS OR DARWIN)
|
||||
# else block is for linux and any other makefile based generators
|
||||
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
|
||||
set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER})
|
||||
endif(WINDOWS OR DARWIN)
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
|
||||
endif(CMAKE_BUILD_TYPE)
|
||||
|
||||
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
# When we're building something other than Release, append the
|
||||
# packages/lib/release directory to deal with autobuild packages that don't
|
||||
# provide (e.g.) lib/debug libraries.
|
||||
list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
|
||||
endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
if(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||
# the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us
|
||||
# fortunately both windows and darwin are case insensitive filesystems so this works.
|
||||
set(ARCH_PREBUILT_LINK_DIRS
|
||||
${LIBS_PREBUILT_DIR}/lib
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/lib
|
||||
)
|
||||
else(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||
# else block is for linux and any other makefile based generators
|
||||
set(ARCH_PREBUILT_LINK_DIRS
|
||||
${LIBS_PREBUILT_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}
|
||||
)
|
||||
endif(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||
|
||||
link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
|
||||
if (NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "release")
|
||||
# When we're building something other than Release, append the
|
||||
# packages/lib/release directory to deal with autobuild packages that don't
|
||||
# provide (e.g.) lib/debug libraries.
|
||||
list(APPEND ARCH_PREBUILT_LINK_DIRS
|
||||
${LIBS_PREBUILT_DIR}/lib/release
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
|
||||
)
|
||||
endif (NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "release")
|
||||
endif (NOT STANDALONE)
|
||||
|
||||
link_directories(${ARCH_PREBUILT_LINK_DIRS})
|
||||
|
||||
if (LINUX)
|
||||
set(DL_LIBRARY dl)
|
||||
@@ -54,11 +46,10 @@ else (LINUX)
|
||||
set(PTHREAD_LIBRARY "")
|
||||
endif (LINUX)
|
||||
|
||||
if (WINDOWS)
|
||||
if (WINDOWS)
|
||||
set(WINDOWS_LIBRARIES
|
||||
advapi32
|
||||
shell32
|
||||
ole32
|
||||
ws2_32
|
||||
mswsock
|
||||
psapi
|
||||
|
||||
@@ -7,11 +7,7 @@ if (STANDALONE)
|
||||
message(STATUS "Building without N-DoF joystick support")
|
||||
endif(NOT NDOF_FOUND)
|
||||
else (STANDALONE)
|
||||
if (WINDOWS OR DARWIN)
|
||||
use_prebuilt_binary(libndofdev)
|
||||
elseif (LINUX)
|
||||
use_prebuilt_binary(libndofdev-open)
|
||||
endif (WINDOWS OR DARWIN)
|
||||
use_prebuilt_binary(ndofdev)
|
||||
|
||||
if (WINDOWS)
|
||||
set(NDOF_LIBRARY libndofdev)
|
||||
@@ -19,11 +15,10 @@ else (STANDALONE)
|
||||
set(NDOF_LIBRARY ndofdev)
|
||||
endif (WINDOWS)
|
||||
|
||||
if (WINDOWS)
|
||||
set(NDOF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
|
||||
else (WINDOWS)
|
||||
set(NDOF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/ndofdev)
|
||||
endif (WINDOWS)
|
||||
set(NDOF_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include/ndofdev
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/ndofdev
|
||||
)
|
||||
set(NDOF_FOUND 1)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -31,8 +26,6 @@ if (NDOF_FOUND)
|
||||
add_definitions(-DLIB_NDOF=1)
|
||||
include_directories(${NDOF_INCLUDE_DIR})
|
||||
else (NDOF_FOUND)
|
||||
message(STATUS "Building without N-DoF joystick support")
|
||||
set(NDOF_INCLUDE_DIR "")
|
||||
set(NDOF_LIBRARY "")
|
||||
endif (NDOF_FOUND)
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
include(Prebuilt)
|
||||
include(Variables)
|
||||
|
||||
set(NVAPI ON CACHE BOOL "Use NVAPI.")
|
||||
|
||||
if (NVAPI)
|
||||
if (WINDOWS)
|
||||
use_prebuilt_binary(nvapi)
|
||||
|
||||
@@ -16,13 +16,16 @@ if (OPENAL)
|
||||
pkg_check_modules(OPENAL_LIB REQUIRED openal)
|
||||
pkg_check_modules(FREEALUT_LIB REQUIRED freealut)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(openal)
|
||||
use_prebuilt_binary(openal-soft)
|
||||
endif (STANDALONE)
|
||||
set(OPENAL_LIBRARIES
|
||||
openal
|
||||
alut
|
||||
)
|
||||
set(OPENAL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(OPENAL_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (OPENAL)
|
||||
|
||||
if (OPENAL)
|
||||
|
||||
@@ -7,13 +7,16 @@ set(OpenSSL_FIND_REQUIRED ON)
|
||||
if (STANDALONE OR USE_SYSTEM_OPENSSL)
|
||||
include(FindOpenSSL)
|
||||
else (STANDALONE OR USE_SYSTEM_OPENSSL)
|
||||
use_prebuilt_binary(openssl)
|
||||
use_prebuilt_binary(openSSL)
|
||||
if (WINDOWS)
|
||||
set(OPENSSL_LIBRARIES ssleay32 libeay32)
|
||||
else (WINDOWS)
|
||||
set(OPENSSL_LIBRARIES ssl)
|
||||
endif (WINDOWS)
|
||||
set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(OPENSSL_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (STANDALONE OR USE_SYSTEM_OPENSSL)
|
||||
|
||||
if (LINUX)
|
||||
|
||||
@@ -9,7 +9,11 @@ if (STANDALONE)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(libpng)
|
||||
if (WINDOWS)
|
||||
set(PNG_LIBRARIES libpng16)
|
||||
if(MSVC12)
|
||||
set(PNG_LIBRARIES libpng16)
|
||||
else(MSVC12)
|
||||
set(PNG_LIBRARIES libpng15)
|
||||
endif(MSVC12)
|
||||
elseif(DARWIN)
|
||||
set(PNG_LIBRARIES png15)
|
||||
else(LINUX)
|
||||
@@ -32,5 +36,15 @@ else (STANDALONE)
|
||||
set(PNG_LIBRARIES png16)
|
||||
endif ()
|
||||
endif()
|
||||
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16)
|
||||
if (WINDOWS)
|
||||
set(PNG_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/${PNG_LIBRARIES}
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/${PNG_LIBRARIES}
|
||||
)
|
||||
else (WINDOWS)
|
||||
set(PNG_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/lib${PNG_LIBRARIES}
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/lib${PNG_LIBRARIES}
|
||||
)
|
||||
endif (WINDOWS)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -3,64 +3,14 @@
|
||||
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
|
||||
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
|
||||
|
||||
include(FindAutobuild)
|
||||
include(Variables)
|
||||
if(INSTALL_PROPRIETARY)
|
||||
include(FindSCP)
|
||||
endif(INSTALL_PROPRIETARY)
|
||||
|
||||
set(PREBUILD_TRACKING_DIR ${AUTOBUILD_INSTALL_DIR}/cmake_tracking)
|
||||
# For the library installation process;
|
||||
# see cmake/Prebuild.cmake for the counterpart code.
|
||||
if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
|
||||
file(MAKE_DIRECTORY ${PREBUILD_TRACKING_DIR})
|
||||
file(WRITE ${PREBUILD_TRACKING_DIR}/sentinel_installed "0")
|
||||
endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
|
||||
|
||||
# The use_prebuilt_binary macro handles automated installation of package
|
||||
# dependencies using autobuild. The goal is that 'autobuild install' should
|
||||
# only be run when we know we need to install a new package. This should be
|
||||
# the case in a clean checkout, or if autobuild.xml has been updated since the
|
||||
# last run (encapsulated by the file ${PREBUILD_TRACKING_DIR}/sentinel_installed),
|
||||
# or if a previous attempt to install the package has failed (the exit status
|
||||
# of previous attempts is serialized in the file
|
||||
# ${PREBUILD_TRACKING_DIR}/${_binary}_installed)
|
||||
macro (use_prebuilt_binary _binary)
|
||||
if (NOT DEFINED USESYSTEMLIBS_${_binary})
|
||||
set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS})
|
||||
endif (NOT DEFINED USESYSTEMLIBS_${_binary})
|
||||
|
||||
if (NOT USESYSTEMLIBS_${_binary})
|
||||
if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
|
||||
file(READ ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${_binary}_installed")
|
||||
if(DEBUG_PREBUILT)
|
||||
message(STATUS "${_binary}_installed: \"${${_binary}_installed}\"")
|
||||
endif(DEBUG_PREBUILT)
|
||||
endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
|
||||
|
||||
if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
|
||||
if(DEBUG_PREBUILT)
|
||||
message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
|
||||
--install-dir=${AUTOBUILD_INSTALL_DIR}
|
||||
${_binary} ")
|
||||
endif(DEBUG_PREBUILT)
|
||||
execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}"
|
||||
install
|
||||
--install-dir=${AUTOBUILD_INSTALL_DIR}
|
||||
-p ${AUTOBUILD_PLATFORM_NAME}
|
||||
${_binary}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE ${_binary}_installed
|
||||
)
|
||||
file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}")
|
||||
endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
|
||||
|
||||
if(NOT ${_binary}_installed EQUAL 0)
|
||||
message(FATAL_ERROR
|
||||
"Failed to download or unpack prebuilt '${_binary}'."
|
||||
" Process returned ${${_binary}_installed}.")
|
||||
endif (NOT ${_binary}_installed EQUAL 0)
|
||||
endif (NOT USESYSTEMLIBS_${_binary})
|
||||
if(NOT STANDALONE)
|
||||
get_property(PREBUILT_PACKAGES TARGET prepare PROPERTY PREBUILT)
|
||||
list(FIND PREBUILT_PACKAGES ${_binary} _index)
|
||||
if(_index LESS 0)
|
||||
set_property(TARGET prepare APPEND PROPERTY PREBUILT ${_binary})
|
||||
endif(_index LESS 0)
|
||||
endif(NOT STANDALONE)
|
||||
endmacro (use_prebuilt_binary _binary)
|
||||
|
||||
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.")
|
||||
set(PULSEAUDIO ON CACHE BOOL "Build with PulseAudio support, if available.")
|
||||
|
||||
if (PULSEAUDIO)
|
||||
if (STANDALONE)
|
||||
@@ -13,8 +13,9 @@ if (PULSEAUDIO)
|
||||
use_prebuilt_binary(pulseaudio)
|
||||
set(PULSEAUDIO_FOUND ON FORCE BOOL)
|
||||
set(PULSEAUDIO_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
)
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
# We don't need to explicitly link against pulseaudio itself, because
|
||||
# the viewer probes for the system's copy at runtime.
|
||||
set(PULSEAUDIO_LIBRARIES
|
||||
|
||||
12
indra/cmake/Qt4.cmake
Normal file
12
indra/cmake/Qt4.cmake
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (STANDALONE)
|
||||
set(Qt4_FIND_REQUIRED ON)
|
||||
|
||||
include(FindQt4)
|
||||
|
||||
find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtNetwork QtOpenGL QtWebKit REQUIRED)
|
||||
include(${QT_USE_FILE})
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
endif (STANDALONE)
|
||||
@@ -1,11 +1,9 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
if(INSTALL_PROPRIETARY OR USE_QUICKTIME_PREBUILT)
|
||||
if(INSTALL_PROPRIETARY)
|
||||
include(Prebuilt)
|
||||
if (WINDOWS)
|
||||
use_prebuilt_binary(quicktime)
|
||||
endif (WINDOWS)
|
||||
endif(INSTALL_PROPRIETARY OR USE_QUICKTIME_PREBUILT)
|
||||
use_prebuilt_binary(quicktime)
|
||||
endif(INSTALL_PROPRIETARY)
|
||||
|
||||
if (DARWIN)
|
||||
include(CMakeFindFrameworks)
|
||||
@@ -25,13 +23,15 @@ elseif (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||
|
||||
find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient
|
||||
PATHS
|
||||
${ARCH_PREBUILT_DIRS_DEBUG}
|
||||
${LIBS_PREBUILT_DIR}/lib/debug
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/lib/debug
|
||||
"${QUICKTIME_SDK_DIR}\\libraries"
|
||||
)
|
||||
|
||||
find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient
|
||||
PATHS
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}
|
||||
${LIBS_PREBUILT_DIR}/lib/release
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
|
||||
"${QUICKTIME_SDK_DIR}\\libraries"
|
||||
)
|
||||
|
||||
@@ -45,6 +45,7 @@ elseif (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||
|
||||
include_directories(
|
||||
${LIBS_PREBUILT_DIR}/include/quicktime
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/quicktime
|
||||
"${QUICKTIME_SDK_DIR}\\CIncludes"
|
||||
)
|
||||
endif (DARWIN)
|
||||
|
||||
@@ -8,7 +8,7 @@ macro (check_message_template _target)
|
||||
PRE_LINK
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
ARGS ${SCRIPTS_DIR}/template_verifier.py
|
||||
--mode=development --cache_master --master_url=${TEMPLATE_VERIFIER_MASTER_URL} ${TEMPLATE_VERIFIER_OPTIONS}
|
||||
COMMENT "Verifying message template - See http://wiki.secondlife.com/wiki/Template_verifier.py"
|
||||
--mode=development --cache_master
|
||||
COMMENT "Verifying message template"
|
||||
)
|
||||
endmacro (check_message_template)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
include(FreeType)
|
||||
|
||||
if (STANDALONE)
|
||||
include(FindPkgConfig)
|
||||
@@ -33,10 +32,11 @@ if (STANDALONE)
|
||||
endforeach(pkg)
|
||||
else (STANDALONE)
|
||||
if (LINUX)
|
||||
use_prebuilt_binary(glib) # gtk-etc needs glib
|
||||
use_prebuilt_binary(gtk-atk-pango-glib)
|
||||
set(UI_LIBRARIES
|
||||
atk-1.0
|
||||
cairo
|
||||
X11
|
||||
gdk-x11-2.0
|
||||
gdk_pixbuf-2.0
|
||||
Xinerama
|
||||
@@ -48,19 +48,25 @@ else (STANDALONE)
|
||||
gtk-x11-2.0
|
||||
pango-1.0
|
||||
pangoft2-1.0
|
||||
pangox-1.0
|
||||
pangoxft-1.0
|
||||
pangocairo-1.0
|
||||
pixman-1
|
||||
X11
|
||||
${FREETYPE_LIBRARIES}
|
||||
)
|
||||
endif (LINUX)
|
||||
|
||||
include_directories (
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_DIR}/packages/include
|
||||
${LIBS_PREBUILT_DIR}/packages/include/cairo
|
||||
${LIBS_PREBUILT_DIR}/packages/include/pixman-1
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/cairo
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/pixman-1
|
||||
)
|
||||
foreach(include ${${LL_ARCH}_INCLUDES})
|
||||
include_directories(${LIBS_PREBUILT_DIR}/include/${include})
|
||||
include_directories(
|
||||
${LIBS_PREBUILT_DIR}/include/${include}
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/${include}
|
||||
)
|
||||
endforeach(include)
|
||||
endif (STANDALONE)
|
||||
|
||||
|
||||
@@ -23,65 +23,26 @@ set(LIBS_CLOSED_PREFIX)
|
||||
set(LIBS_OPEN_PREFIX)
|
||||
set(SCRIPTS_PREFIX ../scripts)
|
||||
set(VIEWER_PREFIX)
|
||||
set(INTEGRATION_TESTS_PREFIX)
|
||||
set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
|
||||
|
||||
# Compiler and toolchain options
|
||||
set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)")
|
||||
set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.")
|
||||
option(INCREMENTAL_LINK "Use incremental linking or incremental LTCG for LTO on win32 builds (enable for faster links on some machines)" OFF)
|
||||
option(USE_LTO "Enable Whole Program Optimization and related folding and binary reduction routines" OFF)
|
||||
|
||||
# Proprietary Library Features
|
||||
option(NVAPI "Use nvapi driver interface library" OFF)
|
||||
|
||||
if(LIBS_CLOSED_DIR)
|
||||
file(TO_CMAKE_PATH "${LIBS_CLOSED_DIR}" LIBS_CLOSED_DIR)
|
||||
else(LIBS_CLOSED_DIR)
|
||||
set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
|
||||
endif(LIBS_CLOSED_DIR)
|
||||
if(LIBS_COMMON_DIR)
|
||||
file(TO_CMAKE_PATH "${LIBS_COMMON_DIR}" LIBS_COMMON_DIR)
|
||||
else(LIBS_COMMON_DIR)
|
||||
set(LIBS_COMMON_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
|
||||
endif(LIBS_COMMON_DIR)
|
||||
set(LIBS_OPEN_DIR ${LIBS_COMMON_DIR})
|
||||
|
||||
set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
|
||||
set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
|
||||
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
|
||||
set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
|
||||
|
||||
set(AUTOBUILD_INSTALL_DIR ${CMAKE_BINARY_DIR}/packages)
|
||||
|
||||
set(LIBS_PREBUILT_DIR ${AUTOBUILD_INSTALL_DIR} CACHE PATH
|
||||
"Location of prebuilt libraries.")
|
||||
|
||||
if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
|
||||
# We use this as a marker that you can try to use the proprietary libraries.
|
||||
set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries")
|
||||
endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
|
||||
set(TEMPLATE_VERIFIER_OPTIONS "" CACHE STRING "Options for scripts/template_verifier.py")
|
||||
set(TEMPLATE_VERIFIER_MASTER_URL "http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg" CACHE STRING "Location of the master message template")
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
||||
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
|
||||
endif (NOT CMAKE_BUILD_TYPE)
|
||||
set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)")
|
||||
set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
|
||||
set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set(WINDOWS ON BOOL FORCE)
|
||||
if (WORD_SIZE EQUAL 64)
|
||||
set(ARCH x86_64 CACHE STRING "Viewer Architecture")
|
||||
set(LL_ARCH ${ARCH}_win64)
|
||||
set(LL_ARCH_DIR ${ARCH}-win64)
|
||||
set(WORD_SIZE 64)
|
||||
set(AUTOBUILD_PLATFORM_NAME "windows64")
|
||||
else (WORD_SIZE EQUAL 64)
|
||||
set(ARCH i686 CACHE STRING "Viewer Architecture")
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(ARCH i686)
|
||||
set(LL_ARCH ${ARCH}_win32)
|
||||
set(LL_ARCH_DIR ${ARCH}-win32)
|
||||
set(WORD_SIZE 32)
|
||||
set(AUTOBUILD_PLATFORM_NAME "windows")
|
||||
endif (WORD_SIZE EQUAL 64)
|
||||
elseif (WORD_SIZE EQUAL 64)
|
||||
set(ARCH x86_64)
|
||||
set(LL_ARCH ${ARCH}_win)
|
||||
set(LL_ARCH_DIR ${ARCH}-win)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
@@ -90,26 +51,17 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
# If someone has specified a word size, use that to determine the
|
||||
# architecture. Otherwise, let the architecture specify the word size.
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
#message(STATUS "WORD_SIZE is 32")
|
||||
set(ARCH i686)
|
||||
set(AUTOBUILD_PLATFORM_NAME "linux")
|
||||
elseif (WORD_SIZE EQUAL 64)
|
||||
#message(STATUS "WORD_SIZE is 64")
|
||||
set(ARCH x86_64)
|
||||
set(AUTOBUILD_PLATFORM_NAME "linux64")
|
||||
else (WORD_SIZE EQUAL 32)
|
||||
#message(STATUS "WORD_SIZE is UNDEFINED")
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
message(STATUS "Size of void pointer is detected as 8; ARCH is 64-bit")
|
||||
set(WORD_SIZE 64)
|
||||
set(AUTOBUILD_PLATFORM_NAME "linux64")
|
||||
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
message(STATUS "Size of void pointer is detected as 4; ARCH is 32-bit")
|
||||
if(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||
set(ARCH i686)
|
||||
set(WORD_SIZE 32)
|
||||
set(AUTOBUILD_PLATFORM_NAME "linux")
|
||||
else()
|
||||
message(FATAL_ERROR "Unkown Architecture!")
|
||||
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
else(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||
set(ARCH x86_64)
|
||||
set(WORD_SIZE 64)
|
||||
endif(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
|
||||
if (NOT STANDALONE AND MULTIARCH_HACK)
|
||||
@@ -146,6 +98,25 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
COMMAND sh -c "xcodebuild -version | grep Xcode | cut -d ' ' -f2 | cut -d'.' -f1-2"
|
||||
OUTPUT_VARIABLE XCODE_VERSION )
|
||||
string(REGEX REPLACE "(\r?\n)+$" "" XCODE_VERSION "${XCODE_VERSION}")
|
||||
|
||||
# # To support a different SDK update these Xcode settings:
|
||||
# if (XCODE_VERSION GREATER 4.9) # (Which would be 5.0+)
|
||||
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)
|
||||
# set(CMAKE_OSX_SYSROOT macosx10.9)
|
||||
# else (XCODE_VERION GREATER 4.9)
|
||||
# if (XCODE_VERSION GREATER 4.5)
|
||||
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
|
||||
# set(CMAKE_OSX_SYSROOT macosx10.8)
|
||||
# else (XCODE_VERSION GREATER 4.5)
|
||||
# if (XCODE_VERSION GREATER 4.2)
|
||||
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||
# set(CMAKE_OSX_SYSROOT macosx10.7)
|
||||
# else (XCODE_VERSION GREATER 4.2)
|
||||
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||
# set(CMAKE_OSX_SYSROOT macosx10.7)
|
||||
# endif (XCODE_VERSION GREATER 4.2)
|
||||
# endif (XCODE_VERSION GREATER 4.5)
|
||||
# endif (XCODE_VERSION GREATER 4.9)
|
||||
|
||||
# Hardcode SDK we build against until we can test and allow newer ones
|
||||
# as autodetected in the code above
|
||||
@@ -175,28 +146,43 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(CMAKE_OSX_ARCHITECTURES i386)
|
||||
set(ARCH i386)
|
||||
set(WORD_SIZE 32)
|
||||
set(AUTOBUILD_PLATFORM_NAME "darwin")
|
||||
|
||||
set(LL_ARCH ${ARCH}_darwin)
|
||||
set(LL_ARCH_DIR universal-darwin)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
set(LIBS_PREBUILT_DIR ${CMAKE_BINARY_DIR}/packages CACHE PATH
|
||||
"Location of prebuilt libraries.")
|
||||
|
||||
set(LIBS_PREBUILT_LEGACY_DIR ${CMAKE_BINARY_DIR}/packages/libraries/${LL_ARCH_DIR} CACHE PATH
|
||||
"Legacy location of prebuilt libraries.")
|
||||
|
||||
if (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||
set(PREBUILT_TYPE windows)
|
||||
elseif (WINDOWS AND WORD_SIZE EQUAL 64)
|
||||
set(PREBUILT_TYPE windows64)
|
||||
elseif(DARWIN)
|
||||
set(PREBUILT_TYPE darwin)
|
||||
elseif(LINUX AND WORD_SIZE EQUAL 32)
|
||||
set(PREBUILT_TYPE linux)
|
||||
elseif(LINUX AND WORD_SIZE EQUAL 64)
|
||||
set(PREBUILT_TYPE linux64)
|
||||
endif(WINDOWS AND WORD_SIZE EQUAL 32)
|
||||
|
||||
# Default deploy grid
|
||||
set(GRID agni CACHE STRING "Target Grid")
|
||||
|
||||
set(VIEWER_CHANNEL "Singularity Test" CACHE STRING "Viewer Channel Name")
|
||||
set(VIEWER_CHANNEL "Singularity" CACHE STRING "Viewer Channel Name")
|
||||
set(VIEWER_LOGIN_CHANNEL "${VIEWER_CHANNEL}" CACHE STRING "Fake login channel for A/B Testing")
|
||||
set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id (currently secondlife|snowglobe)")
|
||||
|
||||
string(REPLACE " " "" VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL})
|
||||
set(VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL_NOSPACE} CACHE STRING "Prefix used for resulting artifacts.")
|
||||
# *TODO: break out proper Branding-secondlife.cmake, Branding-snowglobe.cmake, etc
|
||||
string(REGEX REPLACE " +" "" VIEWER_CHANNEL_ONE_WORD "${VIEWER_CHANNEL}")
|
||||
set(VIEWER_BRANDING_NAME "${VIEWER_CHANNEL_ONE_WORD}")
|
||||
set(VIEWER_BRANDING_NAME_CAMELCASE "${VIEWER_CHANNEL_ONE_WORD}")
|
||||
|
||||
set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer")
|
||||
set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.")
|
||||
|
||||
set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside")
|
||||
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
|
||||
|
||||
set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")
|
||||
|
||||
source_group("CMake Rules" FILES CMakeLists.txt)
|
||||
|
||||
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
include(Prebuilt)
|
||||
|
||||
if (NOT STANDALONE)
|
||||
use_prebuilt_binary(slvoice)
|
||||
use_prebuilt_binary(vivox)
|
||||
if(LINUX)
|
||||
use_prebuilt_binary(libuuid)
|
||||
if (${ARCH} STREQUAL "x86_64")
|
||||
use_prebuilt_binary(32bitcompatibilitylibs)
|
||||
endif (${ARCH} STREQUAL "x86_64")
|
||||
use_prebuilt_binary(fontconfig)
|
||||
endif(LINUX)
|
||||
else (NOT STANDALONE)
|
||||
|
||||
64
indra/cmake/WebKitLibPlugin.cmake
Normal file
64
indra/cmake/WebKitLibPlugin.cmake
Normal file
@@ -0,0 +1,64 @@
|
||||
# -*- cmake -*-
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
include(LLQtWebkit)
|
||||
include(Qt4)
|
||||
|
||||
if (STANDALONE)
|
||||
set(WEBKITLIBPLUGIN OFF CACHE BOOL
|
||||
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(llqtwebkit)
|
||||
set(WEBKITLIBPLUGIN ON CACHE BOOL
|
||||
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
|
||||
endif (STANDALONE)
|
||||
|
||||
if (WINDOWS)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES
|
||||
debug llqtwebkitd
|
||||
debug QtWebKitd4
|
||||
debug QtOpenGLd4
|
||||
debug QtNetworkd4
|
||||
debug QtGuid4
|
||||
debug QtCored4
|
||||
debug qtmaind
|
||||
optimized llqtwebkit
|
||||
optimized QtWebKit4
|
||||
optimized QtOpenGL4
|
||||
optimized QtNetwork4
|
||||
optimized QtGui4
|
||||
optimized QtCore4
|
||||
optimized qtmain
|
||||
)
|
||||
elseif (DARWIN)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES
|
||||
debug libllqtwebkit.dylib
|
||||
optimized libllqtwebkit.dylib
|
||||
)
|
||||
elseif (LINUX)
|
||||
if (STANDALONE)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES ${LLQTWEBKIT_LIBRARY} ${QT_LIBRARIES} ${QT_PLUGIN_LIBRARIES})
|
||||
else (STANDALONE)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES
|
||||
llqtwebkit
|
||||
QtWebKit
|
||||
QtOpenGL
|
||||
QtNetwork
|
||||
QtGui
|
||||
QtCore
|
||||
crypto
|
||||
ssl
|
||||
# qgif
|
||||
# qjpeg
|
||||
jpeg
|
||||
fontconfig
|
||||
X11
|
||||
Xrender
|
||||
Xext
|
||||
GL
|
||||
)
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 4) # Singu TODO: update webkit
|
||||
set(WEBKIT_PLUGIN_LIBRARIES ${WEBKIT_PLUGIN_LIBRARIES} jscore)
|
||||
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
endif (STANDALONE)
|
||||
endif (WINDOWS)
|
||||
@@ -1,17 +0,0 @@
|
||||
# - Embeds a specific manifest file in a Windows binary
|
||||
# Defines the following:
|
||||
# EMBED_MANIFEST - embed manifest in a windows binary with mt
|
||||
# Parameters - _target is the target file, type - 1 for EXE, 2 for DLL
|
||||
|
||||
MACRO(EMBED_MANIFEST _target type)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET ${_target}
|
||||
POST_BUILD
|
||||
COMMAND "mt.exe"
|
||||
ARGS
|
||||
-manifest \"${CMAKE_SOURCE_DIR}\\tools\\manifests\\compatibility.manifest\"
|
||||
-inputresource:\"$<TARGET_FILE:${_target}>\"\;\#${type}
|
||||
-outputresource:\"$<TARGET_FILE:${_target}>\"\;\#${type}
|
||||
COMMENT "Adding compatibility manifest to ${_target}"
|
||||
)
|
||||
ENDMACRO(EMBED_MANIFEST _target type)
|
||||
@@ -8,13 +8,9 @@ if (STANDALONE)
|
||||
include(FindXmlRpcEpi)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(xmlrpc-epi)
|
||||
if (WINDOWS)
|
||||
set(XMLRPCEPI_LIBRARIES
|
||||
debug xmlrpc-epid
|
||||
optimized xmlrpc-epi
|
||||
)
|
||||
else (WINDOWS)
|
||||
set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
|
||||
endif (WINDOWS)
|
||||
set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
|
||||
set(XMLRPCEPI_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -13,25 +13,13 @@ else (STANDALONE)
|
||||
set(ZLIB_LIBRARIES
|
||||
debug zlibd
|
||||
optimized zlib)
|
||||
elseif (LINUX)
|
||||
#
|
||||
# When we have updated static libraries in competition with older
|
||||
# shared libraries and we want the former to win, we need to do some
|
||||
# extra work. The *_PRELOAD_ARCHIVES settings are invoked early
|
||||
# and will pull in the entire archive to the binary giving it
|
||||
# priority in symbol resolution. Beware of cmake moving the
|
||||
# achive load itself to another place on the link command line. If
|
||||
# that happens, you can try something like -Wl,-lz here to hide
|
||||
# the archive. Also be aware that the linker will not tolerate a
|
||||
# second whole-archive load of the archive. See viewer's
|
||||
# CMakeLists.txt for more information.
|
||||
#
|
||||
set(ZLIB_PRELOAD_ARCHIVES -Wl,--whole-archive z -Wl,--no-whole-archive)
|
||||
set(ZLIB_LIBRARIES z)
|
||||
else (WINDOWS)
|
||||
set(ZLIB_LIBRARIES z)
|
||||
endif (WINDOWS)
|
||||
if (WINDOWS OR LINUX)
|
||||
set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)
|
||||
set(ZLIB_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/zlib
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/zlib
|
||||
)
|
||||
endif (WINDOWS OR LINUX)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -1,24 +1,30 @@
|
||||
/**
|
||||
* @file cmake_dummy.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2008&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2008-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -1,28 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
"""\
|
||||
@file start-client.py
|
||||
|
||||
$LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
Second Life Viewer Source Code
|
||||
Copyright (C) 2010-2011, Linden Research, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation;
|
||||
version 2.1 of the License only.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
$/LicenseInfo$
|
||||
"""
|
||||
import sys, getopt
|
||||
import os
|
||||
import llstart
|
||||
|
||||
925
indra/develop.py
Executable file
925
indra/develop.py
Executable file
@@ -0,0 +1,925 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# @file develop.py
|
||||
# @authors Bryan O'Sullivan, Mark Palange, Aaron Brashears
|
||||
# @brief Fire and forget script to appropriately configure cmake for SL.
|
||||
#
|
||||
# $LicenseInfo:firstyear=2007&license=viewergpl$
|
||||
#
|
||||
# Copyright (c) 2007-2009, Linden Research, Inc.
|
||||
#
|
||||
# Second Life Viewer Source Code
|
||||
# The source code in this file ("Source Code") is provided by Linden Lab
|
||||
# to you under the terms of the GNU General Public License, version 2.0
|
||||
# ("GPL"), unless you have obtained a separate licensing agreement
|
||||
# ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
# the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
# online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
#
|
||||
# There are special exceptions to the terms and conditions of the GPL as
|
||||
# it is applied to this Source Code. View the full text of the exception
|
||||
# in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
# online at
|
||||
# http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
#
|
||||
# By copying, modifying or distributing this software, you acknowledge
|
||||
# that you have read and understood your obligations described above,
|
||||
# and agree to abide by those obligations.
|
||||
#
|
||||
# ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
# WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
# COMPLETENESS OR PERFORMANCE.
|
||||
# $/LicenseInfo$
|
||||
|
||||
|
||||
import errno
|
||||
import getopt
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import shutil
|
||||
import socket
|
||||
import sys
|
||||
import commands
|
||||
import shlex
|
||||
|
||||
class CommandError(Exception):
|
||||
pass
|
||||
|
||||
def mkdir(path):
|
||||
try:
|
||||
os.mkdir(path)
|
||||
return path
|
||||
except OSError, err:
|
||||
if err.errno != errno.EEXIST or not os.path.isdir(path):
|
||||
raise
|
||||
|
||||
def prettyprint_path_for_cmake(path):
|
||||
if 'a' <= path[0] <= 'z' and path[1] == ':':
|
||||
# CMake wants DOS drive letters to be in uppercase. The above
|
||||
# condition never asserts on platforms whose full path names
|
||||
# always begin with a slash, so we don't need to test whether
|
||||
# we are running on Windows.
|
||||
path = path[0].upper() + path[1:]
|
||||
return path
|
||||
|
||||
def getcwd():
|
||||
return prettyprint_path_for_cmake(os.getcwd())
|
||||
|
||||
source_indra = prettyprint_path_for_cmake(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
def quote(opts):
|
||||
return '"' + '" "'.join([ opt.replace('"', '') for opt in opts ]) + '"'
|
||||
|
||||
class PlatformSetup(object):
|
||||
generator = None
|
||||
build_types = {}
|
||||
for t in ('Debug', 'Release', 'RelWithDebInfo'):
|
||||
build_types[t.lower()] = t
|
||||
|
||||
build_type = build_types['relwithdebinfo']
|
||||
standalone = 'OFF'
|
||||
unattended = 'OFF'
|
||||
universal = 'OFF'
|
||||
project_name = 'Singularity'
|
||||
distcc = True
|
||||
cmake_opts = []
|
||||
word_size = 32
|
||||
using_express = False
|
||||
|
||||
def __init__(self):
|
||||
self.script_dir = os.path.realpath(
|
||||
os.path.dirname(__import__(__name__).__file__))
|
||||
|
||||
def os(self):
|
||||
'''Return the name of the OS.'''
|
||||
|
||||
raise NotImplemented('os')
|
||||
|
||||
def arch(self):
|
||||
'''Return the CPU architecture.'''
|
||||
|
||||
return None
|
||||
|
||||
def platform(self):
|
||||
'''Return a stringified two-tuple of the OS name and CPU
|
||||
architecture.'''
|
||||
|
||||
ret = self.os()
|
||||
if self.arch():
|
||||
ret += '-' + self.arch()
|
||||
return ret
|
||||
|
||||
def build_dirs(self):
|
||||
'''Return the top-level directories in which builds occur.
|
||||
This can return more than one directory, e.g. if doing a
|
||||
32-bit viewer and server build on Linux.'''
|
||||
|
||||
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||
prefix = '../'
|
||||
else:
|
||||
prefix = ''
|
||||
|
||||
return [prefix+'build-' + self.platform()]
|
||||
|
||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||
'''Return the command line to run cmake with.'''
|
||||
|
||||
args = dict(
|
||||
dir=src_dir,
|
||||
generator=self.generator,
|
||||
opts=quote(opts),
|
||||
standalone=self.standalone,
|
||||
unattended=self.unattended,
|
||||
word_size=self.word_size,
|
||||
type=self.build_type.upper(),
|
||||
)
|
||||
#if simple:
|
||||
# return 'cmake %(opts)s %(dir)r' % args
|
||||
return ('cmake -DCMAKE_BUILD_TYPE:STRING=%(type)s '
|
||||
'-DSTANDALONE:BOOL=%(standalone)s '
|
||||
'-DUNATTENDED:BOOL=%(unattended)s '
|
||||
'-DWORD_SIZE:STRING=%(word_size)s '
|
||||
'-G %(generator)r %(opts)s %(dir)r' % args)
|
||||
|
||||
def run_cmake(self, args=[]):
|
||||
'''Run cmake.'''
|
||||
|
||||
# do a sanity check to make sure we have a generator
|
||||
if not hasattr(self, 'generator'):
|
||||
raise "No generator available for '%s'" % (self.__name__,)
|
||||
cwd = getcwd()
|
||||
created = []
|
||||
try:
|
||||
for d in self.build_dirs():
|
||||
simple = True
|
||||
if mkdir(d):
|
||||
created.append(d)
|
||||
simple = False
|
||||
try:
|
||||
os.chdir(d)
|
||||
cmd = self.cmake_commandline(source_indra, d, args, simple)
|
||||
print 'Running %r in %r' % (cmd, d)
|
||||
self.run(cmd, 'cmake')
|
||||
finally:
|
||||
os.chdir(cwd)
|
||||
except:
|
||||
# If we created a directory in which to run cmake and
|
||||
# something went wrong, the directory probably just
|
||||
# contains garbage, so delete it.
|
||||
os.chdir(cwd)
|
||||
for d in created:
|
||||
print 'Cleaning %r' % d
|
||||
shutil.rmtree(d)
|
||||
raise
|
||||
|
||||
def parse_build_opts(self, arguments):
|
||||
opts, targets = getopt.getopt(arguments, 'D:o:', ['option='])
|
||||
build_opts = []
|
||||
for o, a in opts:
|
||||
if o in ('-o', '--option'):
|
||||
build_opts.append(a)
|
||||
return build_opts, targets
|
||||
|
||||
def run_build(self, opts, targets):
|
||||
'''Build the default targets for this platform.'''
|
||||
|
||||
raise NotImplemented('run_build')
|
||||
|
||||
def cleanup(self):
|
||||
'''Delete all build directories.'''
|
||||
|
||||
cleaned = 0
|
||||
for d in self.build_dirs():
|
||||
if os.path.isdir(d):
|
||||
print 'Cleaning %r' % d
|
||||
shutil.rmtree(d)
|
||||
cleaned += 1
|
||||
if not cleaned:
|
||||
print 'Nothing to clean up!'
|
||||
|
||||
def is_internal_tree(self):
|
||||
'''Indicate whether we are building in an internal source tree.'''
|
||||
|
||||
return os.path.isdir(os.path.join(self.script_dir, 'newsim'))
|
||||
|
||||
def find_in_path(self, name, defval=None, basename=False):
|
||||
for ext in self.exe_suffixes:
|
||||
name_ext = name + ext
|
||||
if os.sep in name_ext:
|
||||
path = os.path.abspath(name_ext)
|
||||
if os.access(path, os.X_OK):
|
||||
return [basename and os.path.basename(path) or path]
|
||||
for p in os.getenv('PATH', self.search_path).split(os.pathsep):
|
||||
path = os.path.join(p, name_ext)
|
||||
if os.access(path, os.X_OK):
|
||||
return [basename and os.path.basename(path) or path]
|
||||
if defval:
|
||||
return [defval]
|
||||
return []
|
||||
|
||||
|
||||
class UnixSetup(PlatformSetup):
|
||||
'''Generic Unixy build instructions.'''
|
||||
|
||||
search_path = '/usr/bin:/usr/local/bin'
|
||||
exe_suffixes = ('',)
|
||||
|
||||
def __init__(self):
|
||||
PlatformSetup.__init__(self)
|
||||
super(UnixSetup, self).__init__()
|
||||
self.generator = 'Unix Makefiles'
|
||||
|
||||
def os(self):
|
||||
return 'unix'
|
||||
|
||||
def arch(self):
|
||||
cpu = os.uname()[-1]
|
||||
if cpu.endswith('386'):
|
||||
cpu = 'i386'
|
||||
elif cpu.endswith('86'):
|
||||
cpu = 'i686'
|
||||
elif cpu in ('athlon',):
|
||||
cpu = 'i686'
|
||||
elif cpu == 'Power Macintosh':
|
||||
cpu = 'ppc'
|
||||
elif cpu == 'x86_64' and self.word_size == 32:
|
||||
cpu = 'i686'
|
||||
return cpu
|
||||
|
||||
def run(self, command, name=None):
|
||||
'''Run a program. If the program fails, raise an exception.'''
|
||||
ret = os.system(command)
|
||||
if ret:
|
||||
if name is None:
|
||||
name = command.split(None, 1)[0]
|
||||
if os.WIFEXITED(ret):
|
||||
st = os.WEXITSTATUS(ret)
|
||||
if st == 127:
|
||||
event = 'was not found'
|
||||
else:
|
||||
event = 'exited with status %d' % st
|
||||
elif os.WIFSIGNALED(ret):
|
||||
event = 'was killed by signal %d' % os.WTERMSIG(ret)
|
||||
else:
|
||||
event = 'died unexpectedly (!?) with 16-bit status %d' % ret
|
||||
raise CommandError('the command %r %s' %
|
||||
(name, event))
|
||||
|
||||
|
||||
class LinuxSetup(UnixSetup):
|
||||
def __init__(self):
|
||||
UnixSetup.__init__(self)
|
||||
super(LinuxSetup, self).__init__()
|
||||
try:
|
||||
self.debian_sarge = open('/etc/debian_version').read().strip() == '3.1'
|
||||
except:
|
||||
self.debian_sarge = False
|
||||
|
||||
def os(self):
|
||||
return 'linux'
|
||||
|
||||
def build_dirs(self):
|
||||
return [PlatformSetup.build_dirs(self)[0]+'-'+self.build_type.lower()]
|
||||
|
||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||
args = dict(
|
||||
dir=src_dir,
|
||||
generator=self.generator,
|
||||
opts=quote(opts),
|
||||
standalone=self.standalone,
|
||||
unattended=self.unattended,
|
||||
type=self.build_type.upper(),
|
||||
project_name=self.project_name,
|
||||
word_size=self.word_size,
|
||||
cxx="g++"
|
||||
)
|
||||
|
||||
cmd = (('cmake -DCMAKE_BUILD_TYPE:STRING=%(type)s '
|
||||
'-G %(generator)r -DSTANDALONE:BOOL=%(standalone)s '
|
||||
'-DWORD_SIZE:STRING=%(word_size)s '
|
||||
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
|
||||
'%(opts)s %(dir)r')
|
||||
% args)
|
||||
if 'CXX' not in os.environ:
|
||||
args.update({'cmd':cmd})
|
||||
cmd = ('CXX=%(cxx)r %(cmd)s' % args)
|
||||
return cmd
|
||||
|
||||
def run_build(self, opts, targets):
|
||||
job_count = None
|
||||
|
||||
for i in range(len(opts)):
|
||||
if opts[i].startswith('-j'):
|
||||
try:
|
||||
job_count = int(opts[i][2:])
|
||||
except ValueError:
|
||||
try:
|
||||
job_count = int(opts[i+1])
|
||||
except ValueError:
|
||||
job_count = True
|
||||
|
||||
def get_cpu_count():
|
||||
count = 0
|
||||
for line in open('/proc/cpuinfo'):
|
||||
if re.match(r'processor\s*:', line):
|
||||
count += 1
|
||||
return count
|
||||
|
||||
def localhost():
|
||||
count = get_cpu_count()
|
||||
return 'localhost/' + str(count), count
|
||||
|
||||
def get_distcc_hosts():
|
||||
try:
|
||||
hosts = []
|
||||
name = os.getenv('DISTCC_DIR', '/etc/distcc') + '/hosts'
|
||||
for l in open(name):
|
||||
l = l[l.find('#')+1:].strip()
|
||||
if l: hosts.append(l)
|
||||
return hosts
|
||||
except IOError:
|
||||
return (os.getenv('DISTCC_HOSTS', '').split() or
|
||||
[localhost()[0]])
|
||||
|
||||
def count_distcc_hosts():
|
||||
cpus = 0
|
||||
hosts = 0
|
||||
for host in get_distcc_hosts():
|
||||
m = re.match(r'.*/(\d+)', host)
|
||||
hosts += 1
|
||||
cpus += m and int(m.group(1)) or 1
|
||||
return hosts, cpus
|
||||
|
||||
def mk_distcc_hosts(basename, range, num_cpus):
|
||||
'''Generate a list of LL-internal machines to build on.'''
|
||||
loc_entry, cpus = localhost()
|
||||
hosts = [loc_entry]
|
||||
dead = []
|
||||
stations = [s for s in xrange(range) if s not in dead]
|
||||
random.shuffle(stations)
|
||||
hosts += ['%s%d.lindenlab.com/%d,lzo' % (basename, s, num_cpus) for s in stations]
|
||||
cpus += 2 * len(stations)
|
||||
return ' '.join(hosts), cpus
|
||||
|
||||
if job_count is None:
|
||||
hosts, job_count = count_distcc_hosts()
|
||||
if hosts == 1:
|
||||
hostname = socket.gethostname()
|
||||
if hostname.startswith('station'):
|
||||
hosts, job_count = mk_distcc_hosts('station', 36, 2)
|
||||
os.environ['DISTCC_HOSTS'] = hosts
|
||||
if hostname.startswith('eniac'):
|
||||
hosts, job_count = mk_distcc_hosts('eniac', 71, 2)
|
||||
os.environ['DISTCC_HOSTS'] = hosts
|
||||
if job_count > 4:
|
||||
job_count = 4;
|
||||
opts.extend(['-j', str(job_count)])
|
||||
|
||||
if targets:
|
||||
targets = ' '.join(targets)
|
||||
else:
|
||||
targets = 'all'
|
||||
|
||||
for d in self.build_dirs():
|
||||
cmd = 'make -C %r %s %s' % (d, ' '.join(opts), targets)
|
||||
print 'Running %r' % cmd
|
||||
self.run(cmd)
|
||||
|
||||
|
||||
class DarwinSetup(UnixSetup):
|
||||
def __init__(self):
|
||||
UnixSetup.__init__(self)
|
||||
super(DarwinSetup, self).__init__()
|
||||
self.generator = 'Xcode'
|
||||
|
||||
def os(self):
|
||||
return 'darwin'
|
||||
|
||||
def arch(self):
|
||||
if self.universal == 'ON':
|
||||
return 'universal'
|
||||
else:
|
||||
return UnixSetup.arch(self)
|
||||
|
||||
def build_dirs(self):
|
||||
if(self.generator == 'Xcode'):
|
||||
return PlatformSetup.build_dirs(self)
|
||||
else:
|
||||
return [PlatformSetup.build_dirs(self)[0]+'-'+self.build_type.lower()]
|
||||
|
||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||
args = dict(
|
||||
dir=src_dir,
|
||||
generator=self.generator,
|
||||
opts=quote(opts),
|
||||
standalone=self.standalone,
|
||||
word_size=self.word_size,
|
||||
unattended=self.unattended,
|
||||
project_name=self.project_name,
|
||||
universal='',
|
||||
type='',
|
||||
)
|
||||
if(self.generator != 'Xcode'):
|
||||
args['type'] = '-DCMAKE_BUILD_TYPE=%s' % self.build_type.upper()
|
||||
if self.universal == 'ON':
|
||||
args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386;ppc\''
|
||||
#if simple:
|
||||
# return 'cmake %(opts)s %(dir)r' % args
|
||||
return ('cmake -G %(generator)r '
|
||||
'%(type)s '
|
||||
'-DSTANDALONE:BOOL=%(standalone)s '
|
||||
'-DUNATTENDED:BOOL=%(unattended)s '
|
||||
'-DWORD_SIZE:STRING=%(word_size)s '
|
||||
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
|
||||
'%(universal)s '
|
||||
'%(opts)s %(dir)r' % args)
|
||||
|
||||
def run_build(self, opts, targets):
|
||||
if(self.generator != 'Xcode'):
|
||||
if targets:
|
||||
targets = ' '.join(targets)
|
||||
else:
|
||||
targets = 'all'
|
||||
|
||||
for d in self.build_dirs():
|
||||
cmd = 'make -C %r %s %s' % (d, ' '.join(opts), targets)
|
||||
print 'Running %r' % cmd
|
||||
self.run(cmd)
|
||||
return
|
||||
|
||||
cwd = getcwd()
|
||||
if targets:
|
||||
targets = ' '.join(['-target ' + repr(t) for t in targets])
|
||||
else:
|
||||
targets = ''
|
||||
cmd = ('xcodebuild -configuration %s %s %s' %
|
||||
(self.build_type, ' '.join(opts), targets))
|
||||
for d in self.build_dirs():
|
||||
try:
|
||||
os.chdir(d)
|
||||
print 'Running %r in %r' % (cmd, d)
|
||||
self.run(cmd)
|
||||
finally:
|
||||
os.chdir(cwd)
|
||||
|
||||
|
||||
class WindowsSetup(PlatformSetup):
|
||||
gens = {
|
||||
'vc100' : {
|
||||
'gen' : r'Visual Studio 10',
|
||||
'ver' : r'10.0'
|
||||
},
|
||||
'vc120' : {
|
||||
'gen' : r'Visual Studio 12',
|
||||
'ver' : r'12.0'
|
||||
}
|
||||
}
|
||||
|
||||
gens['vs2010'] = gens['vc100']
|
||||
gens['vs2013'] = gens['vc120']
|
||||
|
||||
search_path = r'C:\windows'
|
||||
exe_suffixes = ('.exe', '.bat', '.com')
|
||||
|
||||
def __init__(self):
|
||||
PlatformSetup.__init__(self)
|
||||
super(WindowsSetup, self).__init__()
|
||||
self._generator = None
|
||||
self.incredibuild = False
|
||||
|
||||
def _get_generator(self):
|
||||
if self._generator is None:
|
||||
for version in 'vc100'.split():
|
||||
if self.find_visual_studio(version):
|
||||
self._generator = version
|
||||
print 'Building with ', self.gens[version]['gen']
|
||||
break
|
||||
else:
|
||||
print >> sys.stderr, 'Cannot find a Visual Studio installation, testing for express editions'
|
||||
for version in 'vc100'.split():
|
||||
if self.find_visual_studio_express(version):
|
||||
self._generator = version
|
||||
self.using_express = True
|
||||
print 'Building with ', self.gens[version]['gen'] , "Express edition"
|
||||
break
|
||||
else:
|
||||
for version in 'vc100'.split():
|
||||
if self.find_visual_studio_express_single(version):
|
||||
self._generator = version
|
||||
self.using_express = True
|
||||
print 'Building with ', self.gens[version]['gen'] , "Express edition"
|
||||
break
|
||||
else:
|
||||
print >> sys.stderr, 'Cannot find any Visual Studio installation'
|
||||
sys.exit(1)
|
||||
return self._generator
|
||||
|
||||
def _set_generator(self, gen):
|
||||
self._generator = gen
|
||||
|
||||
generator = property(_get_generator, _set_generator)
|
||||
|
||||
def get_gen_str(self, gen):
|
||||
if gen is None:
|
||||
gen = self._generator
|
||||
return self.gens[gen.lower()]['ver']
|
||||
|
||||
def os(self):
|
||||
return 'win32'
|
||||
|
||||
def build_dirs(self):
|
||||
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||
prefix = '../'
|
||||
else:
|
||||
prefix = ''
|
||||
|
||||
if self.word_size == 64:
|
||||
return [prefix+'build-' + self.generator + '-Win64']
|
||||
else:
|
||||
return [prefix+'build-' + self.generator]
|
||||
|
||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||
args = dict(
|
||||
dir=src_dir,
|
||||
generator=self.gens[self.generator.lower()]['gen'],
|
||||
opts=quote(opts),
|
||||
standalone=self.standalone,
|
||||
unattended=self.unattended,
|
||||
project_name=self.project_name,
|
||||
word_size=self.word_size,
|
||||
)
|
||||
if self.word_size == 64:
|
||||
args["generator"] += r' Win64'
|
||||
|
||||
#if simple:
|
||||
# return 'cmake %(opts)s "%(dir)s"' % args
|
||||
return ('cmake -G "%(generator)s" '
|
||||
'-DSTANDALONE:BOOL=%(standalone)s '
|
||||
'-DUNATTENDED:BOOL=%(unattended)s '
|
||||
'-DWORD_SIZE:STRING=%(word_size)s '
|
||||
'-DROOT_PROJECT_NAME:STRING=\"%(project_name)s\" '
|
||||
'%(opts)s "%(dir)s"' % args)
|
||||
|
||||
def get_HKLM_registry_value(self, key_str, value_str):
|
||||
import _winreg
|
||||
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
|
||||
key = _winreg.OpenKey(reg, key_str)
|
||||
value = _winreg.QueryValueEx(key, value_str)[0]
|
||||
print 'Found: %s' % value
|
||||
return value
|
||||
|
||||
def find_visual_studio(self, gen=None):
|
||||
gen = self.get_gen_str(gen)
|
||||
value_str = (r'EnvironmentDirectory')
|
||||
key_str = (r'SOFTWARE\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||
gen)
|
||||
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
|
||||
(key_str, value_str))
|
||||
try:
|
||||
return self.get_HKLM_registry_value(key_str, value_str)
|
||||
except WindowsError, err:
|
||||
key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||
gen)
|
||||
|
||||
try:
|
||||
return self.get_HKLM_registry_value(key_str, value_str)
|
||||
except:
|
||||
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
|
||||
return ''
|
||||
|
||||
def find_msbuild(self, gen=None):
|
||||
gen = self.get_gen_str(gen)
|
||||
|
||||
key_str = (r'SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0')
|
||||
|
||||
print ('Checking MSBuild support for vs ver = %s' % gen)
|
||||
if not self.get_HKLM_registry_value(key_str+'\\'+gen, "VCTargetsPath"):
|
||||
return (None, None)
|
||||
print ('Reading MSBuild location from HKEY_LOCAL_MACHINE\%s\MSBuildToolsPath' %
|
||||
key_str)
|
||||
print key_str
|
||||
try:
|
||||
return (self.get_HKLM_registry_value(key_str, 'MSBuildToolsPath'), gen)
|
||||
except WindowsError, err:
|
||||
key_str = (r'SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\%s' %
|
||||
gen)
|
||||
|
||||
try:
|
||||
return (self.get_HKLM_registry_value(key_str, 'MSBuildToolsPath'), gen)
|
||||
except WindowsError, err:
|
||||
print 'Didn\'t find msbuild'
|
||||
return (None, None)
|
||||
|
||||
def find_visual_studio_express(self, gen=None):
|
||||
gen = self.get_gen_str(gen)
|
||||
try:
|
||||
import _winreg
|
||||
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s\Setup\VC' %
|
||||
gen)
|
||||
value_str = (r'ProductDir')
|
||||
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
|
||||
(key_str, value_str))
|
||||
print key_str
|
||||
|
||||
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
|
||||
key = _winreg.OpenKey(reg, key_str)
|
||||
value = _winreg.QueryValueEx(key, value_str)[0]+"IDE"
|
||||
print 'Found: %s' % value
|
||||
return value
|
||||
except WindowsError, err:
|
||||
print >> sys.stderr, "Didn't find ", gen
|
||||
return ''
|
||||
|
||||
def find_visual_studio_express_single(self, gen=None):
|
||||
gen = self.get_gen_str(gen)
|
||||
try:
|
||||
import _winreg
|
||||
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s_Config\Setup\VC' %
|
||||
gen)
|
||||
value_str = (r'ProductDir')
|
||||
print ('Reading VS environment from HKEY_CURRENT_USER\%s\%s' %
|
||||
(key_str, value_str))
|
||||
print key_str
|
||||
|
||||
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_CURRENT_USER)
|
||||
key = _winreg.OpenKey(reg, key_str)
|
||||
value = _winreg.QueryValueEx(key, value_str)[0]+"IDE"
|
||||
print 'Found: %s' % value
|
||||
return value
|
||||
except WindowsError, err:
|
||||
print >> sys.stderr, "Didn't find ", gen
|
||||
return ''
|
||||
|
||||
def get_build_cmd(self):
|
||||
if self.incredibuild:
|
||||
config = self.build_type
|
||||
if self.gens[self.generator]['ver'] in [ r'8.0', r'9.0' ]:
|
||||
config = '\"%s|Win32\"' % config
|
||||
|
||||
return "buildconsole \"%s.sln\" /build %s" % (self.project_name, config), None
|
||||
environment = self.find_visual_studio()
|
||||
if environment == '':
|
||||
environment = self.find_visual_studio_express()
|
||||
if environment == '':
|
||||
environment = self.find_visual_studio_express_single()
|
||||
if environment == '':
|
||||
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
|
||||
else:
|
||||
build_dirs=self.build_dirs()
|
||||
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
|
||||
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
|
||||
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
|
||||
exit(0)
|
||||
|
||||
msbuild_dir, tool_ver = self.find_msbuild()
|
||||
|
||||
if msbuild_dir is not None and tool_ver is not None:
|
||||
return ('\"%smsbuild.exe\" \"%s.sln\" /p:configuration=%s /p:VisualStudioVersion=%s' %
|
||||
(msbuild_dir, self.project_name, self.build_type, tool_ver)), True
|
||||
|
||||
# devenv.com is CLI friendly, devenv.exe... not so much.
|
||||
return ('"%sdevenv.com" \"%s.sln\" /build %s' %
|
||||
(self.find_visual_studio(), self.project_name, self.build_type)), None
|
||||
|
||||
def run(self, command, name=None):
|
||||
'''Run a program. If the program fails, raise an exception.'''
|
||||
ret = os.system('\"'+command+'\"')
|
||||
if ret:
|
||||
if name is None:
|
||||
name = os.path.normpath(shlex.split(command.encode('utf8'),posix=False)[0].strip('"'))
|
||||
|
||||
path = self.find_in_path(name)
|
||||
if not path:
|
||||
ret = 'was not found'
|
||||
else:
|
||||
ret = 'exited with status %d' % ret
|
||||
raise CommandError('the command %r %s' %
|
||||
(name, ret))
|
||||
|
||||
def run_cmake(self, args=[]):
|
||||
'''Override to add the vstool.exe call after running cmake.'''
|
||||
PlatformSetup.run_cmake(self, args)
|
||||
if self.unattended == 'OFF':
|
||||
if self.using_express == False:
|
||||
self.run_vstool()
|
||||
|
||||
def run_vstool(self):
|
||||
for build_dir in self.build_dirs():
|
||||
stamp = os.path.join(build_dir, 'vstool.txt')
|
||||
try:
|
||||
prev_build = open(stamp).read().strip()
|
||||
except IOError:
|
||||
prev_build = ''
|
||||
if prev_build == self.build_type:
|
||||
# Only run vstool if the build type has changed.
|
||||
continue
|
||||
|
||||
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
|
||||
tool_path = os.path.join('tools','vstool','VSTool.exe')
|
||||
else:
|
||||
tool_path = os.path.join('indra','tools','vstool','VSTool.exe')
|
||||
vstool_cmd = (tool_path +
|
||||
' --solution \"' +
|
||||
os.path.join(build_dir,'%s.sln' % self.project_name) +
|
||||
'\" --config ' + self.build_type +
|
||||
' --startup secondlife-bin')
|
||||
print 'Running vstool %r in %r' % (vstool_cmd, getcwd())
|
||||
self.run(vstool_cmd)
|
||||
print >> open(stamp, 'w'), self.build_type
|
||||
|
||||
def run_build(self, opts, targets):
|
||||
cwd = getcwd()
|
||||
build_cmd, msbuild = self.get_build_cmd()
|
||||
|
||||
for d in self.build_dirs():
|
||||
try:
|
||||
os.chdir(d)
|
||||
if targets:
|
||||
if msbuild:
|
||||
cmd = '%s /target:%s %s' % (build_cmd, ';'.join(targets), ' '.join(opts))
|
||||
print 'Running build(targets) %r in %r' % (cmd, d)
|
||||
self.run(cmd)
|
||||
else:
|
||||
for t in targets:
|
||||
cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts))
|
||||
print 'Running build(targets) %r in %r' % (cmd, d)
|
||||
self.run(cmd)
|
||||
else:
|
||||
cmd = '%s %s' % (build_cmd, ' '.join(opts))
|
||||
print 'Running build %r in %r' % (cmd, d)
|
||||
self.run(cmd)
|
||||
finally:
|
||||
os.chdir(cwd)
|
||||
|
||||
class CygwinSetup(WindowsSetup):
|
||||
def __init__(self):
|
||||
super(CygwinSetup, self).__init__()
|
||||
self.generator = 'vc80'
|
||||
|
||||
def cmake_commandline(self, src_dir, build_dir, opts, simple):
|
||||
dos_dir = commands.getoutput("cygpath -w %s" % src_dir)
|
||||
args = dict(
|
||||
dir=dos_dir,
|
||||
generator=self.gens[self.generator.lower()]['gen'],
|
||||
opts=quote(opts),
|
||||
standalone=self.standalone,
|
||||
unattended=self.unattended,
|
||||
project_name=self.project_name,
|
||||
word_size=self.word_size,
|
||||
)
|
||||
if self.word_size == 64:
|
||||
args["generator"] += r' Win64'
|
||||
#if simple:
|
||||
# return 'cmake %(opts)s "%(dir)s"' % args
|
||||
return ('cmake -G "%(generator)s" '
|
||||
'-DUNATTENDED:BOOl=%(unattended)s '
|
||||
'-DSTANDALONE:BOOL=%(standalone)s '
|
||||
'-DWORD_SIZE:STRING=%(word_size)s '
|
||||
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
|
||||
'%(opts)s "%(dir)s"' % args)
|
||||
|
||||
setup_platform = {
|
||||
'darwin': DarwinSetup,
|
||||
'linux2': LinuxSetup,
|
||||
'linux3': LinuxSetup,
|
||||
'win32' : WindowsSetup,
|
||||
'cygwin' : CygwinSetup
|
||||
}
|
||||
|
||||
|
||||
usage_msg = '''
|
||||
Usage: develop.py [options] [command [command-options]]
|
||||
|
||||
Options:
|
||||
-h | --help print this help message
|
||||
--standalone build standalone, without Linden prebuild libraries
|
||||
--unattended build unattended, do not invoke any tools requiring
|
||||
a human response
|
||||
--universal build a universal binary on Mac OS X (unsupported)
|
||||
-t | --type=NAME build type ("Debug", "Release", or "RelWithDebInfo")
|
||||
-m32 | -m64 build architecture (32-bit or 64-bit)
|
||||
-N | --no-distcc disable use of distcc
|
||||
-G | --generator=NAME generator name
|
||||
Windows: VC100 (VS2010) (default)
|
||||
Mac OS X: Xcode (default), Unix Makefiles
|
||||
Linux: Unix Makefiles (default), KDevelop3
|
||||
-p | --project=NAME set the root project name. (Doesn't effect makefiles)
|
||||
|
||||
Commands:
|
||||
build configure and build default target
|
||||
clean delete all build directories, does not affect sources
|
||||
configure configure project by running cmake (default if none given)
|
||||
printbuilddirs print the build directory that will be used
|
||||
|
||||
Command-options for "configure":
|
||||
We use cmake variables to change the build configuration.
|
||||
-DPACKAGE:BOOL=ON Create "package" target to make installers
|
||||
-DLL_TESTS:BOOL=OFF Don't generate unit test projects
|
||||
-DEXAMPLEPLUGIN:BOOL=OFF Don't generate example plugin project
|
||||
-DDISABLE_TCMALLOC:BOOL=ON Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)
|
||||
-DRELEASE_CRASH_REPORTING:BOOL=ON Enable Google Breakpad crash reporting
|
||||
-DFMODSTUDIO:BOOL=ON Use FMOD Studio audio libraries
|
||||
-DFMODEX:BOOL=ON Use FMOD Ex audio libraries
|
||||
|
||||
Examples:
|
||||
Set up a Visual Studio 2010 project with "package" target:
|
||||
develop.py -G vc100 configure -DPACKAGE:BOOL=ON
|
||||
'''
|
||||
|
||||
def main(arguments):
|
||||
setup = setup_platform[sys.platform]()
|
||||
try:
|
||||
opts, args = getopt.getopt(
|
||||
arguments,
|
||||
'?hNt:p:G:m:',
|
||||
['help', 'standalone', 'no-distcc', 'unattended', 'type=', 'incredibuild', 'generator=', 'project='])
|
||||
except getopt.GetoptError, err:
|
||||
print >> sys.stderr, 'Error:', err
|
||||
print >> sys.stderr, """
|
||||
Note: You must pass -D options to cmake after the "configure" command
|
||||
For example: develop.py configure -DSERVER:BOOL=OFF"""
|
||||
print >> sys.stderr, usage_msg.strip()
|
||||
sys.exit(1)
|
||||
|
||||
for o, a in opts:
|
||||
if o in ('-?', '-h', '--help'):
|
||||
print usage_msg.strip()
|
||||
sys.exit(0)
|
||||
elif o in ('--standalone',):
|
||||
setup.standalone = 'ON'
|
||||
elif o in ('--unattended',):
|
||||
setup.unattended = 'ON'
|
||||
elif o in ('-m',):
|
||||
if a in ('32', '64'):
|
||||
setup.word_size = int(a)
|
||||
else:
|
||||
print >> sys.stderr, 'Error: unknown word size', repr(a)
|
||||
print >> sys.stderr, 'Supported word sizes: 32, 64'
|
||||
sys.exit(1)
|
||||
elif o in ('-t', '--type'):
|
||||
try:
|
||||
setup.build_type = setup.build_types[a.lower()]
|
||||
except KeyError:
|
||||
print >> sys.stderr, 'Error: unknown build type', repr(a)
|
||||
print >> sys.stderr, 'Supported build types:'
|
||||
types = setup.build_types.values()
|
||||
types.sort()
|
||||
for t in types:
|
||||
print ' ', t
|
||||
sys.exit(1)
|
||||
elif o in ('-G', '--generator'):
|
||||
setup.generator = a
|
||||
elif o in ('-N', '--no-distcc'):
|
||||
setup.distcc = False
|
||||
elif o in ('-p', '--project'):
|
||||
setup.project_name = a
|
||||
elif o in ('--incredibuild'):
|
||||
setup.incredibuild = True
|
||||
else:
|
||||
print >> sys.stderr, 'INTERNAL ERROR: unhandled option', repr(o)
|
||||
sys.exit(1)
|
||||
if not args:
|
||||
setup.run_cmake()
|
||||
return
|
||||
try:
|
||||
cmd = args.pop(0)
|
||||
if cmd in ('cmake', 'configure'):
|
||||
setup.run_cmake(args)
|
||||
elif cmd == 'build':
|
||||
if os.getenv('DISTCC_DIR') is None:
|
||||
distcc_dir = os.path.join(getcwd(), '.distcc')
|
||||
if not os.path.exists(distcc_dir):
|
||||
os.mkdir(distcc_dir)
|
||||
print "setting DISTCC_DIR to %s" % distcc_dir
|
||||
os.environ['DISTCC_DIR'] = distcc_dir
|
||||
else:
|
||||
print "DISTCC_DIR is set to %s" % os.getenv('DISTCC_DIR')
|
||||
for d in setup.build_dirs():
|
||||
if not os.path.exists(d):
|
||||
raise CommandError('run "develop.py cmake" first')
|
||||
setup.run_cmake()
|
||||
opts, targets = setup.parse_build_opts(args)
|
||||
setup.run_build(opts, targets)
|
||||
elif cmd == 'clean':
|
||||
if args:
|
||||
raise CommandError('clean takes no arguments')
|
||||
setup.cleanup()
|
||||
elif cmd == 'printbuilddirs':
|
||||
for d in setup.build_dirs():
|
||||
print >> sys.stdout, d
|
||||
else:
|
||||
print >> sys.stderr, 'Error: unknown subcommand', repr(cmd)
|
||||
print >> sys.stderr, "(run 'develop.py --help' for help)"
|
||||
sys.exit(1)
|
||||
except getopt.GetoptError, err:
|
||||
print >> sys.stderr, 'Error with %r subcommand: %s' % (cmd, err)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main(sys.argv[1:])
|
||||
except CommandError, err:
|
||||
print >> sys.stderr, 'Error:', err
|
||||
sys.exit(1)
|
||||
@@ -1,24 +1,3 @@
|
||||
#!/usr/bin/python
|
||||
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
## Second Life Viewer Source Code
|
||||
## Copyright (C) 2011, Linden Research, Inc.
|
||||
##
|
||||
## This library is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU Lesser General Public
|
||||
## License as published by the Free Software Foundation;
|
||||
## version 2.1 of the License only.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU Lesser General Public
|
||||
## License along with this library; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
## $/LicenseInfo$
|
||||
|
||||
import warnings
|
||||
|
||||
|
||||
@@ -1,24 +1,3 @@
|
||||
#!/usr/bin/python
|
||||
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
## Second Life Viewer Source Code
|
||||
## Copyright (C) 2011, Linden Research, Inc.
|
||||
##
|
||||
## This library is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU Lesser General Public
|
||||
## License as published by the Free Software Foundation;
|
||||
## version 2.1 of the License only.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU Lesser General Public
|
||||
## License along with this library; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
## $/LicenseInfo$
|
||||
from indra.base import llsd, lluuid
|
||||
from indra.ipc import siesta
|
||||
import datetime, math, unittest
|
||||
|
||||
@@ -36,6 +36,7 @@ $/LicenseInfo$
|
||||
|
||||
# Using cElementTree might cause some unforeseen problems, so here's a
|
||||
# convenient off switch.
|
||||
|
||||
use_celementree = True
|
||||
|
||||
try:
|
||||
|
||||
@@ -41,14 +41,6 @@ import tarfile
|
||||
import errno
|
||||
import subprocess
|
||||
|
||||
class ManifestError(RuntimeError):
|
||||
"""Use an exception more specific than generic Python RuntimeError"""
|
||||
pass
|
||||
|
||||
class MissingError(ManifestError):
|
||||
"""You specified a file that doesn't exist"""
|
||||
pass
|
||||
|
||||
def path_ancestors(path):
|
||||
drive, path = os.path.splitdrive(os.path.normpath(path))
|
||||
result = []
|
||||
@@ -84,9 +76,31 @@ def get_default_platform(dummy):
|
||||
'darwin':'darwin'
|
||||
}[sys.platform]
|
||||
|
||||
def get_default_version(srctree):
|
||||
# look up llversion.h and parse out the version info
|
||||
paths = [os.path.join(srctree, x, 'llversionviewer.h') for x in ['llcommon', '../llcommon', '../../indra/llcommon.h']]
|
||||
for p in paths:
|
||||
if os.path.exists(p):
|
||||
contents = open(p, 'r').read()
|
||||
major = re.search("LL_VERSION_MAJOR\s=\s([0-9]+)", contents).group(1)
|
||||
minor = re.search("LL_VERSION_MINOR\s=\s([0-9]+)", contents).group(1)
|
||||
patch = re.search("LL_VERSION_PATCH\s=\s([0-9]+)", contents).group(1)
|
||||
build = re.search("LL_VERSION_BUILD\s=\s([0-9]+)", contents).group(1)
|
||||
return major, minor, patch, build
|
||||
|
||||
def get_channel(srctree):
|
||||
# look up llversionserver.h and parse out the version info
|
||||
paths = [os.path.join(srctree, x, 'llversionviewer.h') for x in ['llcommon', '../llcommon', '../../indra/llcommon.h']]
|
||||
for p in paths:
|
||||
if os.path.exists(p):
|
||||
contents = open(p, 'r').read()
|
||||
channel = re.search("LL_CHANNEL\s=\s\"(.+)\";\s*$", contents, flags = re.M).group(1)
|
||||
return channel
|
||||
|
||||
|
||||
DEFAULT_SRCTREE = os.path.dirname(sys.argv[0])
|
||||
CHANNEL_VENDOR_BASE = 'Singularity'
|
||||
RELEASE_CHANNEL = CHANNEL_VENDOR_BASE + ' Release'
|
||||
DEFAULT_CHANNEL = 'Second Life Release'
|
||||
DEFAULT_CHANNEL_SNOWGLOBE = 'Snowglobe Release'
|
||||
|
||||
ARGUMENTS=[
|
||||
dict(name='actions',
|
||||
@@ -107,19 +121,27 @@ ARGUMENTS=[
|
||||
On Linux this would try to use Linux_i686Manifest.""",
|
||||
default=""),
|
||||
dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE),
|
||||
dict(name='buildtype', description='Build type (i.e. Debug, Release, RelWithDebInfo).', default=None),
|
||||
dict(name='configuration',
|
||||
description="""The build configuration used.""",
|
||||
dict(name='buildtype', description="""The build type used. ('Debug', 'Release', or 'RelWithDebInfo')
|
||||
Default is Release """,
|
||||
default="Release"),
|
||||
dict(name='branding_id', description="""Identifier for the branding set to
|
||||
use. Currently, 'secondlife' or 'snowglobe')""",
|
||||
default='secondlife'),
|
||||
dict(name='configuration',
|
||||
description="""The build configuration used. Only used on OS X for
|
||||
now, but it could be used for other platforms as well.""",
|
||||
default="Universal"),
|
||||
dict(name='dest', description='Destination directory.', default=DEFAULT_SRCTREE),
|
||||
dict(name='grid',
|
||||
description="""Which grid the client will try to connect to.""",
|
||||
default=None),
|
||||
description="""Which grid the client will try to connect to. Even
|
||||
though it's not strictly a grid, 'firstlook' is also an acceptable
|
||||
value for this parameter.""",
|
||||
default=""),
|
||||
dict(name='channel',
|
||||
description="""The channel to use for updates, packaging, settings name, etc.""",
|
||||
default='CHANNEL UNSET'),
|
||||
dict(name='channel_suffix',
|
||||
description="""Addition to the channel for packaging and channel value, but not application name (used internally)""",
|
||||
default=get_channel),
|
||||
dict(name='login_channel',
|
||||
description="""The channel to use for login handshake/updates only.""",
|
||||
default=None),
|
||||
dict(name='installer_name',
|
||||
description=""" The name of the file that the installer should be
|
||||
@@ -144,12 +166,12 @@ ARGUMENTS=[
|
||||
contain the name of the final package in a form suitable
|
||||
for use by a .bat file.""",
|
||||
default=None),
|
||||
dict(name='versionfile',
|
||||
description="""The name of a file containing the full version number."""),
|
||||
dict(name='signature',
|
||||
description="""This specifies an identity to sign the viewer with, if any.
|
||||
If no value is supplied, the default signature will be used, if any. Currently
|
||||
only used on Mac OS X.""",
|
||||
dict(name='version',
|
||||
description="""This specifies the version of Second Life that is
|
||||
being packaged up.""",
|
||||
default=get_default_version),
|
||||
dict(name='extra_libraries',
|
||||
description="""List of extra libraries to include in package""",
|
||||
default=None)
|
||||
]
|
||||
|
||||
@@ -171,9 +193,8 @@ def usage(srctree=""):
|
||||
arg['description'] % nd)
|
||||
|
||||
def main():
|
||||
## import itertools
|
||||
## print ' '.join((("'%s'" % item) if ' ' in item else item)
|
||||
## for item in itertools.chain([sys.executable], sys.argv))
|
||||
print "cwd:", os.getcwd()
|
||||
print " ".join(sys.argv)
|
||||
option_names = [arg['name'] + '=' for arg in ARGUMENTS]
|
||||
option_names.append('help')
|
||||
options, remainder = getopt.getopt(sys.argv[1:], "", option_names)
|
||||
@@ -210,17 +231,12 @@ def main():
|
||||
args[arg['name']] = default
|
||||
|
||||
# fix up version
|
||||
if isinstance(args.get('versionfile'), str):
|
||||
try: # read in the version string
|
||||
vf = open(args['versionfile'], 'r')
|
||||
args['version'] = vf.read().strip().split('.')
|
||||
except:
|
||||
print "Unable to read versionfile '%s'" % args['versionfile']
|
||||
raise
|
||||
|
||||
# unspecified, default, and agni are default
|
||||
if args['grid'] in ['', 'default', 'agni']:
|
||||
args['grid'] = None
|
||||
if isinstance(args.get('version'), str):
|
||||
args['version'] = args['version'].split('.')
|
||||
|
||||
# default and agni are default
|
||||
if args['grid'] in ['default', 'agni']:
|
||||
args['grid'] = ''
|
||||
|
||||
if 'actions' in args:
|
||||
args['actions'] = args['actions'].split()
|
||||
@@ -229,101 +245,15 @@ def main():
|
||||
for opt in args:
|
||||
print "Option:", opt, "=", args[opt]
|
||||
|
||||
# pass in sourceid as an argument now instead of an environment variable
|
||||
try:
|
||||
args['sourceid'] = os.environ["sourceid"]
|
||||
except KeyError:
|
||||
args['sourceid'] = ""
|
||||
|
||||
# Build base package.
|
||||
touch = args.get('touch')
|
||||
if touch:
|
||||
print 'Creating base package'
|
||||
args['package_id'] = "" # base package has no package ID
|
||||
wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
|
||||
wm.do(*args['actions'])
|
||||
# Store package file for later if making touched file.
|
||||
base_package_file = ""
|
||||
if touch:
|
||||
print 'Created base package ', wm.package_file
|
||||
base_package_file = "" + wm.package_file
|
||||
|
||||
# handle multiple packages if set
|
||||
try:
|
||||
additional_packages = os.environ["additional_packages"]
|
||||
except KeyError:
|
||||
additional_packages = ""
|
||||
if additional_packages:
|
||||
# Determine destination prefix / suffix for additional packages.
|
||||
base_dest_postfix = args['dest']
|
||||
base_dest_prefix = ""
|
||||
base_dest_parts = args['dest'].split(os.sep)
|
||||
if len(base_dest_parts) > 1:
|
||||
base_dest_postfix = base_dest_parts[len(base_dest_parts) - 1]
|
||||
base_dest_prefix = base_dest_parts[0]
|
||||
i = 1
|
||||
while i < len(base_dest_parts) - 1:
|
||||
base_dest_prefix = base_dest_prefix + os.sep + base_dest_parts[i]
|
||||
i = i + 1
|
||||
# Determine touched prefix / suffix for additional packages.
|
||||
base_touch_postfix = ""
|
||||
base_touch_prefix = ""
|
||||
if touch:
|
||||
base_touch_postfix = touch
|
||||
base_touch_parts = touch.split('/')
|
||||
if "arwin" in args['platform']:
|
||||
if len(base_touch_parts) > 1:
|
||||
base_touch_postfix = base_touch_parts[len(base_touch_parts) - 1]
|
||||
base_touch_prefix = base_touch_parts[0]
|
||||
i = 1
|
||||
while i < len(base_touch_parts) - 1:
|
||||
base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i]
|
||||
i = i + 1
|
||||
else:
|
||||
if len(base_touch_parts) > 2:
|
||||
base_touch_postfix = base_touch_parts[len(base_touch_parts) - 2] + '/' + base_touch_parts[len(base_touch_parts) - 1]
|
||||
base_touch_prefix = base_touch_parts[0]
|
||||
i = 1
|
||||
while i < len(base_touch_parts) - 2:
|
||||
base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i]
|
||||
i = i + 1
|
||||
# Store base channel name.
|
||||
base_channel_name = args['channel']
|
||||
# Build each additional package.
|
||||
package_id_list = additional_packages.split(" ")
|
||||
args['channel'] = base_channel_name
|
||||
for package_id in package_id_list:
|
||||
try:
|
||||
if package_id + "_viewer_channel_suffix" in os.environ:
|
||||
args['channel_suffix'] = os.environ[package_id + "_viewer_channel_suffix"]
|
||||
else:
|
||||
args['channel_suffix'] = None
|
||||
if package_id + "_sourceid" in os.environ:
|
||||
args['sourceid'] = os.environ[package_id + "_sourceid"]
|
||||
else:
|
||||
args['sourceid'] = None
|
||||
args['dest'] = base_dest_prefix + os.sep + package_id + os.sep + base_dest_postfix
|
||||
except KeyError:
|
||||
sys.stderr.write("Failed to create package for package_id: %s" % package_id)
|
||||
sys.stderr.flush()
|
||||
continue
|
||||
if touch:
|
||||
print 'Creating additional package for "', package_id, '" in ', args['dest']
|
||||
wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args)
|
||||
wm.do(*args['actions'])
|
||||
if touch:
|
||||
print 'Created additional package ', wm.package_file, ' for ', package_id
|
||||
faketouch = base_touch_prefix + '/' + package_id + '/' + base_touch_postfix
|
||||
fp = open(faketouch, 'w')
|
||||
fp.write('set package_file=%s\n' % wm.package_file)
|
||||
fp.close()
|
||||
|
||||
# Write out the package file in this format, so that it can easily be called
|
||||
# and used in a .bat file - yeah, it sucks, but this is the simplest...
|
||||
touch = args.get('touch')
|
||||
if touch:
|
||||
fp = open(touch, 'w')
|
||||
fp.write('set package_file=%s\n' % base_package_file)
|
||||
fp.write('set package_file=%s\n' % wm.package_file)
|
||||
fp.close()
|
||||
print 'touched', touch
|
||||
return 0
|
||||
@@ -339,8 +269,8 @@ class LLManifest(object):
|
||||
__metaclass__ = LLManifestRegistry
|
||||
manifests = {}
|
||||
def for_platform(self, platform, arch = None):
|
||||
if arch:
|
||||
platform = platform + '_' + arch + '_'
|
||||
if arch and platform != "windows":
|
||||
platform = platform + '_' + arch
|
||||
return self.manifests[platform.lower()]
|
||||
for_platform = classmethod(for_platform)
|
||||
|
||||
@@ -350,15 +280,26 @@ class LLManifest(object):
|
||||
self.file_list = []
|
||||
self.excludes = []
|
||||
self.actions = []
|
||||
self.src_prefix = [args['source']]
|
||||
self.artwork_prefix = [args['artwork']]
|
||||
self.build_prefix = [args['build']]
|
||||
self.dst_prefix = [args['dest']]
|
||||
self.src_prefix = list([args['source']])
|
||||
self.artwork_prefix = list([args['artwork']])
|
||||
self.build_prefix = list([args['build']])
|
||||
self.alt_build_prefix = list([args['build']])
|
||||
self.dst_prefix = list([args['dest']])
|
||||
self.created_paths = []
|
||||
self.package_name = "Unknown"
|
||||
|
||||
|
||||
def default_grid(self):
|
||||
return self.args.get('grid', None) == ''
|
||||
def default_channel(self):
|
||||
return self.args.get('channel', None) == RELEASE_CHANNEL
|
||||
return self.args.get('channel', None) == DEFAULT_CHANNEL
|
||||
|
||||
def default_channel_for_brand(self):
|
||||
if self.viewer_branding_id()=='secondlife':
|
||||
return self.args.get('channel', None) == DEFAULT_CHANNEL
|
||||
elif self.viewer_branding_id()=="snowglobe":
|
||||
return self.args.get('channel', None) == DEFAULT_CHANNEL_SNOWGLOBE
|
||||
else:
|
||||
return True
|
||||
|
||||
def construct(self):
|
||||
""" Meant to be overriden by LLManifest implementors with code that
|
||||
@@ -370,7 +311,7 @@ class LLManifest(object):
|
||||
in the file list by path()."""
|
||||
self.excludes.append(glob)
|
||||
|
||||
def prefix(self, src='', build=None, dst=None):
|
||||
def prefix(self, src='', build=None, dst=None, alt_build=None):
|
||||
""" Pushes a prefix onto the stack. Until end_prefix is
|
||||
called, all relevant method calls (esp. to path()) will prefix
|
||||
paths with the entire prefix stack. Source and destination
|
||||
@@ -381,10 +322,15 @@ class LLManifest(object):
|
||||
dst = src
|
||||
if build is None:
|
||||
build = src
|
||||
if alt_build is None:
|
||||
alt_build = build
|
||||
|
||||
self.src_prefix.append(src)
|
||||
self.artwork_prefix.append(src)
|
||||
self.build_prefix.append(build)
|
||||
self.dst_prefix.append(dst)
|
||||
self.alt_build_prefix.append(alt_build)
|
||||
|
||||
return True # so that you can wrap it in an if to get indentation
|
||||
|
||||
def end_prefix(self, descr=None):
|
||||
@@ -397,25 +343,30 @@ class LLManifest(object):
|
||||
src = self.src_prefix.pop()
|
||||
artwork = self.artwork_prefix.pop()
|
||||
build = self.build_prefix.pop()
|
||||
alt_build_prefix = self.alt_build_prefix.pop()
|
||||
dst = self.dst_prefix.pop()
|
||||
if descr and not(src == descr or build == descr or dst == descr):
|
||||
raise ValueError, "End prefix '" + descr + "' didn't match '" +src+ "' or '" +dst + "'"
|
||||
|
||||
def get_src_prefix(self):
|
||||
""" Returns the current source prefix."""
|
||||
return os.path.join(*self.src_prefix)
|
||||
return os.path.relpath(os.path.normpath(os.path.join(*self.src_prefix)))
|
||||
|
||||
def get_artwork_prefix(self):
|
||||
""" Returns the current artwork prefix."""
|
||||
return os.path.join(*self.artwork_prefix)
|
||||
return os.path.relpath(os.path.normpath(os.path.join(*self.artwork_prefix)))
|
||||
|
||||
def get_build_prefix(self):
|
||||
""" Returns the current build prefix."""
|
||||
return os.path.join(*self.build_prefix)
|
||||
return os.path.relpath(os.path.normpath(os.path.join(*self.build_prefix)))
|
||||
|
||||
def get_alt_build_prefix(self):
|
||||
""" Returns the current alternate source prefix."""
|
||||
return os.path.relpath(os.path.normpath(os.path.join(*self.alt_build_prefix)))
|
||||
|
||||
def get_dst_prefix(self):
|
||||
""" Returns the current destination prefix."""
|
||||
return os.path.join(*self.dst_prefix)
|
||||
return os.path.relpath(os.path.normpath(os.path.join(*self.dst_prefix)))
|
||||
|
||||
def src_path_of(self, relpath):
|
||||
"""Returns the full path to a file or directory specified
|
||||
@@ -432,45 +383,25 @@ class LLManifest(object):
|
||||
relative to the destination directory."""
|
||||
return os.path.join(self.get_dst_prefix(), relpath)
|
||||
|
||||
def ensure_src_dir(self, reldir):
|
||||
"""Construct the path for a directory relative to the
|
||||
source path, and ensures that it exists. Returns the
|
||||
full path."""
|
||||
path = os.path.join(self.get_src_prefix(), reldir)
|
||||
self.cmakedirs(path)
|
||||
return path
|
||||
|
||||
def ensure_dst_dir(self, reldir):
|
||||
"""Construct the path for a directory relative to the
|
||||
destination path, and ensures that it exists. Returns the
|
||||
full path."""
|
||||
path = os.path.join(self.get_dst_prefix(), reldir)
|
||||
self.cmakedirs(path)
|
||||
return path
|
||||
|
||||
def run_command(self, command):
|
||||
""" Runs an external command, and returns the output. Raises
|
||||
an exception if the command returns a nonzero status code. For
|
||||
debugging/informational purposes, prints out the command's
|
||||
an exception if the command reurns a nonzero status code. For
|
||||
debugging/informational purpoases, prints out the command's
|
||||
output as it is received."""
|
||||
print "Running command:", command
|
||||
sys.stdout.flush()
|
||||
child = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||
shell=True)
|
||||
fd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
lines = []
|
||||
while True:
|
||||
lines.append(child.stdout.readline())
|
||||
lines.append(fd.stdout.readline())
|
||||
if lines[-1] == '':
|
||||
break
|
||||
else:
|
||||
print lines[-1],
|
||||
print lines[-1].rstrip('\n'),
|
||||
output = ''.join(lines)
|
||||
child.stdout.close()
|
||||
status = child.wait()
|
||||
if status:
|
||||
raise ManifestError(
|
||||
if fd.returncode:
|
||||
raise RuntimeError(
|
||||
"Command %s returned non-zero status (%s) \noutput:\n%s"
|
||||
% (command, status, output) )
|
||||
% (command, fd.returncode, output) )
|
||||
return output
|
||||
|
||||
def created_path(self, path):
|
||||
@@ -478,24 +409,14 @@ class LLManifest(object):
|
||||
a) verify that you really have created it
|
||||
b) schedule it for cleanup"""
|
||||
if not os.path.exists(path):
|
||||
raise ManifestError, "Should be something at path " + path
|
||||
raise RuntimeError, "Should be something at path " + path
|
||||
self.created_paths.append(path)
|
||||
|
||||
def put_in_file(self, contents, dst, src=None):
|
||||
def put_in_file(self, contents, dst):
|
||||
# write contents as dst
|
||||
dst_path = self.dst_path_of(dst)
|
||||
f = open(dst_path, "wb")
|
||||
try:
|
||||
f.write(contents)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
# Why would we create a file in the destination tree if not to include
|
||||
# it in the installer? The default src=None (plus the fact that the
|
||||
# src param is last) is to preserve backwards compatibility.
|
||||
if src:
|
||||
self.file_list.append([src, dst_path])
|
||||
return dst_path
|
||||
f = open(self.dst_path_of(dst), "wb")
|
||||
f.write(contents)
|
||||
f.close()
|
||||
|
||||
def replace_in(self, src, dst=None, searchdict={}):
|
||||
if dst == None:
|
||||
@@ -515,7 +436,11 @@ class LLManifest(object):
|
||||
# ensure that destination path exists
|
||||
self.cmakedirs(os.path.dirname(dst))
|
||||
self.created_paths.append(dst)
|
||||
self.ccopymumble(src, dst)
|
||||
if not os.path.isdir(src):
|
||||
self.ccopy(src,dst)
|
||||
else:
|
||||
# src is a dir
|
||||
self.ccopytree(src,dst)
|
||||
else:
|
||||
print "Doesn't exist:", src
|
||||
|
||||
@@ -554,29 +479,30 @@ class LLManifest(object):
|
||||
if method is not None:
|
||||
method(src, dst)
|
||||
self.file_list.append([src, dst])
|
||||
return 1
|
||||
return [dst]
|
||||
else:
|
||||
sys.stdout.write(" (excluding %r, %r)" % (src, dst))
|
||||
sys.stdout.flush()
|
||||
return 0
|
||||
return []
|
||||
|
||||
def process_directory(self, src, dst):
|
||||
if not self.includes(src, dst):
|
||||
sys.stdout.write(" (excluding %r, %r)" % (src, dst))
|
||||
sys.stdout.flush()
|
||||
return 0
|
||||
return []
|
||||
names = os.listdir(src)
|
||||
self.cmakedirs(dst)
|
||||
errors = []
|
||||
found_files = []
|
||||
count = 0
|
||||
for name in names:
|
||||
srcname = os.path.join(src, name)
|
||||
dstname = os.path.join(dst, name)
|
||||
if os.path.isdir(srcname):
|
||||
count += self.process_directory(srcname, dstname)
|
||||
found_files.extend(self.process_directory(srcname, dstname))
|
||||
else:
|
||||
count += self.process_file(srcname, dstname)
|
||||
return count
|
||||
found_files.extend(self.process_file(srcname, dstname))
|
||||
return found_files
|
||||
|
||||
def includes(self, src, dst):
|
||||
if src:
|
||||
@@ -594,38 +520,28 @@ class LLManifest(object):
|
||||
else:
|
||||
os.remove(path)
|
||||
|
||||
def ccopymumble(self, src, dst):
|
||||
"""Copy a single symlink, file or directory."""
|
||||
def ccopy(self, src, dst):
|
||||
""" Copy a single file or symlink. Uses filecmp to skip copying for existing files."""
|
||||
if os.path.islink(src):
|
||||
linkto = os.readlink(src)
|
||||
if os.path.islink(dst) or os.path.isfile(dst):
|
||||
if os.path.islink(dst) or os.path.exists(dst):
|
||||
os.remove(dst) # because symlinking over an existing link fails
|
||||
elif os.path.isdir(dst):
|
||||
shutil.rmtree(dst)
|
||||
os.symlink(linkto, dst)
|
||||
elif os.path.isdir(src):
|
||||
self.ccopytree(src, dst)
|
||||
else:
|
||||
self.ccopyfile(src, dst)
|
||||
# XXX What about devices, sockets etc.?
|
||||
# YYY would we put such things into a viewer package?!
|
||||
# Don't recopy file if it's up-to-date.
|
||||
# If we seem to be not not overwriting files that have been
|
||||
# updated, set the last arg to False, but it will take longer.
|
||||
if os.path.exists(dst) and filecmp.cmp(src, dst, True):
|
||||
return
|
||||
# only copy if it's not excluded
|
||||
if self.includes(src, dst):
|
||||
try:
|
||||
os.unlink(dst)
|
||||
except OSError, err:
|
||||
if err.errno != errno.ENOENT:
|
||||
raise
|
||||
|
||||
def ccopyfile(self, src, dst):
|
||||
""" Copy a single file. Uses filecmp to skip copying for existing files."""
|
||||
# Don't recopy file if it's up-to-date.
|
||||
# If we seem to be not not overwriting files that have been
|
||||
# updated, set the last arg to False, but it will take longer.
|
||||
if os.path.exists(dst) and filecmp.cmp(src, dst, True):
|
||||
return
|
||||
# only copy if it's not excluded
|
||||
if self.includes(src, dst):
|
||||
try:
|
||||
os.unlink(dst)
|
||||
except OSError, err:
|
||||
if err.errno != errno.ENOENT:
|
||||
raise
|
||||
|
||||
shutil.copy2(src, dst)
|
||||
shutil.copy2(src, dst)
|
||||
|
||||
def ccopytree(self, src, dst):
|
||||
"""Direct copy of shutil.copytree with the additional
|
||||
@@ -641,11 +557,15 @@ class LLManifest(object):
|
||||
srcname = os.path.join(src, name)
|
||||
dstname = os.path.join(dst, name)
|
||||
try:
|
||||
self.ccopymumble(srcname, dstname)
|
||||
if os.path.isdir(srcname):
|
||||
self.ccopytree(srcname, dstname)
|
||||
else:
|
||||
self.ccopy(srcname, dstname)
|
||||
# XXX What about devices, sockets etc.?
|
||||
except (IOError, os.error), why:
|
||||
errors.append((srcname, dstname, why))
|
||||
if errors:
|
||||
raise ManifestError, errors
|
||||
raise RuntimeError, errors
|
||||
|
||||
|
||||
def cmakedirs(self, path):
|
||||
@@ -662,25 +582,11 @@ class LLManifest(object):
|
||||
if os.path.exists(f):
|
||||
return f
|
||||
# didn't find it, return last item in list
|
||||
if len(list) > 0:
|
||||
if list:
|
||||
return list[-1]
|
||||
else:
|
||||
return None
|
||||
|
||||
def contents_of_tar(self, src_tar, dst_dir):
|
||||
""" Extracts the contents of the tarfile (specified
|
||||
relative to the source prefix) into the directory
|
||||
specified relative to the destination directory."""
|
||||
self.check_file_exists(src_tar)
|
||||
tf = tarfile.open(self.src_path_of(src_tar), 'r')
|
||||
for member in tf.getmembers():
|
||||
tf.extract(member, self.ensure_dst_dir(dst_dir))
|
||||
# TODO get actions working on these dudes, perhaps we should extract to a temporary directory and then process_directory on it?
|
||||
self.file_list.append([src_tar,
|
||||
self.dst_path_of(os.path.join(dst_dir,member.name))])
|
||||
tf.close()
|
||||
|
||||
|
||||
def wildcard_regex(self, src_glob, dst_glob):
|
||||
src_re = re.escape(src_glob)
|
||||
src_re = src_re.replace('\*', '([-a-zA-Z0-9._ ]*)')
|
||||
@@ -691,12 +597,7 @@ class LLManifest(object):
|
||||
i = i+1
|
||||
return re.compile(src_re), dst_temp
|
||||
|
||||
def check_file_exists(self, path):
|
||||
if not os.path.exists(path) and not os.path.islink(path):
|
||||
raise MissingError("Path %s doesn't exist" % (os.path.abspath(path),))
|
||||
|
||||
|
||||
wildcard_pattern = re.compile(r'\*')
|
||||
wildcard_pattern = re.compile('\*')
|
||||
def expand_globs(self, src, dst):
|
||||
src_list = glob.glob(src)
|
||||
src_re, d_template = self.wildcard_regex(src.replace('\\', '/'),
|
||||
@@ -723,53 +624,43 @@ class LLManifest(object):
|
||||
return self.path(os.path.join(path, file), file)
|
||||
|
||||
def path(self, src, dst=None):
|
||||
sys.stdout.write("Processing %s => %s ... " % (src, dst))
|
||||
sys.stdout.flush()
|
||||
if src == None:
|
||||
raise ManifestError("No source file, dst is " + dst)
|
||||
raise RuntimeError("No source file, dst is " + dst)
|
||||
if dst == None:
|
||||
dst = src
|
||||
dst = os.path.join(self.get_dst_prefix(), dst)
|
||||
sys.stdout.write("Processing %s => %s ... " % (src, dst))
|
||||
count = 0
|
||||
is_glob = False
|
||||
found_files = []
|
||||
|
||||
def try_path(src):
|
||||
# expand globs
|
||||
count = 0
|
||||
if self.wildcard_pattern.search(src):
|
||||
for s,d in self.expand_globs(src, dst):
|
||||
# look under each prefix for matching paths. Paths are normalized so './../blah' will match '../blah/../blah/'
|
||||
paths = set([os.path.normpath(os.path.join(self.get_src_prefix(), src)),
|
||||
os.path.normpath(os.path.join(self.get_artwork_prefix(), src)),
|
||||
os.path.normpath(os.path.join(self.get_build_prefix(), src)),
|
||||
os.path.normpath(os.path.join(self.get_alt_build_prefix(), src))]
|
||||
)
|
||||
for path in paths:
|
||||
if self.wildcard_pattern.search(path):
|
||||
is_glob = True
|
||||
for s,d in self.expand_globs(path, dst):
|
||||
assert(s != d)
|
||||
count += self.process_file(s, d)
|
||||
found_files.extend(self.process_file(s, d))
|
||||
else:
|
||||
# if we're specifying a single path (not a glob),
|
||||
# we should error out if it doesn't exist
|
||||
self.check_file_exists(src)
|
||||
# if it's a directory, recurse through it
|
||||
if os.path.isdir(src):
|
||||
count += self.process_directory(src, dst)
|
||||
else:
|
||||
count += self.process_file(src, dst)
|
||||
return count
|
||||
if os.path.isdir(path):
|
||||
found_files.extend(self.process_directory(path, dst))
|
||||
elif os.path.exists(path):
|
||||
found_files.extend(self.process_file(path, dst))
|
||||
|
||||
for pfx in self.get_src_prefix(), self.get_artwork_prefix(), self.get_build_prefix():
|
||||
try:
|
||||
count = try_path(os.path.join(pfx, src))
|
||||
except MissingError:
|
||||
# If src isn't a wildcard, and if that file doesn't exist in
|
||||
# this pfx, try next pfx.
|
||||
count = 0
|
||||
continue
|
||||
# if we're specifying a single path (not a glob),
|
||||
# we should error out if it doesn't exist
|
||||
if not found_files and not is_glob:
|
||||
raise RuntimeError("No files match %s\n" % str(paths))
|
||||
|
||||
# Here try_path() didn't raise MissingError. Did it process any files?
|
||||
if count:
|
||||
break
|
||||
# Even though try_path() didn't raise MissingError, it returned 0
|
||||
# files. src is probably a wildcard meant for some other pfx. Loop
|
||||
# back to try the next.
|
||||
|
||||
print "%d files" % count
|
||||
|
||||
# Let caller check whether we processed as many files as expected. In
|
||||
# particular, let caller notice 0.
|
||||
return count
|
||||
print "%d files" % len(found_files)
|
||||
return found_files
|
||||
|
||||
def do(self, *actions):
|
||||
self.actions = actions
|
||||
|
||||
@@ -1,24 +1,3 @@
|
||||
#!/usr/bin/python
|
||||
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
## Second Life Viewer Source Code
|
||||
## Copyright (C) 2011, Linden Research, Inc.
|
||||
##
|
||||
## This library is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU Lesser General Public
|
||||
## License as published by the Free Software Foundation;
|
||||
## version 2.1 of the License only.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU Lesser General Public
|
||||
## License along with this library; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
## $/LicenseInfo$
|
||||
r"""UUID objects (universally unique identifiers) according to RFC 4122.
|
||||
|
||||
This module provides immutable UUID objects (class UUID) and the functions
|
||||
|
||||
@@ -138,11 +138,7 @@ namespace HACD
|
||||
if (m_callBack)
|
||||
{
|
||||
char msg[1024];
|
||||
#if _MSC_VER
|
||||
sprintf(msg, "nCC %Iu\n", m_graph.m_nCCs);
|
||||
#else
|
||||
sprintf(msg, "nCC %zu\n", m_graph.m_nCCs);
|
||||
#endif
|
||||
(*m_callBack)(msg, 0.0, 0.0, m_graph.GetNVertices());
|
||||
|
||||
}
|
||||
@@ -683,11 +679,7 @@ namespace HACD
|
||||
{
|
||||
if ((!condition1) && m_callBack)
|
||||
{
|
||||
#if _MSC_VER
|
||||
sprintf(msg, "\n-> %Iu\t%f\t%f\t%f\n", m_pqueue.size(), m_graph.m_vertices[v1].m_surf*100.0/m_area, m_graph.m_vertices[v2].m_surf*100.0/m_area, m_graph.m_edges[currentEdge.m_name].m_concavity);
|
||||
#else
|
||||
sprintf(msg, "\n-> %zu\t%f\t%f\t%f\n", m_pqueue.size(), m_graph.m_vertices[v1].m_surf*100.0/m_area, m_graph.m_vertices[v2].m_surf*100.0/m_area, m_graph.m_edges[currentEdge.m_name].m_concavity);
|
||||
#endif
|
||||
(*m_callBack)(msg, progress, globalConcavity, m_graph.GetNVertices());
|
||||
}
|
||||
globalConcavity = std::max<double>(globalConcavity ,m_graph.m_edges[currentEdge.m_name].m_concavity);
|
||||
@@ -887,11 +879,7 @@ namespace HACD
|
||||
if (m_callBack)
|
||||
{
|
||||
char msg[1024];
|
||||
#if _MSC_VER
|
||||
sprintf(msg, "\t CH(%Iu) \t %Iu \t %lf \t %Iu \t %f \t %Iu\n", v, p, m_graph.m_vertices[v].m_concavity, m_graph.m_vertices[v].m_distPoints.Size(), m_graph.m_vertices[v].m_surf*100.0/m_area, m_graph.m_vertices[v].m_ancestors.size());
|
||||
#else
|
||||
sprintf(msg, "\t CH(%zu) \t %zu \t %lf \t %zu \t %f \t %zu\n", v, p, m_graph.m_vertices[v].m_concavity, m_graph.m_vertices[v].m_distPoints.Size(), m_graph.m_vertices[v].m_surf*100.0/m_area, m_graph.m_vertices[v].m_ancestors.size());
|
||||
#endif
|
||||
(*m_callBack)(msg, 0.0, 0.0, m_nClusters);
|
||||
p++;
|
||||
}
|
||||
@@ -989,8 +977,7 @@ namespace HACD
|
||||
m_convexHulls[p].AddPoint(m_points[point.m_name], point.m_name);
|
||||
}
|
||||
}
|
||||
if (p < m_nClusters)
|
||||
m_convexHulls[p].SetDistPoints(0); //&m_graph.m_vertices[v].m_distPoints
|
||||
m_convexHulls[p].SetDistPoints(0); //&m_graph.m_vertices[v].m_distPoints
|
||||
if (fullCH)
|
||||
{
|
||||
while (m_convexHulls[p].Process() == ICHullErrorInconsistent) // if we face problems when constructing the visual-hull. really ugly!!!!
|
||||
|
||||
@@ -30,3 +30,5 @@ set_source_files_properties(${libpathing_HEADER_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
add_library(nd_Pathing STATIC ${libpathing_SOURCE_FILES} ${libpathing_HEADER_FILES} )
|
||||
add_dependencies(nd_Pathing prepare)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "sys.h"
|
||||
#include "llpathinglib.h"
|
||||
|
||||
void LLPathingLib::initSystem()
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
#include "llavatarappearance.h"
|
||||
#include "llavatarappearancedefines.h"
|
||||
#include "llavatarjointmesh.h"
|
||||
#include "llstl.h"
|
||||
#include "imageids.h"
|
||||
#include "lldir.h"
|
||||
#include "lldeleteutils.h"
|
||||
#include "llpolymorph.h"
|
||||
#include "llpolymesh.h"
|
||||
#include "llpolyskeletaldistortion.h"
|
||||
@@ -81,7 +81,6 @@ public:
|
||||
~LLAvatarBoneInfo()
|
||||
{
|
||||
std::for_each(mChildList.begin(), mChildList.end(), DeletePointer());
|
||||
mChildList.clear();
|
||||
}
|
||||
BOOL parseXml(LLXmlTreeNode* node);
|
||||
|
||||
@@ -109,7 +108,6 @@ public:
|
||||
~LLAvatarSkeletonInfo()
|
||||
{
|
||||
std::for_each(mBoneInfoList.begin(), mBoneInfoList.end(), DeletePointer());
|
||||
mBoneInfoList.clear();
|
||||
}
|
||||
BOOL parseXml(LLXmlTreeNode* node);
|
||||
S32 getNumBones() const { return mNumBones; }
|
||||
@@ -134,25 +132,14 @@ LLAvatarAppearance::LLAvatarXmlInfo::LLAvatarXmlInfo()
|
||||
LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo()
|
||||
{
|
||||
std::for_each(mMeshInfoList.begin(), mMeshInfoList.end(), DeletePointer());
|
||||
mMeshInfoList.clear();
|
||||
|
||||
std::for_each(mSkeletalDistortionInfoList.begin(), mSkeletalDistortionInfoList.end(), DeletePointer());
|
||||
mSkeletalDistortionInfoList.clear();
|
||||
|
||||
std::for_each(mAttachmentInfoList.begin(), mAttachmentInfoList.end(), DeletePointer());
|
||||
mAttachmentInfoList.clear();
|
||||
|
||||
delete_and_clear(mTexSkinColorInfo);
|
||||
delete_and_clear(mTexHairColorInfo);
|
||||
delete_and_clear(mTexEyeColorInfo);
|
||||
deleteAndClear(mTexSkinColorInfo);
|
||||
deleteAndClear(mTexHairColorInfo);
|
||||
deleteAndClear(mTexEyeColorInfo);
|
||||
std::for_each(mLayerInfoList.begin(), mLayerInfoList.end(), DeletePointer());
|
||||
mLayerInfoList.clear();
|
||||
|
||||
std::for_each(mDriverInfoList.begin(), mDriverInfoList.end(), DeletePointer());
|
||||
mDriverInfoList.clear();
|
||||
|
||||
std::for_each(mMorphMaskInfoList.begin(), mMorphMaskInfoList.end(), DeletePointer());
|
||||
mMorphMaskInfoList.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +218,7 @@ void LLAvatarAppearance::initInstance()
|
||||
mesh->setMeshID(mesh_index);
|
||||
mesh->setPickName(mesh_dict->mPickName);
|
||||
mesh->setIsTransparent(FALSE);
|
||||
switch((S32)mesh_index)
|
||||
switch((int)mesh_index)
|
||||
{
|
||||
case MESH_ID_HAIR:
|
||||
mesh->setIsTransparent(TRUE);
|
||||
@@ -267,7 +254,7 @@ void LLAvatarAppearance::initInstance()
|
||||
++iter)
|
||||
{
|
||||
LLAvatarJointMesh* mesh = (*iter);
|
||||
mBakedTextureDatas[(S32)baked_texture_index].mJointMeshes.push_back(mesh);
|
||||
mBakedTextureDatas[(int)baked_texture_index].mJointMeshes.push_back(mesh);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,13 +269,13 @@ void LLAvatarAppearance::initInstance()
|
||||
// virtual
|
||||
LLAvatarAppearance::~LLAvatarAppearance()
|
||||
{
|
||||
delete_and_clear(mTexSkinColor);
|
||||
delete_and_clear(mTexHairColor);
|
||||
delete_and_clear(mTexEyeColor);
|
||||
deleteAndClear(mTexSkinColor);
|
||||
deleteAndClear(mTexHairColor);
|
||||
deleteAndClear(mTexEyeColor);
|
||||
|
||||
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
|
||||
{
|
||||
delete_and_clear(mBakedTextureDatas[i].mTexLayerSet);
|
||||
deleteAndClear(mBakedTextureDatas[i].mTexLayerSet);
|
||||
mBakedTextureDatas[i].mJointMeshes.clear();
|
||||
|
||||
for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
|
||||
@@ -299,15 +286,12 @@ LLAvatarAppearance::~LLAvatarAppearance()
|
||||
}
|
||||
}
|
||||
|
||||
if (mRoot)
|
||||
{
|
||||
mRoot->removeAllChildren();
|
||||
delete_and_clear(mRoot);
|
||||
}
|
||||
if (mRoot) mRoot->removeAllChildren();
|
||||
deleteAndClear(mRoot);
|
||||
mJointMap.clear();
|
||||
|
||||
clearSkeleton();
|
||||
delete_and_clear(mCollisionVolumes);
|
||||
clearCollisionVolumes();
|
||||
|
||||
std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer());
|
||||
mPolyMeshes.clear();
|
||||
@@ -333,14 +317,14 @@ void LLAvatarAppearance::initClass()
|
||||
BOOL success = sXMLTree.parseFile( xmlFile, FALSE );
|
||||
if (!success)
|
||||
{
|
||||
LL_ERRS() << "Problem reading avatar configuration file:" << xmlFile << LL_ENDL;
|
||||
llerrs << "Problem reading avatar configuration file:" << xmlFile << llendl;
|
||||
}
|
||||
|
||||
// now sanity check xml file
|
||||
LLXmlTreeNode* root = sXMLTree.getRoot();
|
||||
if (!root)
|
||||
{
|
||||
LL_ERRS() << "No root node found in avatar configuration file: " << xmlFile << LL_ENDL;
|
||||
llerrs << "No root node found in avatar configuration file: " << xmlFile << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -349,14 +333,14 @@ void LLAvatarAppearance::initClass()
|
||||
//-------------------------------------------------------------------------
|
||||
if( !root->hasName( "linden_avatar" ) )
|
||||
{
|
||||
LL_ERRS() << "Invalid avatar file header: " << xmlFile << LL_ENDL;
|
||||
llerrs << "Invalid avatar file header: " << xmlFile << llendl;
|
||||
}
|
||||
|
||||
std::string version;
|
||||
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
|
||||
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
|
||||
{
|
||||
LL_ERRS() << "Invalid avatar file version: " << version << " in file: " << xmlFile << LL_ENDL;
|
||||
llerrs << "Invalid avatar file version: " << version << " in file: " << xmlFile << llendl;
|
||||
}
|
||||
|
||||
S32 wearable_def_version = 1;
|
||||
@@ -369,7 +353,7 @@ void LLAvatarAppearance::initClass()
|
||||
LLXmlTreeNode* skeleton_node = root->getChildByName( "skeleton" );
|
||||
if (!skeleton_node)
|
||||
{
|
||||
LL_ERRS() << "No skeleton in avatar configuration file: " << xmlFile << LL_ENDL;
|
||||
llerrs << "No skeleton in avatar configuration file: " << xmlFile << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -377,14 +361,14 @@ void LLAvatarAppearance::initClass()
|
||||
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
|
||||
if (!skeleton_node->getFastAttributeString(file_name_string, skeleton_file_name))
|
||||
{
|
||||
LL_ERRS() << "No file name in skeleton node in avatar config file: " << xmlFile << LL_ENDL;
|
||||
llerrs << "No file name in skeleton node in avatar config file: " << xmlFile << llendl;
|
||||
}
|
||||
|
||||
std::string skeleton_path;
|
||||
skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name);
|
||||
if (!parseSkeletonFile(skeleton_path))
|
||||
{
|
||||
LL_ERRS() << "Error parsing skeleton file: " << skeleton_path << LL_ENDL;
|
||||
llerrs << "Error parsing skeleton file: " << skeleton_path << llendl;
|
||||
}
|
||||
|
||||
// Process XML data
|
||||
@@ -397,44 +381,44 @@ void LLAvatarAppearance::initClass()
|
||||
sAvatarSkeletonInfo = new LLAvatarSkeletonInfo;
|
||||
if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
|
||||
{
|
||||
LL_ERRS() << "Error parsing skeleton XML file: " << skeleton_path << LL_ENDL;
|
||||
llerrs << "Error parsing skeleton XML file: " << skeleton_path << llendl;
|
||||
}
|
||||
// parse avatar_lad.xml
|
||||
if (sAvatarXmlInfo)
|
||||
{ //this can happen if a login attempt failed
|
||||
delete_and_clear(sAvatarXmlInfo);
|
||||
deleteAndClear(sAvatarXmlInfo);
|
||||
}
|
||||
sAvatarXmlInfo = new LLAvatarXmlInfo;
|
||||
if (!sAvatarXmlInfo->parseXmlSkeletonNode(root))
|
||||
{
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlMeshNodes(root))
|
||||
{
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlColorNodes(root))
|
||||
{
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlLayerNodes(root))
|
||||
{
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlDriverNodes(root))
|
||||
{
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
}
|
||||
if (!sAvatarXmlInfo->parseXmlMorphNodes(root))
|
||||
{
|
||||
LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
|
||||
llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
void LLAvatarAppearance::cleanupClass()
|
||||
{
|
||||
delete_and_clear(sAvatarXmlInfo);
|
||||
delete_and_clear(sAvatarSkeletonInfo);
|
||||
deleteAndClear(sAvatarXmlInfo);
|
||||
deleteAndClear(sAvatarSkeletonInfo);
|
||||
sSkeletonXMLTree.cleanup();
|
||||
sXMLTree.cleanup();
|
||||
}
|
||||
@@ -502,6 +486,25 @@ void LLAvatarAppearance::computeBodySize()
|
||||
mAvatarOffset.mV[VX] = 0.0f;
|
||||
mAvatarOffset.mV[VY] = 0.0f;
|
||||
|
||||
// Certain configurations of avatars can force the overall height (with offset) to go negative.
|
||||
// Enforce a constraint to make sure we don't go below 0.1 meters.
|
||||
// Camera positioning and other things start to break down when your avatar is "walking" while being fully underground
|
||||
if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 0.1f)
|
||||
{
|
||||
mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 0.11f); // avoid floating point rounding making the above check continue to fail.
|
||||
|
||||
llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 0.1f);
|
||||
|
||||
if (mWearableData && isSelf())
|
||||
{
|
||||
LLWearable* shape = mWearableData->getWearable(LLWearableType::WT_SHAPE, 0);
|
||||
if (shape)
|
||||
{
|
||||
shape->setVisualParamWeight(AVATAR_HOVER, mAvatarOffset.mV[VZ], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (new_body_size != mBodySize || old_offset != mAvatarOffset)
|
||||
{
|
||||
mBodySize = new_body_size;
|
||||
@@ -521,7 +524,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
|
||||
|
||||
if (!parsesuccess)
|
||||
{
|
||||
LL_ERRS() << "Can't parse skeleton file: " << filename << LL_ENDL;
|
||||
llerrs << "Can't parse skeleton file: " << filename << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -529,13 +532,13 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
|
||||
LLXmlTreeNode* root = sSkeletonXMLTree.getRoot();
|
||||
if (!root)
|
||||
{
|
||||
LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
|
||||
llerrs << "No root node found in avatar skeleton file: " << filename << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( !root->hasName( "linden_skeleton" ) )
|
||||
{
|
||||
LL_ERRS() << "Invalid avatar skeleton file header: " << filename << LL_ENDL;
|
||||
llerrs << "Invalid avatar skeleton file header: " << filename << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -543,7 +546,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
|
||||
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
|
||||
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
|
||||
{
|
||||
LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL;
|
||||
llerrs << "Invalid avatar skeleton file version: " << version << " in file: " << filename << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -562,7 +565,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
||||
joint = getCharacterJoint(joint_num);
|
||||
if (!joint)
|
||||
{
|
||||
LL_WARNS() << "Too many bones" << LL_ENDL;
|
||||
llwarns << "Too many bones" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
joint->setName( info->mName );
|
||||
@@ -571,7 +574,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
||||
{
|
||||
if (volume_num >= (S32)mCollisionVolumes.size())
|
||||
{
|
||||
LL_WARNS() << "Too many bones" << LL_ENDL;
|
||||
llwarns << "Too many bones" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
joint = (mCollisionVolumes[volume_num]);
|
||||
@@ -589,6 +592,8 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
|
||||
info->mRot.mV[VZ], LLQuaternion::XYZ));
|
||||
joint->setScale(info->mScale);
|
||||
|
||||
joint->setDefaultFromCurrentXform();
|
||||
|
||||
if (info->mIsJoint)
|
||||
{
|
||||
joint->setSkinOffset( info->mPivot );
|
||||
@@ -647,7 +652,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||
//-------------------------------------------------------------------------
|
||||
if (!allocateCharacterJoints(info->mNumBones))
|
||||
{
|
||||
LL_ERRS() << "Can't allocate " << info->mNumBones << " joints" << LL_ENDL;
|
||||
llerrs << "Can't allocate " << info->mNumBones << " joints" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -658,7 +663,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||
{
|
||||
if (!allocateCollisionVolumes(info->mNumCollisionVolumes))
|
||||
{
|
||||
LL_ERRS() << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << LL_ENDL;
|
||||
llerrs << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -671,7 +676,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
|
||||
LLAvatarBoneInfo *info = *iter;
|
||||
if (!setupBone(info, NULL, current_volume_num, current_joint_num))
|
||||
{
|
||||
LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
||||
llerrs << "Error parsing bone in skeleton file" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -688,42 +693,6 @@ void LLAvatarAppearance::clearSkeleton()
|
||||
mSkeleton.clear();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// addPelvisFixup
|
||||
//------------------------------------------------------------------------
|
||||
void LLAvatarAppearance::addPelvisFixup( F32 fixup, const LLUUID& mesh_id )
|
||||
{
|
||||
LLVector3 pos(0.0,0.0,fixup);
|
||||
mPelvisFixups.add(mesh_id,pos);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// addPelvisFixup
|
||||
//------------------------------------------------------------------------
|
||||
void LLAvatarAppearance::removePelvisFixup( const LLUUID& mesh_id )
|
||||
{
|
||||
mPelvisFixups.remove(mesh_id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// hasPelvisFixup
|
||||
//------------------------------------------------------------------------
|
||||
bool LLAvatarAppearance::hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const
|
||||
{
|
||||
LLVector3 pos;
|
||||
if (mPelvisFixups.findActiveOverride(mesh_id,pos))
|
||||
{
|
||||
fixup = pos[2];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LLAvatarAppearance::hasPelvisFixup( F32& fixup ) const
|
||||
{
|
||||
LLUUID mesh_id;
|
||||
return hasPelvisFixup( fixup, mesh_id );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLAvatarAppearance::buildCharacter()
|
||||
// Deferred initialization and rebuild of the avatar.
|
||||
@@ -773,17 +742,17 @@ void LLAvatarAppearance::buildCharacter()
|
||||
}
|
||||
|
||||
// gPrintMessagesThisFrame = TRUE;
|
||||
LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL;
|
||||
lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl;
|
||||
|
||||
if (!status)
|
||||
{
|
||||
if (isSelf())
|
||||
{
|
||||
LL_ERRS() << "Unable to load user's avatar" << LL_ENDL;
|
||||
llerrs << "Unable to load user's avatar" << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Unable to load other's avatar" << LL_ENDL;
|
||||
llwarns << "Unable to load other's avatar" << llendl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -832,7 +801,7 @@ void LLAvatarAppearance::buildCharacter()
|
||||
mEyeLeftp &&
|
||||
mEyeRightp))
|
||||
{
|
||||
LL_ERRS() << "Failed to create avatar." << LL_ENDL;
|
||||
llerrs << "Failed to create avatar." << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -858,21 +827,21 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||
// avatar_skeleton.xml
|
||||
if( !buildSkeleton(sAvatarSkeletonInfo) )
|
||||
{
|
||||
LL_WARNS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: buildSkeleton() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <skeleton>
|
||||
if( !loadSkeletonNode() )
|
||||
{
|
||||
LL_WARNS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: loadNodeSkeleton() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <mesh>
|
||||
if( !loadMeshNodes() )
|
||||
{
|
||||
LL_WARNS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: loadNodeMesh() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -882,13 +851,13 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||
mTexSkinColor = new LLTexGlobalColor( this );
|
||||
if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
|
||||
{
|
||||
LL_WARNS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: mTexSkinColor->setInfo() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
|
||||
llwarns << "<global_color> name=\"skin_color\" not found" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
if( sAvatarXmlInfo->mTexHairColorInfo )
|
||||
@@ -896,13 +865,13 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||
mTexHairColor = new LLTexGlobalColor( this );
|
||||
if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
|
||||
{
|
||||
LL_WARNS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: mTexHairColor->setInfo() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
|
||||
llwarns << "<global_color> name=\"hair_color\" not found" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
if( sAvatarXmlInfo->mTexEyeColorInfo )
|
||||
@@ -910,26 +879,26 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||
mTexEyeColor = new LLTexGlobalColor( this );
|
||||
if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
|
||||
{
|
||||
LL_WARNS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: mTexEyeColor->setInfo() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
|
||||
llwarns << "<global_color> name=\"eye_color\" not found" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// avatar_lad.xml : <layer_set>
|
||||
if (sAvatarXmlInfo->mLayerInfoList.empty())
|
||||
{
|
||||
LL_WARNS() << "avatar file: missing <layer_set> node" << LL_ENDL;
|
||||
llwarns << "avatar file: missing <layer_set> node" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
|
||||
{
|
||||
LL_WARNS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
|
||||
llwarns << "avatar file: missing <morph_masks> node" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -971,14 +940,14 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||
LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam;
|
||||
if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false))
|
||||
{
|
||||
LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL;
|
||||
llwarns << "could not link driven params for avatar " << this->getFullname() << " param id: " << driver_param->getID() << llendl;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
delete driver_param;
|
||||
LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: driver_param->parseData() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1098,17 +1067,17 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Avatar file: <mesh> has invalid lod setting " << lod << LL_ENDL;
|
||||
llwarns << "Avatar file: <mesh> has invalid lod setting " << lod << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Ignoring unrecognized mesh type: " << type << LL_ENDL;
|
||||
llwarns << "Ignoring unrecognized mesh type: " << type << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// LL_INFOS() << "Parsing mesh data for " << type << "..." << LL_ENDL;
|
||||
// llinfos << "Parsing mesh data for " << type << "..." << llendl;
|
||||
|
||||
// If this isn't set to white (1.0), avatars will *ALWAYS* be darker than their surroundings.
|
||||
// Do not touch!!!
|
||||
@@ -1138,7 +1107,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||
|
||||
if( !poly_mesh )
|
||||
{
|
||||
LL_WARNS() << "Failed to load mesh of type " << type << LL_ENDL;
|
||||
llwarns << "Failed to load mesh of type " << type << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1198,7 +1167,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
||||
{
|
||||
stop_glerror();
|
||||
delete layer_set;
|
||||
LL_WARNS() << "avatar file: layer_set->setInfo() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: layer_set->setInfo() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1221,7 +1190,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
||||
// if no baked texture was found, warn and cleanup
|
||||
if (baked_index == BAKED_NUM_INDICES)
|
||||
{
|
||||
LL_WARNS() << "<layer_set> has invalid body_region attribute" << LL_ENDL;
|
||||
llwarns << "<layer_set> has invalid body_region attribute" << llendl;
|
||||
delete layer_set;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1239,7 +1208,7 @@ BOOL LLAvatarAppearance::loadLayersets()
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL;
|
||||
llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl;
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1385,7 +1354,7 @@ void LLAvatarAppearance::getMeshInfo (mesh_info_t* mesh_info)
|
||||
else
|
||||
{
|
||||
// Should never happen
|
||||
LL_WARNS() << "Duplicate mesh LOD " << type << " " << lod << " " << file << LL_ENDL;
|
||||
llwarns << "Duplicate mesh LOD " << type << " " << lod << " " << file << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1398,7 +1367,7 @@ BOOL LLAvatarAppearance::isValid() const
|
||||
// This should only be called on ourself.
|
||||
if (!isSelf())
|
||||
{
|
||||
LL_ERRS() << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << LL_ENDL;
|
||||
llerrs << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << llendl;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1491,7 +1460,7 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, bool upload_bake )
|
||||
void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL upload_bake )
|
||||
{
|
||||
U32 param_name[3];
|
||||
if( teToColorParams( te, param_name ) )
|
||||
@@ -1558,12 +1527,18 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
|
||||
return mBakedTextureDatas[baked_index].mTexLayerSet;
|
||||
}
|
||||
|
||||
void LLAvatarAppearance::clearCollisionVolumes()
|
||||
{
|
||||
std::for_each(mCollisionVolumes.begin(), mCollisionVolumes.end(),
|
||||
DeletePointer());
|
||||
mCollisionVolumes.clear();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// allocateCollisionVolumes()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
||||
{
|
||||
delete_and_clear(mCollisionVolumes);
|
||||
mCollisionVolumes.reserve(num);
|
||||
|
||||
LLAvatarJointCollisionVolume* cv;
|
||||
@@ -1576,7 +1551,7 @@ BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
|
||||
}
|
||||
else
|
||||
{
|
||||
delete_and_clear(mCollisionVolumes);
|
||||
clearCollisionVolumes();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1594,7 +1569,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!node->getFastAttributeString(name_string, mName))
|
||||
{
|
||||
LL_WARNS() << "Bone without name" << LL_ENDL;
|
||||
llwarns << "Bone without name" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1609,28 +1584,28 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Invalid node " << node->getName() << LL_ENDL;
|
||||
llwarns << "Invalid node " << node->getName() << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos");
|
||||
if (!node->getFastAttributeVector3(pos_string, mPos))
|
||||
{
|
||||
LL_WARNS() << "Bone without position" << LL_ENDL;
|
||||
llwarns << "Bone without position" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot");
|
||||
if (!node->getFastAttributeVector3(rot_string, mRot))
|
||||
{
|
||||
LL_WARNS() << "Bone without rotation" << LL_ENDL;
|
||||
llwarns << "Bone without rotation" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
|
||||
if (!node->getFastAttributeVector3(scale_string, mScale))
|
||||
{
|
||||
LL_WARNS() << "Bone without scale" << LL_ENDL;
|
||||
llwarns << "Bone without scale" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1639,7 +1614,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
|
||||
static LLStdStringHandle pivot_string = LLXmlTree::addAttributeString("pivot");
|
||||
if (!node->getFastAttributeVector3(pivot_string, mPivot))
|
||||
{
|
||||
LL_WARNS() << "Bone without pivot" << LL_ENDL;
|
||||
llwarns << "Bone without pivot" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1667,7 +1642,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
||||
static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
|
||||
if (!node->getFastAttributeS32(num_bones_string, mNumBones))
|
||||
{
|
||||
LL_WARNS() << "Couldn't find number of bones." << LL_ENDL;
|
||||
llwarns << "Couldn't find number of bones." << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1681,7 +1656,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
|
||||
if (!info->parseXml(child))
|
||||
{
|
||||
delete info;
|
||||
LL_WARNS() << "Error parsing bone in skeleton file" << LL_ENDL;
|
||||
llwarns << "Error parsing bone in skeleton file" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
mBoneInfoList.push_back(info);
|
||||
@@ -1698,7 +1673,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||
LLXmlTreeNode* node = root->getChildByName( "skeleton" );
|
||||
if( !node )
|
||||
{
|
||||
LL_WARNS() << "avatar file: missing <skeleton>" << LL_ENDL;
|
||||
llwarns << "avatar file: missing <skeleton>" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1713,11 +1688,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||
{
|
||||
if (child->getChildByName("param_morph"))
|
||||
{
|
||||
LL_WARNS() << "Can't specify morph param in skeleton definition." << LL_ENDL;
|
||||
llwarns << "Can't specify morph param in skeleton definition." << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
||||
llwarns << "Unknown param type." << llendl;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -1742,7 +1717,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!child->getFastAttributeString(name_string, info->mName))
|
||||
{
|
||||
LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
|
||||
llwarns << "No name supplied for attachment point." << llendl;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
@@ -1750,7 +1725,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
|
||||
if (!child->getFastAttributeString(joint_string, info->mJointName))
|
||||
{
|
||||
LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
|
||||
llwarns << "No bone declared in attachment point " << info->mName << llendl;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
@@ -1776,7 +1751,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
|
||||
static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
|
||||
if (!child->getFastAttributeS32(id_string, info->mAttachmentID))
|
||||
{
|
||||
LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
|
||||
llwarns << "No id supplied for attachment point " << info->mName << llendl;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
@@ -1811,7 +1786,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||
static LLStdStringHandle type_string = LLXmlTree::addAttributeString("type");
|
||||
if( !node->getFastAttributeString( type_string, info->mType ) )
|
||||
{
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << LL_ENDL;
|
||||
llwarns << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << llendl;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
}
|
||||
@@ -1819,7 +1794,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||
static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod");
|
||||
if (!node->getFastAttributeS32( lod_string, info->mLOD ))
|
||||
{
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << LL_ENDL;
|
||||
llwarns << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << llendl;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
}
|
||||
@@ -1827,7 +1802,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
|
||||
if( !node->getFastAttributeString( file_name_string, info->mMeshFileName ) )
|
||||
{
|
||||
LL_WARNS() << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << LL_ENDL;
|
||||
llwarns << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << llendl;
|
||||
delete info;
|
||||
return FALSE; // Ignore this element
|
||||
}
|
||||
@@ -1858,11 +1833,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
|
||||
{
|
||||
if (child->getChildByName("param_skeleton"))
|
||||
{
|
||||
LL_WARNS() << "Can't specify skeleton param in a mesh definition." << LL_ENDL;
|
||||
llwarns << "Can't specify skeleton param in a mesh definition." << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Unknown param type." << LL_ENDL;
|
||||
llwarns << "Unknown param type." << llendl;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -1903,14 +1878,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
||||
{
|
||||
if (mTexSkinColorInfo)
|
||||
{
|
||||
LL_WARNS() << "avatar file: multiple instances of skin_color" << LL_ENDL;
|
||||
llwarns << "avatar file: multiple instances of skin_color" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
mTexSkinColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexSkinColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
delete_and_clear(mTexSkinColorInfo);
|
||||
LL_WARNS() << "avatar file: mTexSkinColor->parseXml() failed" << LL_ENDL;
|
||||
deleteAndClear(mTexSkinColorInfo);
|
||||
llwarns << "avatar file: mTexSkinColor->parseXml() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1918,14 +1893,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
||||
{
|
||||
if (mTexHairColorInfo)
|
||||
{
|
||||
LL_WARNS() << "avatar file: multiple instances of hair_color" << LL_ENDL;
|
||||
llwarns << "avatar file: multiple instances of hair_color" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
mTexHairColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexHairColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
delete_and_clear(mTexHairColorInfo);
|
||||
LL_WARNS() << "avatar file: mTexHairColor->parseXml() failed" << LL_ENDL;
|
||||
deleteAndClear(mTexHairColorInfo);
|
||||
llwarns << "avatar file: mTexHairColor->parseXml() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1933,13 +1908,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
|
||||
{
|
||||
if (mTexEyeColorInfo)
|
||||
{
|
||||
LL_WARNS() << "avatar file: multiple instances of eye_color" << LL_ENDL;
|
||||
llwarns << "avatar file: multiple instances of eye_color" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
mTexEyeColorInfo = new LLTexGlobalColorInfo;
|
||||
if( !mTexEyeColorInfo->parseXml( color_node ) )
|
||||
{
|
||||
LL_WARNS() << "avatar file: mTexEyeColor->parseXml() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: mTexEyeColor->parseXml() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1965,7 +1940,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root
|
||||
else
|
||||
{
|
||||
delete layer_info;
|
||||
LL_WARNS() << "avatar file: layer_set->parseXml() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: layer_set->parseXml() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1994,7 +1969,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* roo
|
||||
else
|
||||
{
|
||||
delete driver_info;
|
||||
LL_WARNS() << "avatar file: driver_param->parseXml() failed" << LL_ENDL;
|
||||
llwarns << "avatar file: driver_param->parseXml() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -2023,7 +1998,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("morph_name");
|
||||
if (!grand_child->getFastAttributeString(name_string, info->mName))
|
||||
{
|
||||
LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
|
||||
llwarns << "No name supplied for morph mask." << llendl;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
@@ -2031,7 +2006,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
||||
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
|
||||
if (!grand_child->getFastAttributeString(region_string, info->mRegion))
|
||||
{
|
||||
LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
|
||||
llwarns << "No region supplied for morph mask." << llendl;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
@@ -2039,7 +2014,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
|
||||
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
|
||||
if (!grand_child->getFastAttributeString(layer_string, info->mLayer))
|
||||
{
|
||||
LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
|
||||
llwarns << "No layer supplied for morph mask." << llendl;
|
||||
delete info;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -159,17 +159,11 @@ protected:
|
||||
BOOL mIsBuilt; // state of deferred character building
|
||||
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
|
||||
avatar_joint_list_t mSkeleton;
|
||||
LLPosOverrideMap mPelvisFixups;
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Pelvis height adjustment members.
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void addPelvisFixup( F32 fixup, const LLUUID& mesh_id );
|
||||
void removePelvisFixup( const LLUUID& mesh_id );
|
||||
bool hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const;
|
||||
bool hasPelvisFixup( F32& fixup ) const;
|
||||
|
||||
LLVector3 mBodySize;
|
||||
LLVector3 mAvatarOffset;
|
||||
protected:
|
||||
@@ -268,7 +262,7 @@ protected:
|
||||
// Clothing colors (convenience functions to access visual parameters)
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, bool upload_bake = false);
|
||||
void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
|
||||
LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te);
|
||||
static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name);
|
||||
|
||||
@@ -277,7 +271,7 @@ public:
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
LLColor4 getGlobalColor(const std::string& color_name ) const;
|
||||
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake = false) = 0;
|
||||
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0;
|
||||
protected:
|
||||
LLTexGlobalColor* mTexSkinColor;
|
||||
LLTexGlobalColor* mTexHairColor;
|
||||
@@ -345,6 +339,7 @@ protected:
|
||||
public:
|
||||
std::vector<LLAvatarJointCollisionVolume*> mCollisionVolumes;
|
||||
protected:
|
||||
void clearCollisionVolumes();
|
||||
BOOL allocateCollisionVolumes(U32 num);
|
||||
|
||||
/** Physics
|
||||
|
||||
@@ -212,7 +212,6 @@ LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index,
|
||||
LLWearableType::EType t = (LLWearableType::EType)va_arg(argp,int);
|
||||
mWearables.push_back(t);
|
||||
}
|
||||
va_end(argp);
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -249,7 +249,7 @@ LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume()
|
||||
/*virtual*/
|
||||
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
|
||||
{
|
||||
LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
|
||||
llerrs << "Cannot call render() on LLAvatarJointCollisionVolume" << llendl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,18 +85,17 @@ LLSkinJoint::~LLSkinJoint()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLSkinJoint::setupSkinJoint( LLJoint *joint)
|
||||
{
|
||||
mRootToJointSkinOffset.clearVec();
|
||||
mRootToParentJointSkinOffset.clearVec();
|
||||
|
||||
// find the named joint
|
||||
if (!(mJoint = joint))
|
||||
{
|
||||
LL_INFOS() << "Can't find joint" << LL_ENDL;
|
||||
llinfos << "Can't find joint" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
// compute the inverse root skin matrix
|
||||
mRootToJointSkinOffset.clearVec();
|
||||
mRootToParentJointSkinOffset.clearVec();
|
||||
|
||||
do
|
||||
{
|
||||
mRootToJointSkinOffset -= joint->getSkinOffset();
|
||||
@@ -305,7 +304,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
||||
U32 jn;
|
||||
for (jn = 0; jn < numJointNames; jn++)
|
||||
{
|
||||
//LL_INFOS() << "Setting up joint " << jointNames[jn] << LL_ENDL;
|
||||
//llinfos << "Setting up joint " << jointNames[jn] << llendl;
|
||||
mSkinJoints[jn].setupSkinJoint( getRoot()->findJoint(jointNames[jn]) );
|
||||
}
|
||||
}
|
||||
@@ -316,7 +315,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
||||
setupJoint(getRoot());
|
||||
}
|
||||
|
||||
LL_DEBUGS() << "joint render entries: " << mMesh->mJointRenderData.size() << LL_ENDL;
|
||||
// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -324,7 +323,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLAvatarJointMesh::setupJoint(LLJoint* current_joint)
|
||||
{
|
||||
// LL_INFOS() << "Mesh: " << getName() << LL_ENDL;
|
||||
// llinfos << "Mesh: " << getName() << llendl;
|
||||
|
||||
// S32 joint_count = 0;
|
||||
U32 sj;
|
||||
@@ -340,22 +339,22 @@ void LLAvatarJointMesh::setupJoint(LLJoint* current_joint)
|
||||
// we've found a skinjoint for this joint..
|
||||
|
||||
// is the last joint in the array our parent?
|
||||
if(mMesh->mJointRenderData.size() && mMesh->mJointRenderData[mMesh->mJointRenderData.size() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix())
|
||||
if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == ¤t_joint->getParent()->getWorldMatrix())
|
||||
{
|
||||
// ...then just add ourselves
|
||||
LLJoint* jointp = js.mJoint;
|
||||
mMesh->mJointRenderData.push_back(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
|
||||
// LL_INFOS() << "joint " << joint_count << js.mJoint->getName() << LL_ENDL;
|
||||
mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
|
||||
// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl;
|
||||
// joint_count++;
|
||||
}
|
||||
// otherwise add our parent and ourselves
|
||||
else
|
||||
{
|
||||
mMesh->mJointRenderData.push_back(new LLJointRenderData(¤t_joint->getParent()->getWorldMatrix(), NULL));
|
||||
// LL_INFOS() << "joint " << joint_count << current_joint->getParent()->getName() << LL_ENDL;
|
||||
mMesh->mJointRenderData.put(new LLJointRenderData(¤t_joint->getParent()->getWorldMatrix(), NULL));
|
||||
// llinfos << "joint " << joint_count << current_joint->getParent()->getName() << llendl;
|
||||
// joint_count++;
|
||||
mMesh->mJointRenderData.push_back(new LLJointRenderData(¤t_joint->getWorldMatrix(), &js));
|
||||
// LL_INFOS() << "joint " << joint_count << current_joint->getName() << LL_ENDL;
|
||||
mMesh->mJointRenderData.put(new LLJointRenderData(¤t_joint->getWorldMatrix(), &js));
|
||||
// llinfos << "joint " << joint_count << current_joint->getName() << llendl;
|
||||
// joint_count++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "<driven> Unable to resolve driven parameter: " << driven_id << LL_ENDL;
|
||||
llerrs << "<driven> Unable to resolve driven parameter: " << driven_id << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -139,9 +139,9 @@ void LLDriverParamInfo::toStream(std::ostream &out)
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "could not get parameter " << driven.mDrivenID << " from avatar "
|
||||
llwarns << "could not get parameter " << driven.mDrivenID << " from avatar "
|
||||
<< mDriverParam->getAvatarAppearance()
|
||||
<< " for driver parameter " << getID() << LL_ENDL;
|
||||
<< " for driver parameter " << getID() << llendl;
|
||||
}
|
||||
out << std::endl;
|
||||
}
|
||||
@@ -152,31 +152,19 @@ void LLDriverParamInfo::toStream(std::ostream &out)
|
||||
// LLDriverParam
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */)
|
||||
: LLViewerVisualParam(),
|
||||
mDefaultVec(),
|
||||
mDriven(),
|
||||
LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */) :
|
||||
mCurrentDistortionParam( NULL ),
|
||||
mAvatarAppearance(appearance),
|
||||
mWearablep(wearable)
|
||||
{
|
||||
llassert(mAvatarAppearance);
|
||||
llassert((mWearablep == NULL) || mAvatarAppearance->isSelf());
|
||||
if (mWearablep)
|
||||
{
|
||||
llassert(mAvatarAppearance->isSelf());
|
||||
}
|
||||
mDefaultVec.clear();
|
||||
}
|
||||
|
||||
LLDriverParam::LLDriverParam(const LLDriverParam& pOther)
|
||||
: LLViewerVisualParam(pOther),
|
||||
mDefaultVec(pOther.mDefaultVec),
|
||||
mDriven(pOther.mDriven),
|
||||
mCurrentDistortionParam(pOther.mCurrentDistortionParam),
|
||||
mAvatarAppearance(pOther.mAvatarAppearance),
|
||||
mWearablep(pOther.mWearablep)
|
||||
{
|
||||
llassert(mAvatarAppearance);
|
||||
llassert((mWearablep == NULL) || mAvatarAppearance->isSelf());
|
||||
}
|
||||
|
||||
LLDriverParam::~LLDriverParam()
|
||||
{
|
||||
}
|
||||
@@ -190,7 +178,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
|
||||
mID = info->mID;
|
||||
info->mDriverParam = this;
|
||||
|
||||
setWeight(getDefaultWeight());
|
||||
setWeight(getDefaultWeight(), FALSE );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -198,10 +186,31 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
|
||||
/*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const
|
||||
{
|
||||
llassert(wearable);
|
||||
return new LLDriverParam(*this);
|
||||
LLDriverParam *new_param = new LLDriverParam(mAvatarAppearance, wearable);
|
||||
// FIXME DRANO this clobbers mWearablep, which means any code
|
||||
// currently using mWearablep is wrong, or at least untested.
|
||||
*new_param = *this;
|
||||
//new_param->mWearablep = wearable;
|
||||
// new_param->mDriven.clear(); // clear driven list to avoid overwriting avatar driven params from wearables.
|
||||
return new_param;
|
||||
}
|
||||
|
||||
void LLDriverParam::setWeight(F32 weight, bool upload_bake)
|
||||
#if 0 // obsolete
|
||||
BOOL LLDriverParam::parseData(LLXmlTreeNode* node)
|
||||
{
|
||||
LLDriverParamInfo* info = new LLDriverParamInfo;
|
||||
|
||||
info->parseXml(node);
|
||||
if (!setInfo(info))
|
||||
{
|
||||
delete info;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void LLDriverParam::setWeight(F32 weight, BOOL upload_bake)
|
||||
{
|
||||
F32 min_weight = getMinWeight();
|
||||
F32 max_weight = getMaxWeight();
|
||||
@@ -436,7 +445,7 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
|
||||
//-----------------------------------------------------------------------------
|
||||
// setAnimationTarget()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLDriverParam::setAnimationTarget( F32 target_value, bool upload_bake )
|
||||
void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake )
|
||||
{
|
||||
LLVisualParam::setAnimationTarget(target_value, upload_bake);
|
||||
|
||||
@@ -454,7 +463,7 @@ void LLDriverParam::setAnimationTarget( F32 target_value, bool upload_bake )
|
||||
//-----------------------------------------------------------------------------
|
||||
// stopAnimating()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLDriverParam::stopAnimating(bool upload_bake)
|
||||
void LLDriverParam::stopAnimating(BOOL upload_bake)
|
||||
{
|
||||
LLVisualParam::stopAnimating(upload_bake);
|
||||
|
||||
@@ -536,7 +545,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type)
|
||||
LLWearable *wearable = mAvatarAppearance->getWearableData()->getTopWearable(driver_type);
|
||||
if (wearable)
|
||||
{
|
||||
wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID));
|
||||
wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,9 +112,9 @@ public:
|
||||
// LLVisualParam Virtual functions
|
||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||
/*virtual*/ void apply( ESex sex ) {} // apply is called separately for each driven param.
|
||||
/*virtual*/ void setWeight(F32 weight, bool upload_bake = false);
|
||||
/*virtual*/ void setAnimationTarget( F32 target_value, bool upload_bake = false);
|
||||
/*virtual*/ void stopAnimating(bool upload_bake = false);
|
||||
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
||||
/*virtual*/ void setAnimationTarget( F32 target_value, BOOL upload_bake );
|
||||
/*virtual*/ void stopAnimating(BOOL upload_bake);
|
||||
/*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
|
||||
/*virtual*/ void resetDrivenParams();
|
||||
/*virtual*/ char const* getTypeString(void) const { return "param_driver"; }
|
||||
@@ -131,9 +131,8 @@ public:
|
||||
const LLViewerVisualParam* getDrivenParam(S32 index) const;
|
||||
|
||||
protected:
|
||||
LLDriverParam(const LLDriverParam& pOther);
|
||||
F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight);
|
||||
void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake = false);
|
||||
void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake);
|
||||
|
||||
|
||||
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder
|
||||
|
||||
@@ -64,7 +64,7 @@ LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject& lto) :
|
||||
LLTexLayer* original_layer = lto.getTexLayer(index);
|
||||
if (!original_layer)
|
||||
{
|
||||
LL_ERRS() << "could not clone Local Texture Object: unable to extract texlayer!" << LL_ENDL;
|
||||
llerrs << "could not clone Local Texture Object: unable to extract texlayer!" << llendl;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,8 +161,8 @@ void LLPolyMeshSharedData::freeMeshData()
|
||||
// mVertFaceMap.deleteAllData();
|
||||
}
|
||||
|
||||
// compare_int is used by the qsort function to sort the index array
|
||||
S32 compare_int(const void *a, const void *b);
|
||||
// compate_int is used by the qsort function to sort the index array
|
||||
int compare_int(const void *a, const void *b);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// genIndices()
|
||||
@@ -277,13 +277,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
//-------------------------------------------------------------------------
|
||||
if(fileName.empty())
|
||||
{
|
||||
LL_ERRS() << "Filename is Empty!" << LL_ENDL;
|
||||
llerrs << "Filename is Empty!" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
|
||||
if (!fp)
|
||||
{
|
||||
LL_ERRS() << "can't open: " << fileName << LL_ENDL;
|
||||
llerrs << "can't open: " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
char header[128]; /*Flawfinder: ignore*/
|
||||
if (fread(header, sizeof(char), 128, fp) != 128)
|
||||
{
|
||||
LL_WARNS() << "Short read" << LL_ENDL;
|
||||
llwarns << "Short read" << llendl;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -302,7 +302,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
BOOL status = FALSE;
|
||||
if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/
|
||||
{
|
||||
LL_DEBUGS() << "Loading " << fileName << LL_ENDL;
|
||||
lldebugs << "Loading " << fileName << llendl;
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// File Header (seek past it)
|
||||
@@ -316,7 +316,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
size_t numRead = fread(&hasWeights, sizeof(U8), 1, fp);
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read HasWeights flag from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read HasWeights flag from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
if (!isLOD())
|
||||
@@ -331,7 +331,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
numRead = fread(&hasDetailTexCoords, sizeof(U8), 1, fp);
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read HasDetailTexCoords flag from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(position.mV, sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read Position from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read Position from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
setPosition( position );
|
||||
@@ -356,7 +356,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(rotationAngles.mV, sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read RotationAngles from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read RotationAngles from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read RotationOrder from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read RotationOrder from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(scale.mV, sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read Scale from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read Scale from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
setScale( scale );
|
||||
@@ -405,7 +405,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(&numVertices, sizeof(U16), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read NumVertices from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read NumVertices from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(&mBaseCoords[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read Coordinates from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read Coordinates from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -434,7 +434,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(&mBaseNormals[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << " can't read Normals from " << fileName << LL_ENDL;
|
||||
llerrs << " can't read Normals from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -448,7 +448,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(&mBaseBinormals[i], sizeof(float), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << " can't read Binormals from " << fileName << LL_ENDL;
|
||||
llerrs << " can't read Binormals from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -460,7 +460,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(mTexCoords, sizeof(float), 2*numVertices);
|
||||
if (numRead != numVertices)
|
||||
{
|
||||
LL_ERRS() << "can't read TexCoords from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read TexCoords from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(mDetailTexCoords, sizeof(float), 2*numVertices);
|
||||
if (numRead != numVertices)
|
||||
{
|
||||
LL_ERRS() << "can't read DetailTexCoords from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read DetailTexCoords from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -487,7 +487,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(mWeights, sizeof(float), numVertices);
|
||||
if (numRead != numVertices)
|
||||
{
|
||||
LL_ERRS() << "can't read Weights from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read Weights from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -501,7 +501,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(&numFaces, sizeof(U16), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read NumFaces from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read NumFaces from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
allocateFaceData( numFaces );
|
||||
@@ -519,7 +519,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(face, sizeof(U16), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_ERRS() << "can't read Face[" << i << "] from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read Face[" << i << "] from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
if (mReferenceData)
|
||||
@@ -547,22 +547,22 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
// S32 j;
|
||||
// for(j = 0; j < 3; j++)
|
||||
// {
|
||||
// std::vector<S32> *face_list = mVertFaceMap.getIfThere(face[j]);
|
||||
// LLDynamicArray<S32> *face_list = mVertFaceMap.getIfThere(face[j]);
|
||||
// if (!face_list)
|
||||
// {
|
||||
// face_list = new std::vector<S32>;
|
||||
// face_list = new LLDynamicArray<S32>;
|
||||
// mVertFaceMap.addData(face[j], face_list);
|
||||
// }
|
||||
// face_list->push_back(i);
|
||||
// face_list->put(i);
|
||||
// }
|
||||
|
||||
numTris++;
|
||||
}
|
||||
|
||||
LL_DEBUGS() << "verts: " << numVertices
|
||||
lldebugs << "verts: " << numVertices
|
||||
<< ", faces: " << numFaces
|
||||
<< ", tris: " << numTris
|
||||
<< LL_ENDL;
|
||||
<< llendl;
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// NumSkinJoints
|
||||
@@ -576,7 +576,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
llendianswizzle(&numSkinJoints, sizeof(U16), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read NumSkinJoints from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read NumSkinJoints from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
allocateJointNames( numSkinJoints );
|
||||
@@ -592,7 +592,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
jointName[sizeof(jointName)-1] = '\0'; // ensure nul-termination
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read Skin[" << i << "].Name from " << fileName << LL_ENDL;
|
||||
llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -687,12 +687,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
S32 remapDst;
|
||||
if (fread(&remapSrc, sizeof(S32), 1, fp) != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read source vertex in vertex remap data" << LL_ENDL;
|
||||
llerrs << "can't read source vertex in vertex remap data" << llendl;
|
||||
break;
|
||||
}
|
||||
if (fread(&remapDst, sizeof(S32), 1, fp) != 1)
|
||||
{
|
||||
LL_ERRS() << "can't read destination vertex in vertex remap data" << LL_ENDL;
|
||||
llerrs << "can't read destination vertex in vertex remap data" << llendl;
|
||||
break;
|
||||
}
|
||||
llendianswizzle(&remapSrc, sizeof(S32), 1);
|
||||
@@ -707,7 +707,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL;
|
||||
llerrs << "invalid mesh file header: " << fileName << llendl;
|
||||
status = FALSE;
|
||||
}
|
||||
|
||||
@@ -808,8 +808,15 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolyMesh::~LLPolyMesh()
|
||||
{
|
||||
delete_and_clear(mJointRenderData);
|
||||
ll_aligned_free_16(mVertexData);
|
||||
S32 i;
|
||||
for (i = 0; i < mJointRenderData.count(); i++)
|
||||
{
|
||||
delete mJointRenderData[i];
|
||||
mJointRenderData[i] = NULL;
|
||||
}
|
||||
|
||||
ll_aligned_free_16(mVertexData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -824,7 +831,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m
|
||||
LLPolyMeshSharedData* meshSharedData = get_if_there(sGlobalSharedMeshList, name, (LLPolyMeshSharedData*)NULL);
|
||||
if (meshSharedData)
|
||||
{
|
||||
// LL_INFOS() << "Polymesh " << name << " found in global mesh table." << LL_ENDL;
|
||||
// llinfos << "Polymesh " << name << " found in global mesh table." << llendl;
|
||||
LLPolyMesh *poly_mesh = new LLPolyMesh(meshSharedData, reference_mesh);
|
||||
return poly_mesh;
|
||||
}
|
||||
@@ -848,7 +855,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m
|
||||
|
||||
LLPolyMesh *poly_mesh = new LLPolyMesh(mesh_data, reference_mesh);
|
||||
|
||||
// LL_INFOS() << "Polymesh " << name << " added to global mesh table." << LL_ENDL;
|
||||
// llinfos << "Polymesh " << name << " added to global mesh table." << llendl;
|
||||
sGlobalSharedMeshList[name] = poly_mesh->mSharedData;
|
||||
|
||||
return poly_mesh;
|
||||
@@ -880,7 +887,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
//-------------------------------------------------------------------------
|
||||
if (fwrite(HEADER_BINARY, 1, strlen(HEADER_BINARY), fp) != strlen(HEADER_BINARY))
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
if (strlen(HEADER_BINARY) < 24)
|
||||
@@ -889,7 +896,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
int pad = 24 - strlen(HEADER_BINARY);
|
||||
if (fwrite(&padding, 1, pad, fp) != pad)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -899,7 +906,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
U8 hasWeights = (U8) mSharedData->mHasWeights;
|
||||
if (fwrite(&hasWeights, sizeof(U8), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
@@ -908,7 +915,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
U8 hasDetailTexCoords = (U8) mSharedData->mHasDetailTexCoords;
|
||||
if (fwrite(&hasDetailTexCoords, sizeof(U8), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
@@ -918,7 +925,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(position.mV, sizeof(float), 3);
|
||||
if (fwrite(position.mV, sizeof(float), 3, fp) != 3)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
@@ -939,13 +946,13 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(rotationAngles.mV, sizeof(float), 3);
|
||||
if (fwrite(rotationAngles.mV, sizeof(float), 3, fp) != 3)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
U8 rotationOrder = 0;
|
||||
if (fwrite(&rotationOrder, sizeof(U8), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
@@ -955,7 +962,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(scale.mV, sizeof(float), 3);
|
||||
if (fwrite(scale.mV, sizeof(float), 3, fp) != 3)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
@@ -968,7 +975,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(&numVertices, sizeof(U16), 1);
|
||||
if (fwrite(&numVertices, sizeof(U16), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
numVertices = mSharedData->mNumVertices; // without the swizzle again
|
||||
|
||||
@@ -982,7 +989,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(coords.getF32ptr(), sizeof(float), 3);
|
||||
if (fwrite(coords.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(coords.getF32ptr(), sizeof(float), 3);
|
||||
}
|
||||
@@ -997,7 +1004,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(normals.getF32ptr(), sizeof(float), 3);
|
||||
if (fwrite(normals.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(normals.getF32ptr(), sizeof(float), 3);
|
||||
}
|
||||
@@ -1012,7 +1019,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(binormals.getF32ptr(), sizeof(float), 3);
|
||||
if (fwrite(binormals.getF32ptr(), 3*sizeof(float), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(binormals.getF32ptr(), sizeof(float), 3);
|
||||
}
|
||||
@@ -1025,7 +1032,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(tex, sizeof(float), 2*numVertices);
|
||||
if (fwrite(tex, 2*sizeof(float), numVertices, fp) != numVertices)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(tex, sizeof(float), 2*numVertices);
|
||||
|
||||
@@ -1039,7 +1046,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(detail, sizeof(float), 2*numVertices);
|
||||
if (fwrite(detail, 2*sizeof(float), numVertices, fp) != numVertices)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(detail, sizeof(float), 2*numVertices);
|
||||
}
|
||||
@@ -1054,7 +1061,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(weights, sizeof(float), numVertices);
|
||||
if (fwrite(weights, sizeof(float), numVertices, fp) != numVertices)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(weights, sizeof(float), numVertices);
|
||||
}
|
||||
@@ -1068,7 +1075,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(&numFaces, sizeof(U16), 1);
|
||||
if (fwrite(&numFaces, sizeof(U16), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
numFaces = mSharedData->mNumFaces; // without the swizzle again
|
||||
|
||||
@@ -1087,7 +1094,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(face, sizeof(U16), 3);
|
||||
if (fwrite(face, sizeof(U16), 3, fp) != 3)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1114,7 +1121,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(&numSkinJoints, sizeof(U16), 1);
|
||||
if (fwrite(&numSkinJoints, sizeof(U16), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(&numSkinJoints, sizeof(U16), 1);
|
||||
|
||||
@@ -1127,7 +1134,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
jn = &mSharedData->mJointNames[i];
|
||||
if (fwrite(jn->c_str(), 1, jn->length(), fp) != jn->length())
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
if (jn->length() < 64)
|
||||
@@ -1135,7 +1142,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
int pad = 64 - jn->length();
|
||||
if (fwrite(&padding, 1, pad, fp) != pad)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1166,7 +1173,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
|
||||
if (fwrite(morph_name.c_str(), 1, morph_name.length(), fp) != morph_name.length())
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
if (morph_name.length() < 64)
|
||||
@@ -1174,20 +1181,20 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
int pad = 64 - morph_name.length();
|
||||
if (fwrite(&padding, 1, pad, fp) != pad)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
if (!morph_data->saveLLM(fp))
|
||||
{
|
||||
LL_WARNS() << "Problem writing morph" << LL_ENDL;
|
||||
llwarns << "Problem writing morph" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
char end_morphs[64] = "End Morphs"; // padded with zeroes
|
||||
if (fwrite(end_morphs, sizeof(char), 64, fp) != 64)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -1197,7 +1204,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(&numRemaps, sizeof(S32), 1);
|
||||
if (fwrite(&numRemaps, sizeof(S32), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
std::map<S32, S32>::iterator remap_iter = mSharedData->mSharedVerts.begin();
|
||||
@@ -1210,7 +1217,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(&remapSrc, sizeof(S32), 1);
|
||||
if (fwrite(&remapSrc, sizeof(S32), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
|
||||
S32 remapDst = remap_iter->second;
|
||||
@@ -1218,7 +1225,7 @@ BOOL LLPolyMesh::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(&remapDst, sizeof(S32), 1);
|
||||
if (fwrite(&remapDst, sizeof(S32), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1250,7 +1257,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
|
||||
coords[i].getF32ptr()[2]);
|
||||
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1262,7 +1269,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
|
||||
normals[i].getF32ptr()[2]);
|
||||
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1273,7 +1280,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
|
||||
tex[i][1]);
|
||||
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1288,7 +1295,7 @@ BOOL LLPolyMesh::saveOBJ(LLFILE *fp)
|
||||
f3, f3, f3);
|
||||
if (fwrite(outstring.c_str(), 1, outstring.length(), fp) != outstring.length())
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1397,12 +1404,12 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
|
||||
values = sscanf (buffer," %255s %f %f %f", keyword, &tempX, &tempY, &tempZ);
|
||||
if (values != 4)
|
||||
{
|
||||
LL_WARNS() << "Expecting v x y z, but found: " << buffer <<LL_ENDL;
|
||||
llwarns << "Expecting v x y z, but found: " << buffer <<llendl;
|
||||
continue;
|
||||
}
|
||||
if (ncoords == nverts)
|
||||
{
|
||||
LL_WARNS() << "Too many vertices. Ignoring from: " << buffer <<LL_ENDL;
|
||||
llwarns << "Too many vertices. Ignoring from: " << buffer <<llendl;
|
||||
}
|
||||
if (ncoords < nverts)
|
||||
{
|
||||
@@ -1415,12 +1422,12 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
|
||||
values = sscanf (buffer," %255s %f %f %f", keyword, &tempX, &tempY, &tempZ);
|
||||
if (values != 4)
|
||||
{
|
||||
LL_WARNS() << "Expecting vn x y z, but found: " << buffer <<LL_ENDL;
|
||||
llwarns << "Expecting vn x y z, but found: " << buffer <<llendl;
|
||||
continue;
|
||||
}
|
||||
if (nnormals == nverts)
|
||||
{
|
||||
LL_WARNS() << "Too many normals. Ignoring from: " << buffer <<LL_ENDL;
|
||||
llwarns << "Too many normals. Ignoring from: " << buffer <<llendl;
|
||||
}
|
||||
if (nnormals < nverts)
|
||||
{
|
||||
@@ -1433,12 +1440,12 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
|
||||
values = sscanf (buffer," %255s %f %f", keyword, &tempX, &tempY);
|
||||
if (values != 3)
|
||||
{
|
||||
LL_WARNS() << "Expecting vt x y, but found: " << buffer <<LL_ENDL;
|
||||
llwarns << "Expecting vt x y, but found: " << buffer <<llendl;
|
||||
continue;
|
||||
}
|
||||
if (ntexcoords == nverts)
|
||||
{
|
||||
LL_WARNS() << "Too many texture vertices. Ignoring from: " << buffer <<LL_ENDL;
|
||||
llwarns << "Too many texture vertices. Ignoring from: " << buffer <<llendl;
|
||||
}
|
||||
if (ntexcoords < nverts)
|
||||
{
|
||||
@@ -1450,13 +1457,13 @@ BOOL LLPolyMesh::loadOBJ(LLFILE *fp)
|
||||
{
|
||||
if (nfaces == 0)
|
||||
{
|
||||
LL_WARNS() << "Ignoring face keywords for now." <<LL_ENDL;
|
||||
llwarns << "Ignoring face keywords for now." <<llendl;
|
||||
}
|
||||
nfaces++;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS() << "Unrecognized keyword. Ignoring: " << buffer << LL_ENDL;
|
||||
llinfos << "Unrecognized keyword. Ignoring: " << buffer << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1618,10 +1625,10 @@ void LLPolyMesh::dumpDiagInfo(void*)
|
||||
|
||||
std::string buf;
|
||||
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
LL_INFOS() << " Global PolyMesh Table (DEBUG only)" << LL_ENDL;
|
||||
LL_INFOS() << " Verts Faces Mem(KB) Name" << LL_ENDL;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
llinfos << " Global PolyMesh Table (DEBUG only)" << llendl;
|
||||
llinfos << " Verts Faces Mem(KB) Type Name" << llendl;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
|
||||
// print each loaded mesh, and it's memory usage
|
||||
for(LLPolyMeshSharedDataTable::iterator iter = sGlobalSharedMeshList.begin();
|
||||
@@ -1642,17 +1649,17 @@ void LLPolyMesh::dumpDiagInfo(void*)
|
||||
}
|
||||
|
||||
buf = llformat("%8d %8d %8d %s %s", num_verts, num_faces, num_kb, type.c_str(), mesh_name.c_str());
|
||||
LL_INFOS() << buf << LL_ENDL;
|
||||
llinfos << buf << llendl;
|
||||
|
||||
total_verts += num_verts;
|
||||
total_faces += num_faces;
|
||||
total_kb += num_kb;
|
||||
}
|
||||
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
buf = llformat("%8d %8d %8d TOTAL", total_verts, total_faces, total_kb );
|
||||
LL_INFOS() << buf << LL_ENDL;
|
||||
LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
|
||||
llinfos << buf << llendl;
|
||||
llinfos << "-----------------------------------------------------" << llendl;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "llquaternion.h"
|
||||
#include "llpolymorph.h"
|
||||
#include "lljoint.h"
|
||||
//#include "lldarray.h"
|
||||
|
||||
class LLSkinJoint;
|
||||
class LLAvatarAppearance;
|
||||
@@ -342,7 +343,7 @@ public:
|
||||
void setAvatar(LLAvatarAppearance* avatarp) { mAvatarp = avatarp; }
|
||||
LLAvatarAppearance* getAvatar() { return mAvatarp; }
|
||||
|
||||
std::vector<LLJointRenderData*> mJointRenderData;
|
||||
LLDynamicArray<LLJointRenderData*> mJointRenderData;
|
||||
|
||||
U32 mFaceVertexOffset;
|
||||
U32 mFaceVertexCount;
|
||||
|
||||
@@ -115,7 +115,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
llendianswizzle(&numVertices, sizeof(S32), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL;
|
||||
llwarns << "Can't read number of morph target vertices" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -152,13 +152,13 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
|
||||
if (numRead != 1)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL;
|
||||
llwarns << "Can't read morph target vertex number" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mVertexIndices[v] > 10000)
|
||||
{
|
||||
LL_ERRS() << "Bad morph index: " << mVertexIndices[v] << LL_ENDL;
|
||||
llerrs << "Bad morph index: " << mVertexIndices[v] << llendl;
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
llendianswizzle(&mCoords[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL;
|
||||
llwarns << "Can't read morph target vertex coordinates" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
llendianswizzle(&mNormals[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target normal" << LL_ENDL;
|
||||
llwarns << "Can't read morph target normal" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
llendianswizzle(&mBinormals[v], sizeof(F32), 3);
|
||||
if (numRead != 3)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target binormal" << LL_ENDL;
|
||||
llwarns << "Can't read morph target binormal" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
|
||||
if (numRead != 2)
|
||||
{
|
||||
LL_WARNS() << "Can't read morph target uv" << LL_ENDL;
|
||||
llwarns << "Can't read morph target uv" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ BOOL LLPolyMorphData::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(&numVertices, sizeof(S32), 1);
|
||||
if (fwrite(&numVertices, sizeof(S32), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
numVertices = mNumIndices; // without the swizzle again
|
||||
|
||||
@@ -277,35 +277,35 @@ BOOL LLPolyMorphData::saveLLM(LLFILE *fp)
|
||||
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
|
||||
if (fwrite(&mVertexIndices[v], sizeof(U32), 1, fp) != 1)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
|
||||
|
||||
llendianswizzle(mCoords[v].getF32ptr(), sizeof(F32), 3);
|
||||
if (fwrite(mCoords[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(mCoords[v].getF32ptr(), sizeof(F32), 3);
|
||||
|
||||
llendianswizzle(mNormals[v].getF32ptr(), sizeof(F32), 3);
|
||||
if (fwrite(mNormals[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(mNormals[v].getF32ptr(), sizeof(F32), 3);
|
||||
|
||||
llendianswizzle(mBinormals[v].getF32ptr(), sizeof(F32), 3);
|
||||
if (fwrite(mBinormals[v].getF32ptr(), sizeof(F32), 3, fp) != 3)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(mBinormals[v].getF32ptr(), sizeof(F32), 3);
|
||||
|
||||
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
|
||||
if (fwrite(&mTexCoords[v].mV, sizeof(F32), 2, fp) != 2)
|
||||
{
|
||||
LL_WARNS() << "Short write" << LL_ENDL;
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
|
||||
}
|
||||
@@ -566,7 +566,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if( !node->getFastAttributeString( name_string, mMorphName ) )
|
||||
{
|
||||
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
|
||||
llwarns << "Avatar file: <param> is missing name attribute" << llendl;
|
||||
return FALSE; // Continue, ignoring this tag
|
||||
}
|
||||
|
||||
@@ -577,8 +577,8 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
||||
|
||||
if (NULL == paramNode)
|
||||
{
|
||||
LL_WARNS() << "Failed to getChildByName(\"param_morph\")"
|
||||
<< LL_ENDL;
|
||||
llwarns << "Failed to getChildByName(\"param_morph\")"
|
||||
<< llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -612,27 +612,10 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
|
||||
// LLPolyMorphTarget()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh)
|
||||
: LLViewerVisualParam(),
|
||||
mMorphData(NULL),
|
||||
mMesh(poly_mesh),
|
||||
mVertMask(NULL),
|
||||
mLastSex(SEX_FEMALE),
|
||||
mNumMorphMasksPending(0),
|
||||
mVolumeMorphs()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLPolyMorphTarget()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolyMorphTarget::LLPolyMorphTarget(const LLPolyMorphTarget& pOther)
|
||||
: LLViewerVisualParam(pOther),
|
||||
mMorphData(pOther.mMorphData),
|
||||
mMesh(pOther.mMesh),
|
||||
mVertMask(pOther.mVertMask == NULL ? NULL : new LLPolyVertexMask(*pOther.mVertMask)),
|
||||
mLastSex(pOther.mLastSex),
|
||||
mNumMorphMasksPending(pOther.mNumMorphMasksPending),
|
||||
mVolumeMorphs(pOther.mVolumeMorphs)
|
||||
: mMorphData(NULL), mMesh(poly_mesh),
|
||||
mVertMask(NULL),
|
||||
mLastSex(SEX_FEMALE),
|
||||
mNumMorphMasksPending(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -641,8 +624,10 @@ LLPolyMorphTarget::LLPolyMorphTarget(const LLPolyMorphTarget& pOther)
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolyMorphTarget::~LLPolyMorphTarget()
|
||||
{
|
||||
delete mVertMask;
|
||||
mVertMask = NULL;
|
||||
if (mVertMask)
|
||||
{
|
||||
delete mVertMask;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -655,7 +640,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||
return FALSE;
|
||||
mInfo = info;
|
||||
mID = info->mID;
|
||||
setWeight(getDefaultWeight());
|
||||
setWeight(getDefaultWeight(), FALSE );
|
||||
|
||||
LLAvatarAppearance* avatarp = mMesh->getAvatar();
|
||||
LLPolyMorphTargetInfo::volume_info_list_t::iterator iter;
|
||||
@@ -680,8 +665,8 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||
if (!mMorphData)
|
||||
{
|
||||
const std::string driven_tag = "_Driven";
|
||||
size_t pos = morph_param_name.find(driven_tag);
|
||||
if (pos != std::string::npos)
|
||||
U32 pos = morph_param_name.find(driven_tag);
|
||||
if (pos > 0)
|
||||
{
|
||||
morph_param_name = morph_param_name.substr(0,pos);
|
||||
mMorphData = mMesh->getMorphData(morph_param_name);
|
||||
@@ -689,7 +674,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||
}
|
||||
if (!mMorphData)
|
||||
{
|
||||
LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL;
|
||||
llwarns << "No morph target named " << morph_param_name << " found in mesh." << llendl;
|
||||
return FALSE; // Continue, ignoring this tag
|
||||
}
|
||||
return TRUE;
|
||||
@@ -697,7 +682,9 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const
|
||||
{
|
||||
return new LLPolyMorphTarget(*this);
|
||||
LLPolyMorphTarget *new_param = new LLPolyMorphTarget(mMesh);
|
||||
*new_param = *this;
|
||||
return new_param;
|
||||
}
|
||||
|
||||
#if 0 // obsolete
|
||||
@@ -1032,25 +1019,10 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3
|
||||
// LLPolyVertexMask()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
|
||||
: mWeights(new F32[morph_data->mNumIndices]),
|
||||
mMorphData(morph_data),
|
||||
mWeightsGenerated(FALSE)
|
||||
{
|
||||
llassert(mMorphData != NULL);
|
||||
llassert(mMorphData->mNumIndices > 0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLPolyVertexMask()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolyVertexMask::LLPolyVertexMask(const LLPolyVertexMask& pOther)
|
||||
: mWeights(new F32[pOther.mMorphData->mNumIndices]),
|
||||
mMorphData(pOther.mMorphData),
|
||||
mWeightsGenerated(pOther.mWeightsGenerated)
|
||||
{
|
||||
llassert(mMorphData != NULL);
|
||||
llassert(mMorphData->mNumIndices > 0);
|
||||
memcpy(mWeights, pOther.mWeights, sizeof(F32) * mMorphData->mNumIndices);
|
||||
mWeights = new F32[morph_data->mNumIndices];
|
||||
mMorphData = morph_data;
|
||||
mWeightsGenerated = FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1058,8 +1030,7 @@ LLPolyVertexMask::LLPolyVertexMask(const LLPolyVertexMask& pOther)
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolyVertexMask::~LLPolyVertexMask()
|
||||
{
|
||||
delete [] mWeights;
|
||||
mWeights = NULL;
|
||||
delete[] mWeights;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -95,7 +95,6 @@ class LLPolyVertexMask
|
||||
{
|
||||
public:
|
||||
LLPolyVertexMask(LLPolyMorphData* morph_data);
|
||||
LLPolyVertexMask(const LLPolyVertexMask& pOther);
|
||||
~LLPolyVertexMask();
|
||||
|
||||
void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights);
|
||||
@@ -164,6 +163,16 @@ public:
|
||||
LLPolyMorphTarget(LLPolyMesh *poly_mesh);
|
||||
~LLPolyMorphTarget();
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
// Special: These functions are overridden by child classes
|
||||
LLPolyMorphTargetInfo* getInfo() const { return (LLPolyMorphTargetInfo*)mInfo; }
|
||||
// This sets mInfo and calls initialization functions
|
||||
@@ -187,19 +196,7 @@ public:
|
||||
void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
|
||||
void addPendingMorphMask() { mNumMorphMasksPending++; }
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr)
|
||||
{
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
protected:
|
||||
LLPolyMorphTarget(const LLPolyMorphTarget& pOther);
|
||||
|
||||
LLPolyMorphData* mMorphData;
|
||||
LLPolyMesh* mMesh;
|
||||
LLPolyVertexMask * mVertMask;
|
||||
|
||||
@@ -61,8 +61,8 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||
|
||||
if (NULL == skeletalParam)
|
||||
{
|
||||
LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")"
|
||||
<< LL_ENDL;
|
||||
llwarns << "Failed to getChildByName(\"param_skeleton\")"
|
||||
<< llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -78,14 +78,14 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!bone->getFastAttributeString(name_string, name))
|
||||
{
|
||||
LL_WARNS() << "No bone name specified for skeletal param." << LL_ENDL;
|
||||
llwarns << "No bone name specified for skeletal param." << llendl;
|
||||
continue;
|
||||
}
|
||||
|
||||
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
|
||||
if (!bone->getFastAttributeVector3(scale_string, scale))
|
||||
{
|
||||
LL_WARNS() << "No scale specified for bone " << name << "." << LL_ENDL;
|
||||
llwarns << "No scale specified for bone " << name << "." << llendl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Unrecognized element " << bone->getName() << " in skeletal distortion" << LL_ENDL;
|
||||
llwarns << "Unrecognized element " << bone->getName() << " in skeletal distortion" << llendl;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -110,25 +110,9 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
|
||||
// LLPolySkeletalDistortion()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLAvatarAppearance *avatarp)
|
||||
: LLViewerVisualParam(),
|
||||
mDefaultVec(),
|
||||
mJointScales(),
|
||||
mJointOffsets(),
|
||||
mAvatar(avatarp)
|
||||
{
|
||||
mDefaultVec.splat(0.001f);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLPolySkeletalDistortion()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPolySkeletalDistortion::LLPolySkeletalDistortion(const LLPolySkeletalDistortion &pOther)
|
||||
: LLViewerVisualParam(pOther),
|
||||
mDefaultVec(pOther.mDefaultVec),
|
||||
mJointScales(pOther.mJointScales),
|
||||
mJointOffsets(pOther.mJointOffsets),
|
||||
mAvatar(pOther.mAvatar)
|
||||
{
|
||||
mAvatar = avatarp;
|
||||
mDefaultVec.splat(0.001f);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -145,7 +129,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||
return FALSE;
|
||||
mInfo = info;
|
||||
mID = info->mID;
|
||||
setWeight(getDefaultWeight());
|
||||
setWeight(getDefaultWeight(), FALSE );
|
||||
|
||||
LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
|
||||
for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++)
|
||||
@@ -154,13 +138,13 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||
LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
|
||||
if (!joint)
|
||||
{
|
||||
LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
|
||||
llwarns << "Joint " << bone_info->mBoneName << " not found." << llendl;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mJointScales.find(joint) != mJointScales.end())
|
||||
{
|
||||
LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
|
||||
llwarns << "Scale deformation already supplied for joint " << joint->getName() << "." << llendl;
|
||||
}
|
||||
|
||||
// store it
|
||||
@@ -183,7 +167,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||
{
|
||||
if (mJointOffsets.find(joint) != mJointOffsets.end())
|
||||
{
|
||||
LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
|
||||
llwarns << "Offset deformation already supplied for joint " << joint->getName() << "." << llendl;
|
||||
}
|
||||
mJointOffsets[joint] = bone_info->mPositionDeformation;
|
||||
}
|
||||
@@ -193,7 +177,9 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const
|
||||
{
|
||||
return new LLPolySkeletalDistortion(*this);
|
||||
LLPolySkeletalDistortion *new_param = new LLPolySkeletalDistortion(mAvatar);
|
||||
*new_param = *this;
|
||||
return new_param;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
//#include "llpolymorph.h"
|
||||
#include "lljoint.h"
|
||||
#include "llviewervisualparam.h"
|
||||
//#include "lldarray.h"
|
||||
|
||||
//class LLSkinJoint;
|
||||
class LLAvatarAppearance;
|
||||
@@ -67,14 +68,6 @@ class LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo
|
||||
{
|
||||
friend class LLPolySkeletalDistortion;
|
||||
public:
|
||||
|
||||
LLPolySkeletalDistortionInfo();
|
||||
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
||||
|
||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
||||
|
||||
|
||||
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return ll_aligned_malloc_16(size);
|
||||
@@ -85,6 +78,10 @@ public:
|
||||
ll_aligned_free_16(ptr);
|
||||
}
|
||||
|
||||
LLPolySkeletalDistortionInfo();
|
||||
/*virtual*/ ~LLPolySkeletalDistortionInfo() {};
|
||||
|
||||
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
|
||||
|
||||
protected:
|
||||
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
|
||||
@@ -132,8 +129,6 @@ public:
|
||||
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
|
||||
|
||||
protected:
|
||||
LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther);
|
||||
|
||||
LL_ALIGN_16(LLVector4a mDefaultVec);
|
||||
typedef std::map<LLJoint*, LLVector3> joint_vec_map_t;
|
||||
joint_vec_map_t mJointScales;
|
||||
|
||||
@@ -90,37 +90,22 @@ const std::string& LLTexGlobalColor::getName() const
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLTexParamGlobalColor
|
||||
//-----------------------------------------------------------------------------
|
||||
LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color)
|
||||
: LLTexLayerParamColor(tex_global_color->getAvatarAppearance()),
|
||||
LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) :
|
||||
LLTexLayerParamColor(tex_global_color->getAvatarAppearance()),
|
||||
mTexGlobalColor(tex_global_color)
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLTexParamGlobalColor
|
||||
//-----------------------------------------------------------------------------
|
||||
LLTexParamGlobalColor::LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther)
|
||||
: LLTexLayerParamColor(pOther),
|
||||
mTexGlobalColor(pOther.mTexGlobalColor)
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ~LLTexParamGlobalColor
|
||||
//-----------------------------------------------------------------------------
|
||||
LLTexParamGlobalColor::~LLTexParamGlobalColor()
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const
|
||||
{
|
||||
return new LLTexParamGlobalColor(*this);
|
||||
LLTexParamGlobalColor *new_param = new LLTexParamGlobalColor(mTexGlobalColor);
|
||||
*new_param = *this;
|
||||
return new_param;
|
||||
}
|
||||
|
||||
void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake)
|
||||
{
|
||||
if (mAvatarAppearance)
|
||||
mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor, upload_bake);
|
||||
mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor, upload_bake);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -135,7 +120,6 @@ LLTexGlobalColorInfo::LLTexGlobalColorInfo()
|
||||
LLTexGlobalColorInfo::~LLTexGlobalColorInfo()
|
||||
{
|
||||
for_each(mParamColorInfoList.begin(), mParamColorInfoList.end(), DeletePointer());
|
||||
mParamColorInfoList.clear();
|
||||
}
|
||||
|
||||
BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
||||
@@ -144,7 +128,7 @@ BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
|
||||
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
|
||||
if (!node->getFastAttributeString(name_string, mName))
|
||||
{
|
||||
LL_WARNS() << "<global_color> element is missing name attribute." << LL_ENDL;
|
||||
llwarns << "<global_color> element is missing name attribute." << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
// <param> sub-element
|
||||
|
||||
@@ -73,11 +73,9 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor
|
||||
{
|
||||
public:
|
||||
LLTexParamGlobalColor(LLTexGlobalColor *tex_color);
|
||||
virtual ~LLTexParamGlobalColor();
|
||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
|
||||
protected:
|
||||
LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther);
|
||||
/*virtual*/ void onGlobalColorChanged(bool upload_bake = false);
|
||||
/*virtual*/ void onGlobalColorChanged(bool upload_bake);
|
||||
private:
|
||||
LLTexGlobalColor* mTexGlobalColor;
|
||||
};
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "llwearabledata.h"
|
||||
#include "llvertexbuffer.h"
|
||||
#include "llviewervisualparam.h"
|
||||
#include "lllocaltextureobject.h"
|
||||
|
||||
//#include "../tools/imdebug/imdebug.h"
|
||||
|
||||
@@ -156,7 +155,7 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet()
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.00f);
|
||||
}
|
||||
|
||||
//LLVertexBuffer::unbind();
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
// Composite the color data
|
||||
LLGLSUIDefault gls_ui;
|
||||
@@ -171,7 +170,7 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet()
|
||||
gAlphaMaskProgram.unbind();
|
||||
}
|
||||
|
||||
//LLVertexBuffer::unbind();
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
// reset GL state
|
||||
gGL.setColorMask(true, true);
|
||||
@@ -210,7 +209,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
||||
static LLStdStringHandle body_region_string = LLXmlTree::addAttributeString("body_region");
|
||||
if( !node->getFastAttributeString( body_region_string, mBodyRegion ) )
|
||||
{
|
||||
LL_WARNS() << "<layer_set> is missing body_region attribute" << LL_ENDL;
|
||||
llwarns << "<layer_set> is missing body_region attribute" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -738,13 +737,13 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||
}
|
||||
if (mLocalTexture == TEX_NUM_INDICES)
|
||||
{
|
||||
LL_WARNS() << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << LL_ENDL;
|
||||
llwarns << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "<texture> element is missing a required attribute. " << mName << LL_ENDL;
|
||||
llwarns << "<texture> element is missing a required attribute. " << mName << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -807,7 +806,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||
LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance);
|
||||
if (!param_color->setInfo(color_info, TRUE))
|
||||
{
|
||||
LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL;
|
||||
llwarns << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << llendl;
|
||||
delete param_color;
|
||||
success = FALSE;
|
||||
}
|
||||
@@ -821,7 +820,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||
LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance);
|
||||
if (!param_alpha->setInfo(alpha_info, TRUE))
|
||||
{
|
||||
LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL;
|
||||
llwarns << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << llendl;
|
||||
delete param_alpha;
|
||||
success = FALSE;
|
||||
}
|
||||
@@ -854,7 +853,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
||||
// Not a critical warning, but could be useful for debugging later issues. -Nyx
|
||||
if (mInfo != NULL)
|
||||
{
|
||||
LL_WARNS() << "mInfo != NULL" << LL_ENDL;
|
||||
llwarns << "mInfo != NULL" << llendl;
|
||||
}
|
||||
mInfo = info;
|
||||
//mID = info->mID; // No ID
|
||||
@@ -1210,7 +1209,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS() << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << LL_ENDL;
|
||||
llinfos << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << llendl;
|
||||
}
|
||||
// if( mTexLayerSet->getAvatarAppearance()->getLocalTextureGL((ETextureIndex)getInfo()->mLocalTexture, &image_gl ) )
|
||||
{
|
||||
@@ -1298,7 +1297,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
|
||||
|
||||
if( !success )
|
||||
{
|
||||
LL_INFOS() << "LLTexLayer::render() partial: " << getInfo()->mName << LL_ENDL;
|
||||
llinfos << "LLTexLayer::render() partial: " << getInfo()->mName << llendl;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -1435,7 +1434,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
{
|
||||
if (!force_render && !hasMorph())
|
||||
{
|
||||
LL_DEBUGS() << "skipping renderMorphMasks for " << getUUID() << LL_ENDL;
|
||||
lldebugs << "skipping renderMorphMasks for " << getUUID() << llendl;
|
||||
return;
|
||||
}
|
||||
LLFastTimer t(FTM_RENDER_MORPH_MASKS);
|
||||
@@ -1476,7 +1475,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
success &= param->render( x, y, width, height );
|
||||
if (!success && !force_render)
|
||||
{
|
||||
LL_DEBUGS() << "Failed to render param " << param->getID() << " ; skipping morph mask." << LL_ENDL;
|
||||
lldebugs << "Failed to render param " << param->getID() << " ; skipping morph mask." << llendl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1518,8 +1517,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Skipping rendering of " << getInfo()->mStaticImageFileName
|
||||
<< "; expected 1 or 4 components." << LL_ENDL;
|
||||
llwarns << "Skipping rendering of " << getInfo()->mStaticImageFileName
|
||||
<< "; expected 1 or 4 components." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1557,13 +1556,10 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
}
|
||||
|
||||
U32 cache_index = alpha_mask_crc.getCRC();
|
||||
U8* alpha_data = NULL;
|
||||
// We believe we need to generate morph masks, do not assume that the cached version is accurate.
|
||||
// We can get bad morph masks during login, on minimize, and occasional gl errors.
|
||||
// We should only be doing this when we believe something has changed with respect to the user's appearance.
|
||||
U8* alpha_data = get_if_there(mAlphaCache,cache_index,(U8*)NULL);
|
||||
if (!alpha_data)
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << LL_ENDL;
|
||||
// clear out a slot if we have filled our cache
|
||||
// clear out a slot if we have filled our cache
|
||||
S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1;
|
||||
while ((S32)mAlphaCache.size() >= max_cache_entries)
|
||||
{
|
||||
@@ -1573,12 +1569,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
mAlphaCache.erase(iter2);
|
||||
}
|
||||
alpha_data = new U8[width * height];
|
||||
U8* pixels_tmp = new U8[width * height * 4];
|
||||
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels_tmp);
|
||||
for (int i = 0; i < width * height; ++i)
|
||||
alpha_data[i] = pixels_tmp[i * 4 + 3];
|
||||
delete[] pixels_tmp;
|
||||
mAlphaCache[cache_index] = alpha_data;
|
||||
glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data);
|
||||
}
|
||||
|
||||
getTexLayerSet()->getAvatarAppearance()->dirtyMesh();
|
||||
@@ -1787,11 +1779,13 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
||||
/*virtual*/ void LLTexLayerTemplate::gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height)
|
||||
{
|
||||
U32 num_wearables = updateWearableCache();
|
||||
U32 i = num_wearables - 1; // For rendering morph masks, we only want to use the top wearable
|
||||
LLTexLayer *layer = getLayer(i);
|
||||
if (layer)
|
||||
for (U32 i = 0; i < num_wearables; i++)
|
||||
{
|
||||
layer->addAlphaMask(data, originX, originY, width, height);
|
||||
LLTexLayer *layer = getLayer(i);
|
||||
if (layer)
|
||||
{
|
||||
layer->addAlphaMask(data, originX, originY, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1903,18 +1897,18 @@ LLTexLayerStaticImageList::~LLTexLayerStaticImageList()
|
||||
|
||||
void LLTexLayerStaticImageList::dumpByteCount() const
|
||||
{
|
||||
LL_INFOS() << "Avatar Static Textures " <<
|
||||
llinfos << "Avatar Static Textures " <<
|
||||
"KB GL:" << (mGLBytes / 1024) <<
|
||||
"KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL;
|
||||
"KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
|
||||
}
|
||||
|
||||
void LLTexLayerStaticImageList::deleteCachedImages()
|
||||
{
|
||||
if( mGLBytes || mTGABytes )
|
||||
{
|
||||
LL_INFOS() << "Clearing Static Textures " <<
|
||||
llinfos << "Clearing Static Textures " <<
|
||||
"KB GL:" << (mGLBytes / 1024) <<
|
||||
"KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL;
|
||||
"KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
|
||||
|
||||
//mStaticImageLists uses LLPointers, clear() will cause deletion
|
||||
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLTexLayerParam
|
||||
//-----------------------------------------------------------------------------
|
||||
LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer)
|
||||
: LLViewerVisualParam(),
|
||||
LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) :
|
||||
mTexLayer(layer),
|
||||
mAvatarAppearance(NULL)
|
||||
{
|
||||
@@ -50,23 +49,16 @@ LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer)
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_ERRS() << "LLTexLayerParam constructor passed with NULL reference for layer!" << LL_ENDL;
|
||||
llerrs << "LLTexLayerParam constructor passed with NULL reference for layer!" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance)
|
||||
: LLViewerVisualParam(),
|
||||
LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance) :
|
||||
mTexLayer(NULL),
|
||||
mAvatarAppearance(appearance)
|
||||
{
|
||||
}
|
||||
|
||||
LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther)
|
||||
: LLViewerVisualParam(pOther),
|
||||
mTexLayer(pOther.mTexLayer),
|
||||
mAvatarAppearance(pOther.mAvatarAppearance)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance)
|
||||
{
|
||||
@@ -94,7 +86,7 @@ void LLTexLayerParamAlpha::dumpCacheByteCount()
|
||||
{
|
||||
S32 gl_bytes = 0;
|
||||
getCacheByteCount( &gl_bytes);
|
||||
LL_INFOS() << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << LL_ENDL;
|
||||
llinfos << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << llendl;
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -119,11 +111,9 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes)
|
||||
}
|
||||
}
|
||||
|
||||
LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer)
|
||||
: LLTexLayerParam(layer),
|
||||
LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) :
|
||||
LLTexLayerParam(layer),
|
||||
mCachedProcessedTexture(NULL),
|
||||
mStaticImageTGA(),
|
||||
mStaticImageRaw(),
|
||||
mNeedsCreateTexture(FALSE),
|
||||
mStaticImageInvalid(FALSE),
|
||||
mAvgDistortionVec(1.f, 1.f, 1.f),
|
||||
@@ -132,11 +122,9 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer)
|
||||
sInstances.push_front(this);
|
||||
}
|
||||
|
||||
LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance)
|
||||
: LLTexLayerParam(appearance),
|
||||
LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) :
|
||||
LLTexLayerParam(appearance),
|
||||
mCachedProcessedTexture(NULL),
|
||||
mStaticImageTGA(),
|
||||
mStaticImageRaw(),
|
||||
mNeedsCreateTexture(FALSE),
|
||||
mStaticImageInvalid(FALSE),
|
||||
mAvgDistortionVec(1.f, 1.f, 1.f),
|
||||
@@ -145,18 +133,6 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance)
|
||||
sInstances.push_front(this);
|
||||
}
|
||||
|
||||
LLTexLayerParamAlpha::LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther)
|
||||
: LLTexLayerParam(pOther),
|
||||
mCachedProcessedTexture(pOther.mCachedProcessedTexture),
|
||||
mStaticImageTGA(pOther.mStaticImageTGA),
|
||||
mStaticImageRaw(pOther.mStaticImageRaw),
|
||||
mNeedsCreateTexture(pOther.mNeedsCreateTexture),
|
||||
mStaticImageInvalid(pOther.mStaticImageInvalid),
|
||||
mAvgDistortionVec(pOther.mAvgDistortionVec),
|
||||
mCachedEffectiveWeight(pOther.mCachedEffectiveWeight)
|
||||
{
|
||||
sInstances.push_front(this);
|
||||
}
|
||||
|
||||
LLTexLayerParamAlpha::~LLTexLayerParamAlpha()
|
||||
{
|
||||
@@ -166,7 +142,9 @@ LLTexLayerParamAlpha::~LLTexLayerParamAlpha()
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLTexLayerParamAlpha::cloneParam(LLWearable* wearable) const
|
||||
{
|
||||
return new LLTexLayerParamAlpha(*this);
|
||||
LLTexLayerParamAlpha *new_param = new LLTexLayerParamAlpha(mTexLayer);
|
||||
*new_param = *this;
|
||||
return new_param;
|
||||
}
|
||||
|
||||
void LLTexLayerParamAlpha::deleteCaches()
|
||||
@@ -182,7 +160,7 @@ BOOL LLTexLayerParamAlpha::getMultiplyBlend() const
|
||||
return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend;
|
||||
}
|
||||
|
||||
void LLTexLayerParamAlpha::setWeight(F32 weight, bool upload_bake)
|
||||
void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
|
||||
{
|
||||
if (mIsAnimating || mTexLayer == NULL)
|
||||
{
|
||||
@@ -206,7 +184,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, bool upload_bake)
|
||||
}
|
||||
}
|
||||
|
||||
void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, bool upload_bake)
|
||||
void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake)
|
||||
{
|
||||
// do not animate dummy parameters
|
||||
if (mIsDummy)
|
||||
@@ -224,7 +202,7 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, bool upload_bake
|
||||
}
|
||||
}
|
||||
|
||||
void LLTexLayerParamAlpha::animate(F32 delta, bool upload_bake)
|
||||
void LLTexLayerParamAlpha::animate(F32 delta, BOOL upload_bake)
|
||||
{
|
||||
if (mNext)
|
||||
{
|
||||
@@ -300,7 +278,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||
|
||||
if (mStaticImageTGA.isNull())
|
||||
{
|
||||
LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL;
|
||||
llwarns << "Unable to load static file: " << info->mStaticImageFileName << llendl;
|
||||
mStaticImageInvalid = TRUE; // don't try again.
|
||||
return FALSE;
|
||||
}
|
||||
@@ -331,7 +309,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||
mStaticImageRaw = new LLImageRaw;
|
||||
mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight);
|
||||
mNeedsCreateTexture = TRUE;
|
||||
LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL;
|
||||
lldebugs << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << llendl;
|
||||
}
|
||||
|
||||
if (mCachedProcessedTexture)
|
||||
@@ -402,7 +380,7 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// LL_WARNS() << "<param_alpha> element is missing tga_file attribute." << LL_ENDL;
|
||||
// llwarns << "<param_alpha> element is missing tga_file attribute." << llendl;
|
||||
// }
|
||||
|
||||
static LLStdStringHandle multiply_blend_string = LLXmlTree::addAttributeString("multiply_blend");
|
||||
@@ -420,31 +398,27 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
|
||||
|
||||
|
||||
|
||||
LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer)
|
||||
: LLTexLayerParam(layer),
|
||||
LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer) :
|
||||
LLTexLayerParam(layer),
|
||||
mAvgDistortionVec(1.f, 1.f, 1.f)
|
||||
{
|
||||
}
|
||||
|
||||
LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance)
|
||||
: LLTexLayerParam(appearance),
|
||||
LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) :
|
||||
LLTexLayerParam(appearance),
|
||||
mAvgDistortionVec(1.f, 1.f, 1.f)
|
||||
{
|
||||
}
|
||||
|
||||
LLTexLayerParamColor::LLTexLayerParamColor(const LLTexLayerParamColor& pOther)
|
||||
: LLTexLayerParam(pOther),
|
||||
mAvgDistortionVec(pOther.mAvgDistortionVec)
|
||||
{
|
||||
}
|
||||
|
||||
LLTexLayerParamColor::~LLTexLayerParamColor()
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const
|
||||
{
|
||||
return new LLTexLayerParamColor(*this);
|
||||
LLTexLayerParamColor *new_param = new LLTexLayerParamColor(mTexLayer);
|
||||
*new_param = *this;
|
||||
return new_param;
|
||||
}
|
||||
|
||||
LLColor4 LLTexLayerParamColor::getNetColor() const
|
||||
@@ -475,13 +449,14 @@ LLColor4 LLTexLayerParamColor::getNetColor() const
|
||||
}
|
||||
}
|
||||
|
||||
void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake)
|
||||
void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
|
||||
{
|
||||
if (mIsAnimating)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo();
|
||||
F32 min_weight = getMinWeight();
|
||||
F32 max_weight = getMaxWeight();
|
||||
F32 new_weight = llclamp(weight, min_weight, max_weight);
|
||||
@@ -491,8 +466,6 @@ void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake)
|
||||
{
|
||||
mCurWeight = new_weight;
|
||||
|
||||
const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo();
|
||||
|
||||
if (info->mNumColors <= 0)
|
||||
{
|
||||
// This will happen when we set the default weight the first time.
|
||||
@@ -508,11 +481,11 @@ void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake)
|
||||
}
|
||||
}
|
||||
|
||||
// LL_INFOS() << "param " << mName << " = " << new_weight << LL_ENDL;
|
||||
// llinfos << "param " << mName << " = " << new_weight << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
void LLTexLayerParamColor::setAnimationTarget(F32 target_value, bool upload_bake)
|
||||
void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake)
|
||||
{
|
||||
// set value first then set interpolating flag to ignore further updates
|
||||
mTargetWeight = target_value;
|
||||
@@ -524,7 +497,7 @@ void LLTexLayerParamColor::setAnimationTarget(F32 target_value, bool upload_bake
|
||||
}
|
||||
}
|
||||
|
||||
void LLTexLayerParamColor::animate(F32 delta, bool upload_bake)
|
||||
void LLTexLayerParamColor::animate(F32 delta, BOOL upload_bake)
|
||||
{
|
||||
if (mNext)
|
||||
{
|
||||
@@ -583,13 +556,13 @@ BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
|
||||
}
|
||||
if (!mNumColors)
|
||||
{
|
||||
LL_WARNS() << "<param_color> is missing <value> sub-elements" << LL_ENDL;
|
||||
llwarns << "<param_color> is missing <value> sub-elements" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1))
|
||||
{
|
||||
LL_WARNS() << "<param_color> with operation\"blend\" must have exactly one <value>" << LL_ENDL;
|
||||
llwarns << "<param_color> with operation\"blend\" must have exactly one <value>" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,8 +52,6 @@ public:
|
||||
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
|
||||
|
||||
protected:
|
||||
LLTexLayerParam(const LLTexLayerParam& pOther);
|
||||
|
||||
LLTexLayerInterface* mTexLayer;
|
||||
LLAvatarAppearance* mAvatarAppearance;
|
||||
};
|
||||
@@ -85,9 +83,9 @@ public:
|
||||
// LLVisualParam Virtual functions
|
||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||
/*virtual*/ void apply( ESex avatar_sex ) {}
|
||||
/*virtual*/ void setWeight(F32 weight, bool upload_bake = false);
|
||||
/*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake = false);
|
||||
/*virtual*/ void animate(F32 delta, bool upload_bake = false);
|
||||
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
||||
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
||||
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
|
||||
/*virtual*/ char const* getTypeString(void) const { return "param_alpha"; }
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
@@ -105,8 +103,6 @@ public:
|
||||
BOOL getMultiplyBlend() const;
|
||||
|
||||
private:
|
||||
LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther);
|
||||
|
||||
LLPointer<LLGLTexture> mCachedProcessedTexture;
|
||||
LLPointer<LLImageTGA> mStaticImageTGA;
|
||||
LLPointer<LLImageRaw> mStaticImageRaw;
|
||||
@@ -179,9 +175,9 @@ public:
|
||||
// LLVisualParam Virtual functions
|
||||
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
|
||||
/*virtual*/ void apply( ESex avatar_sex ) {}
|
||||
/*virtual*/ void setWeight(F32 weight, bool upload_bake = false);
|
||||
/*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake = false);
|
||||
/*virtual*/ void animate(F32 delta, bool upload_bake = false);
|
||||
/*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
|
||||
/*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
|
||||
/*virtual*/ void animate(F32 delta, BOOL upload_bake);
|
||||
/*virtual*/ char const* getTypeString(void) const { return "param_color"; }
|
||||
|
||||
// LLViewerVisualParam Virtual functions
|
||||
@@ -195,9 +191,7 @@ public:
|
||||
// New functions
|
||||
LLColor4 getNetColor() const;
|
||||
protected:
|
||||
LLTexLayerParamColor(const LLTexLayerParamColor& pOther);
|
||||
|
||||
virtual void onGlobalColorChanged(bool upload_bake = false) {}
|
||||
virtual void onGlobalColorChanged(bool upload_bake) {}
|
||||
private:
|
||||
LL_ALIGN_16(LLVector4a mAvgDistortionVec);
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "lltexturemanagerbridge.h"
|
||||
|
||||
// Define a null texture manager bridge. Applications must provide their own bridge implementaton.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user