Compare commits
10 Commits
sv-1.8.9.8
...
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
|
||||
17
.gitignore
vendored
17
.gitignore
vendored
@@ -1,25 +1,24 @@
|
||||
/installed.xml
|
||||
/indra/llcommon/llversionviewer.h
|
||||
/indra/build-*
|
||||
/indra/tools/vstool/obj/
|
||||
*.aps
|
||||
*.suo
|
||||
*.vshost.exe
|
||||
*/.vs
|
||||
/bin/
|
||||
/bin-release/
|
||||
/bin
|
||||
/bin-release
|
||||
/indra/out/
|
||||
/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
|
||||
@@ -27,4 +26,12 @@ qtcreator-build/
|
||||
/.pc
|
||||
/build-*
|
||||
/viewer-*
|
||||
/Pipfile.lock
|
||||
/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
|
||||
|
||||
|
||||
|
||||
168
.gitlab-ci.yml
168
.gitlab-ci.yml
@@ -1,168 +0,0 @@
|
||||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
VIEWER_USE_CRASHPAD: "TRUE"
|
||||
VIEWER_CRASHPAD_URL: $SENTRY_DSN
|
||||
|
||||
.win_build: &win_build
|
||||
stage: build
|
||||
tags:
|
||||
- autobuild
|
||||
- windows
|
||||
before_script:
|
||||
- pipenv install
|
||||
script:
|
||||
- If ($env:VIEWER_CHANNEL_TYPE -eq 'Project')
|
||||
{
|
||||
$env:VIEWER_CHANNEL_CODENAME = $env:CI_COMMIT_REF_NAME[8..100] -join ''
|
||||
}
|
||||
- pipenv run autobuild configure -c Release -- -DUSE_FMODSTUDIO=ON -DUSE_NVAPI=ON -DUSE_LTO=ON -DVS_DISABLE_FATAL_WARNINGS=ON
|
||||
- pipenv run autobuild build -c Release --no-configure
|
||||
- If ($env:VIEWER_USE_CRASHPAD -eq 'TRUE') {
|
||||
- Push-Location .\build-vc-*\newview\Release\
|
||||
- sentry-cli upload-dif --include-sources singularity-bin.exe singularity-bin.pdb crashpad_handler.exe crashpad_handler.pdb fmod.dll libcrypto-1_1.dll libcrypto-1_1.pdb libssl-1_1.dll libssl-1_1.pdb libcrypto-1_1-x64.dll libcrypto-1_1-x64.pdb libssl-1_1-x64.dll libssl-1_1-x64.pdb vcruntime140.dll msvcp140.dll libhunspell.dll libhunspell.pdb glod.dll
|
||||
- Pop-Location }
|
||||
artifacts:
|
||||
name: "$env:CI_COMMIT_REF_NAME-$env:CI_COMMIT_SHORT_SHA"
|
||||
expire_in: 2 week
|
||||
paths:
|
||||
- build-vc-*/newview/Release/build_data.json
|
||||
- build-vc-*/newview/Release/singularity-bin.pdb
|
||||
- build-vc-*/newview/Release/Singularity_*_Setup.exe
|
||||
|
||||
.beta_rules: &beta_rules
|
||||
only:
|
||||
- /^.*-beta$/
|
||||
except:
|
||||
- branches
|
||||
|
||||
.release_rules: &release_rules
|
||||
only:
|
||||
- /^.*-release$/
|
||||
except:
|
||||
- branches
|
||||
|
||||
build:master:windows32:
|
||||
<<: *win_build
|
||||
interruptible: true
|
||||
variables:
|
||||
AUTOBUILD_ADDRSIZE: 32
|
||||
VIEWER_CHANNEL_TYPE: Test
|
||||
VIEWER_USE_CRASHPAD: "FALSE"
|
||||
only:
|
||||
- schedules
|
||||
- web
|
||||
|
||||
build:master:windows64:
|
||||
<<: *win_build
|
||||
interruptible: true
|
||||
variables:
|
||||
AUTOBUILD_ADDRSIZE: 64
|
||||
VIEWER_CHANNEL_TYPE: Test
|
||||
VIEWER_USE_CRASHPAD: "FALSE"
|
||||
only:
|
||||
- schedules
|
||||
- web
|
||||
|
||||
build:project:windows32:
|
||||
<<: *win_build
|
||||
interruptible: true
|
||||
variables:
|
||||
AUTOBUILD_ADDRSIZE: 32
|
||||
VIEWER_CHANNEL_TYPE: Project
|
||||
VIEWER_USE_CRASHPAD: "FALSE"
|
||||
only:
|
||||
- /^project-.*$/
|
||||
|
||||
build:project:windows64:
|
||||
<<: *win_build
|
||||
interruptible: true
|
||||
variables:
|
||||
AUTOBUILD_ADDRSIZE: 64
|
||||
VIEWER_CHANNEL_TYPE: Project
|
||||
only:
|
||||
- /^project-.*$/
|
||||
|
||||
build:beta:windows32:
|
||||
<<: *win_build
|
||||
variables:
|
||||
AUTOBUILD_ADDRSIZE: 32
|
||||
VIEWER_CHANNEL_TYPE: Beta
|
||||
VIEWER_USE_CRASHPAD: "FALSE"
|
||||
<<: *beta_rules
|
||||
|
||||
build:beta:windows64:
|
||||
<<: *win_build
|
||||
variables:
|
||||
AUTOBUILD_ADDRSIZE: 64
|
||||
VIEWER_CHANNEL_TYPE: Beta
|
||||
<<: *beta_rules
|
||||
|
||||
build:release:windows32:
|
||||
<<: *win_build
|
||||
variables:
|
||||
AUTOBUILD_ADDRSIZE: 32
|
||||
VIEWER_CHANNEL_TYPE: Release
|
||||
VIEWER_USE_CRASHPAD: "FALSE"
|
||||
<<: *release_rules
|
||||
|
||||
build:release:windows64:
|
||||
<<: *win_build
|
||||
variables:
|
||||
AUTOBUILD_ADDRSIZE: 64
|
||||
VIEWER_CHANNEL_TYPE: Release
|
||||
<<: *release_rules
|
||||
|
||||
.deploy_template: &deploy_template
|
||||
stage: deploy
|
||||
tags:
|
||||
- autobuild
|
||||
- windows
|
||||
script:
|
||||
- $BuildData = Get-Content .\build-vc-64\newview\Release\build_data.json | ConvertFrom-Json
|
||||
- $BuildChannelVersion = $BuildData."Channel" + ' ' + $BuildData."Version"
|
||||
- $UploadDestViewerDir = $BuildChannelVersion.ToLower().Replace(" ", "/")
|
||||
- $UploadDestURL = "https://pkg.alchemyviewer.org/repository/viewer/${UploadDestViewerDir}"
|
||||
|
||||
- $UploadParams = @{ UseBasicParsing = $true;
|
||||
Method = "PUT";
|
||||
Headers = @{
|
||||
ContentType = "application/x-executable";
|
||||
Authorization = "Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("$env:AUTOBUILD_HTTP_USER`:$env:AUTOBUILD_HTTP_PASS")))"; };
|
||||
Verbose = $true; };
|
||||
|
||||
- Push-Location .\build-vc-32\newview\Release\
|
||||
- $FileNameWin32 = Get-ChildItem -Path . -Name -Include Singularity_*_Setup.exe
|
||||
- Invoke-WebRequest @UploadParams -InFile .\$FileNameWin32 -Uri "${UploadDestURL}/${FileNameWin32}"
|
||||
- Pop-Location
|
||||
|
||||
- Push-Location .\build-vc-64\newview\Release\
|
||||
- $FileNameWin64 = Get-ChildItem -Path . -Name -Include Singularity_*_Setup.exe
|
||||
- Invoke-WebRequest @UploadParams -InFile .\$FileNameWin64 -Uri "${UploadDestURL}/${FileNameWin64}"
|
||||
- Pop-Location
|
||||
|
||||
- sentry-cli releases new $BuildChannelVersion
|
||||
- sentry-cli releases set-commits --auto $BuildChannelVersion
|
||||
- sentry-cli releases finalize $BuildChannelVersion
|
||||
when: manual
|
||||
|
||||
deploy_project:
|
||||
<<: *deploy_template
|
||||
environment:
|
||||
name: qa
|
||||
only:
|
||||
- /^project-.*$/
|
||||
|
||||
deploy_beta:
|
||||
<<: *deploy_template
|
||||
environment:
|
||||
name: staging
|
||||
<<: *beta_rules
|
||||
|
||||
deploy_release:
|
||||
<<: *deploy_template
|
||||
environment:
|
||||
name: production
|
||||
<<: *release_rules
|
||||
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.
|
||||
14
Pipfile
14
Pipfile
@@ -1,14 +0,0 @@
|
||||
[[source]]
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[packages]
|
||||
llbase = "*"
|
||||
certifi = "*"
|
||||
autobuild = {git = "https://git.alchemyviewer.org/alchemy/autobuild.git"}
|
||||
|
||||
[requires]
|
||||
python_version = "2.7"
|
||||
2
README
2
README
@@ -18,7 +18,7 @@ as those based upon the OpenSim platform.
|
||||
Singularity is maintained by a small group of volunteers who can be contacted
|
||||
both, in-world (SingularityViewer group) as well as on IRC (#SingularityViewer
|
||||
@ FreeNode). Bug requests and features requests can be submitted through our
|
||||
Issue Tracker (http://links.singularityviewer.org/?to=issues or from
|
||||
Issue Tracker (http://code.google.com/p/singularity-viewer/issues/list or from
|
||||
the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...)
|
||||
|
||||
|
||||
|
||||
3052
autobuild.xml
3052
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
@@ -236,14 +236,6 @@
|
||||
<boolean>false</boolean>
|
||||
</map>
|
||||
|
||||
<key>ObjectAnimation</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
<string>template</string>
|
||||
<key>trusted-sender</key>
|
||||
<boolean>false</boolean>
|
||||
</map>
|
||||
|
||||
<key>AvatarAppearance</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
|
||||
@@ -3,7 +3,19 @@
|
||||
# cmake_minimum_required should appear before any
|
||||
# other commands to guarantee full compatibility
|
||||
# with the version specified
|
||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
|
||||
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.")
|
||||
@@ -11,20 +23,27 @@ project(${ROOT_PROJECT_NAME})
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
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)
|
||||
|
||||
include(Variables)
|
||||
include(00-Common)
|
||||
include(BuildVersion)
|
||||
include(CTest)
|
||||
|
||||
add_subdirectory(deps)
|
||||
# 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_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)
|
||||
@@ -47,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)
|
||||
@@ -58,12 +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 ${VIEWER_BINARY_NAME})
|
||||
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)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PROPERTY VS_STARTUP_PROJECT ${VIEWER_BINARY_NAME})
|
||||
endif (WINDOWS)
|
||||
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,9 +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)
|
||||
|
||||
target_link_libraries(
|
||||
aistatemachine
|
||||
PUBLIC
|
||||
llcommon
|
||||
)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
|
||||
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(Variables)
|
||||
|
||||
|
||||
# Portable compilation flags.
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
|
||||
@@ -18,12 +18,44 @@ set(CMAKE_C_FLAGS_RELEASE
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
|
||||
|
||||
# Configure crash reporting
|
||||
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
|
||||
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
|
||||
|
||||
if(RELEASE_CRASH_REPORTING)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DLL_SEND_CRASH_REPORTS=1")
|
||||
endif()
|
||||
|
||||
if(NON_RELEASE_CRASH_REPORTING)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLL_SEND_CRASH_REPORTS=1")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1")
|
||||
endif()
|
||||
|
||||
|
||||
# Don't bother with a MinSizeRel build.
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
|
||||
"Supported build types." FORCE)
|
||||
|
||||
# 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)
|
||||
|
||||
@@ -33,88 +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 (ADDRESS_SIZE EQUAL 32)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||
endif (ADDRESS_SIZE EQUAL 32)
|
||||
|
||||
if (FULL_DEBUG_SYMS OR USE_CRASHPAD)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG:FULL")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG:FULL")
|
||||
else ()
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG:FASTLINK")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG:FASTLINK")
|
||||
endif ()
|
||||
|
||||
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
|
||||
/DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
|
||||
/D_UNICODE
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
/c
|
||||
/Zc:__cplusplus
|
||||
/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 (ADDRESS_SIZE EQUAL 32)
|
||||
add_compile_options(/arch:SSE2)
|
||||
endif (ADDRESS_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")
|
||||
@@ -122,30 +122,20 @@ set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math")
|
||||
if (LINUX)
|
||||
set(CMAKE_SKIP_RPATH TRUE)
|
||||
|
||||
add_compile_options(
|
||||
-fvisibility=hidden
|
||||
-fexceptions
|
||||
-fno-math-errno
|
||||
-fno-strict-aliasing
|
||||
-fsigned-char
|
||||
-g
|
||||
-pthread
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
-DLL_LINUX=1
|
||||
-DAPPID=secondlife
|
||||
-D_REENTRANT
|
||||
-DGDK_DISABLE_DEPRECATED
|
||||
-DGTK_DISABLE_DEPRECATED
|
||||
-DGSEAL_ENABLE
|
||||
-DGTK_DISABLE_SINGLE_INCLUDES
|
||||
)
|
||||
-DLL_LINUX=1
|
||||
-DAPPID=secondlife
|
||||
-D_REENTRANT
|
||||
-fexceptions
|
||||
-fno-math-errno
|
||||
-fno-strict-aliasing
|
||||
-fsigned-char
|
||||
-fvisibility=hidden
|
||||
-g
|
||||
-pthread
|
||||
)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
|
||||
|
||||
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!
|
||||
@@ -200,40 +190,50 @@ if (LINUX)
|
||||
|
||||
# End of hacks.
|
||||
|
||||
CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STRONG_STACK_PROTECTOR)
|
||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
||||
if(HAS_STRONG_STACK_PROTECTOR)
|
||||
add_compile_options(-fstack-protector-strong)
|
||||
endif(HAS_STRONG_STACK_PROTECTOR)
|
||||
endif (${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
||||
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 -msse4.1")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffast-math -msse4.1")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ffast-math -msse4.1")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ffast-math -msse4.1")
|
||||
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")
|
||||
if (NOT STANDALONE)
|
||||
set(MARCH_FLAG " -march=pentium4")
|
||||
endif (NOT STANDALONE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
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} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
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")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse3")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse3")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
if (NOT STANDALONE)
|
||||
set(MARCH_FLAG " -axsse4.1 -msse3")
|
||||
# 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")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
|
||||
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)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline-functions")
|
||||
@@ -297,35 +297,27 @@ if (LINUX OR DARWIN)
|
||||
|
||||
set(CMAKE_C_FLAGS "${UNIX_WARNINGS} ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${UNIX_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
|
||||
if (ADDRESS_SIZE EQUAL 32)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
|
||||
elseif (ADDRESS_SIZE EQUAL 64)
|
||||
elseif (WORD_SIZE EQUAL 64)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
|
||||
endif (ADDRESS_SIZE EQUAL 32)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
endif (LINUX OR DARWIN)
|
||||
|
||||
|
||||
if (STANDALONE)
|
||||
add_definitions(-DLL_STANDALONE=1)
|
||||
else (STANDALONE)
|
||||
#Enforce compile-time correctness for fmt strings
|
||||
add_definitions(-DFMT_STRING_ALIAS=1)
|
||||
|
||||
if(USE_CRASHPAD)
|
||||
add_definitions(-DUSE_CRASHPAD=1 -DCRASHPAD_URL="${CRASHPAD_URL}")
|
||||
endif()
|
||||
|
||||
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)
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (LINUX)
|
||||
if (STANDALONE)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(OGG REQUIRED ogg)
|
||||
pkg_check_modules(VORBIS REQUIRED vorbis)
|
||||
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
|
||||
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
|
||||
else (LINUX)
|
||||
use_prebuilt_binary(ogg_vorbis)
|
||||
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
else (STANDALONE)
|
||||
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})
|
||||
|
||||
@@ -32,7 +35,7 @@ else (LINUX)
|
||||
set(VORBISENC_LIBRARIES vorbisenc)
|
||||
set(VORBISFILE_LIBRARIES vorbisfile)
|
||||
endif (WINDOWS)
|
||||
endif (LINUX)
|
||||
endif (STANDALONE)
|
||||
|
||||
link_directories(
|
||||
${VORBIS_LIBRARY_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,38 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
if (WINDOWS)
|
||||
#message(WARNING, ${CMAKE_CURRENT_BINARY_DIR}/newview/viewerRes.rc.in)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/viewerRes.rc
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
||||
if (DARWIN)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/English.lproj/InfoPlist.strings
|
||||
)
|
||||
endif (DARWIN)
|
||||
|
||||
if (LINUX)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/wrapper.sh.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/linux_tools/wrapper.sh
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/handle_secondlifeprotocol.sh.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/linux_tools/handle_secondlifeprotocol.sh
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/install.sh.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/linux_tools/install.sh
|
||||
@ONLY
|
||||
)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/newview/linux_tools/refresh_desktop_app_entry.sh.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/linux_tools/refresh_desktop_app_entry.sh
|
||||
@ONLY
|
||||
)
|
||||
endif (LINUX)
|
||||
@@ -1,20 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
# Construct the version and copyright information based on package data.
|
||||
include(Python)
|
||||
include(Variables)
|
||||
|
||||
# packages-formatter.py runs autobuild install --versions, which needs to know
|
||||
# the build_directory, which (on Windows) depends on AUTOBUILD_ADDRSIZE.
|
||||
# Within an autobuild build, AUTOBUILD_ADDRSIZE is already set. But when
|
||||
# building in an IDE, it probably isn't. Set it explicitly using
|
||||
# run_build_test.py.
|
||||
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
|
||||
${CMAKE_SOURCE_DIR}/../autobuild.xml
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE}
|
||||
${PYTHON_EXECUTABLE}
|
||||
${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt
|
||||
)
|
||||
@@ -1,55 +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_CHANNEL_GRK=L\"${VIEWER_CHANNEL_GRK}\""
|
||||
"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(dullahan)
|
||||
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
|
||||
dullahan.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}/libdullahan.a
|
||||
${APPKIT_LIBRARY}
|
||||
${CEF_LIBRARY}
|
||||
)
|
||||
|
||||
elseif (LINUX)
|
||||
set(CEF_PLUGIN_LIBRARIES
|
||||
dullahan
|
||||
cef_dll_wrapper.a
|
||||
cef
|
||||
)
|
||||
endif (WINDOWS)
|
||||
@@ -12,44 +12,50 @@ set(cmake_SOURCE_FILES
|
||||
APR.cmake
|
||||
Audio.cmake
|
||||
BasicPluginBase.cmake
|
||||
BerkeleyDB.cmake
|
||||
Boost.cmake
|
||||
BuildBranding.cmake
|
||||
BuildVersion.cmake
|
||||
CARes.cmake
|
||||
CEFPlugin.cmake
|
||||
CMakeCopyIfDifferent.cmake
|
||||
CURL.cmake
|
||||
Colladadom.cmake
|
||||
ConfigurePkgConfig.cmake
|
||||
CURL.cmake
|
||||
Copy3rdPartyLibs.cmake
|
||||
CrashPad.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
|
||||
FindURIPARSER.cmake
|
||||
FindXmlRpcEpi.cmake
|
||||
FMODSTUDIO.cmake
|
||||
FreeType.cmake
|
||||
GeneratePrecompiledHeader.cmake
|
||||
GLOD.cmake
|
||||
GStreamer010Plugin.cmake
|
||||
Glui.cmake
|
||||
Glut.cmake
|
||||
GoogleBreakpad.cmake
|
||||
GooglePerfTools.cmake
|
||||
Hunspell.cmake
|
||||
JPEG.cmake
|
||||
JsonCpp.cmake
|
||||
LLAddBuildTest.cmake
|
||||
LLAppearance.cmake
|
||||
LLAudio.cmake
|
||||
@@ -64,8 +70,9 @@ set(cmake_SOURCE_FILES
|
||||
LLPlugin.cmake
|
||||
LLPrimitive.cmake
|
||||
LLPhysicsExtensions.cmake
|
||||
LLRender.cmake
|
||||
LLSharedLibs.cmake
|
||||
LLQtWebkit.cmake
|
||||
LLRender.cmake
|
||||
LLUI.cmake
|
||||
LLVFS.cmake
|
||||
LLWindow.cmake
|
||||
@@ -84,16 +91,17 @@ set(cmake_SOURCE_FILES
|
||||
Prebuilt.cmake
|
||||
PulseAudio.cmake
|
||||
Python.cmake
|
||||
Qt4.cmake
|
||||
QuickTimePlugin.cmake
|
||||
RunBuildTest.cmake
|
||||
StateMachine.cmake
|
||||
TemplateCheck.cmake
|
||||
Tut.cmake
|
||||
UI.cmake
|
||||
UnixInstall.cmake
|
||||
URIPARSER.cmake
|
||||
Variables.cmake
|
||||
ViewerMiscLibs.cmake
|
||||
WinManifest.cmake
|
||||
LibVLCPlugin.cmake
|
||||
WebKitLibPlugin.cmake
|
||||
XmlRpcEpi.cmake
|
||||
ZLIB.cmake
|
||||
)
|
||||
@@ -102,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})
|
||||
|
||||
@@ -10,11 +10,16 @@ else (STANDALONE)
|
||||
use_prebuilt_binary(curl)
|
||||
if (WINDOWS)
|
||||
set(CURL_LIBRARIES
|
||||
debug libcurl_a_debug
|
||||
optimized libcurl_a)
|
||||
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)
|
||||
|
||||
|
||||
@@ -6,17 +6,17 @@ SET(DEBUG_PKG_CONFIG "YES")
|
||||
IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
|
||||
|
||||
# Guess at architecture-specific system library paths.
|
||||
if (ADDRESS_SIZE EQUAL 32)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib32 /usr/lib)
|
||||
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib32 /usr/local/lib)
|
||||
SET(PKG_CONFIG_MULTI_GUESS /usr/lib/i386-linux-gnu)
|
||||
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/i386-linux-gnu)
|
||||
else (ADDRESS_SIZE EQUAL 32)
|
||||
else (WORD_SIZE EQUAL 32)
|
||||
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib)
|
||||
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib)
|
||||
SET(PKG_CONFIG_MULTI_GUESS /usr/lib/x86_64-linux-gnu)
|
||||
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu)
|
||||
endif (ADDRESS_SIZE EQUAL 32)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
|
||||
# Use DPKG architecture, if available.
|
||||
IF (${DPKG_ARCH})
|
||||
|
||||
@@ -1,255 +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)
|
||||
include(Variables)
|
||||
include(LLCommon)
|
||||
|
||||
###################################################################
|
||||
# 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
|
||||
vivoxplatform.dll
|
||||
)
|
||||
if (ADDRESS_SIZE EQUAL 64)
|
||||
list(APPEND vivox_files
|
||||
vivoxsdk_x64.dll
|
||||
ortp_x64.dll
|
||||
)
|
||||
else (ADDRESS_SIZE EQUAL 64)
|
||||
list(APPEND vivox_files
|
||||
vivoxsdk.dll
|
||||
ortp.dll
|
||||
)
|
||||
endif (ADDRESS_SIZE EQUAL 64)
|
||||
|
||||
#*******************************
|
||||
# Misc shared libs
|
||||
|
||||
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
|
||||
set(debug_files
|
||||
libapr-1.dll
|
||||
libaprutil-1.dll
|
||||
libapriconv-1.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
|
||||
glod.dll
|
||||
libhunspell.dll
|
||||
)
|
||||
|
||||
if(ADDRESS_SIZE EQUAL 64)
|
||||
list(APPEND debug_files
|
||||
libcrypto-1_1-x64.dll
|
||||
libssl-1_1-x64.dll
|
||||
)
|
||||
list(APPEND release_files
|
||||
libcrypto-1_1-x64.dll
|
||||
libssl-1_1-x64.dll
|
||||
)
|
||||
else(ADDRESS_SIZE EQUAL 64)
|
||||
list(APPEND debug_files
|
||||
libcrypto-1_1.dll
|
||||
libssl-1_1.dll
|
||||
)
|
||||
list(APPEND release_files
|
||||
libcrypto-1_1.dll
|
||||
libssl-1_1.dll
|
||||
)
|
||||
endif(ADDRESS_SIZE EQUAL 64)
|
||||
|
||||
if(NOT DISABLE_TCMALLOC)
|
||||
list(APPEND debug_files libtcmalloc_minimal-debug.dll)
|
||||
list(APPEND release_files libtcmalloc_minimal.dll)
|
||||
endif(NOT DISABLE_TCMALLOC)
|
||||
|
||||
if(OPENAL)
|
||||
list(APPEND debug_files alut.dll OpenAL32.dll)
|
||||
list(APPEND release_files alut.dll OpenAL32.dll)
|
||||
endif(OPENAL)
|
||||
|
||||
if (USE_FMODSTUDIO)
|
||||
list(APPEND debug_files fmodL.dll)
|
||||
list(APPEND release_files fmod.dll)
|
||||
endif (USE_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 (USE_FMODSTUDIO)
|
||||
list(APPEND debug_files libfmodL.dylib)
|
||||
list(APPEND release_files libfmod.dylib)
|
||||
endif (USE_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
|
||||
)
|
||||
# *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
|
||||
libexpat.so
|
||||
libexpat.so.1
|
||||
libGLOD.so
|
||||
libopenal.so
|
||||
)
|
||||
|
||||
if (USE_TCMALLOC)
|
||||
list(APPEND release_files "libtcmalloc_minimal.so")
|
||||
endif (USE_TCMALLOC)
|
||||
|
||||
if (USE_FMODSTUDIO)
|
||||
list(APPEND debug_files "libfmodL.so")
|
||||
list(APPEND release_files "libfmod.so")
|
||||
endif (USE_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)
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
include(Variables)
|
||||
|
||||
if(USE_CRASHPAD)
|
||||
|
||||
if (USESYSTEMLIBS)
|
||||
else (USESYSTEMLIBS)
|
||||
use_prebuilt_binary(crashpad)
|
||||
if (WINDOWS)
|
||||
set(CRASHPAD_LIBRARIES
|
||||
debug client.lib util.lib base.lib
|
||||
optimized client.lib util.lib base.lib)
|
||||
elseif (LINUX)
|
||||
|
||||
else (DARWIN)
|
||||
|
||||
endif ()
|
||||
set(CRASHPAD_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/crashpad)
|
||||
endif (USESYSTEMLIBS)
|
||||
|
||||
endif()
|
||||
@@ -1,11 +1,25 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (LINUX)
|
||||
if (STANDALONE)
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
|
||||
|
||||
endif (LINUX)
|
||||
elseif (LINUX)
|
||||
use_prebuilt_binary(dbusglib)
|
||||
set(DBUSGLIB_FOUND ON FORCE BOOL)
|
||||
set(DBUSGLIB_INCLUDE_DIRS
|
||||
${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
|
||||
gobject-2.0
|
||||
glib-2.0
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
if (DBUSGLIB_FOUND)
|
||||
set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.")
|
||||
|
||||
@@ -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 (USE_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)
|
||||
@@ -11,40 +73,40 @@ if (USE_FMODSTUDIO)
|
||||
set(lib_suffix .so)
|
||||
endif(WINDOWS)
|
||||
if(WINDOWS)
|
||||
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmod${lib_suffix})
|
||||
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodL${lib_suffix})
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmod64${lib_suffix})
|
||||
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodL64${lib_suffix})
|
||||
else(WORD_SIZE EQUAL 64)
|
||||
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/fmod${lib_suffix})
|
||||
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/fmodL${lib_suffix})
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
else(WINDOWS)
|
||||
set(FMOD_LIBRARY_RELEASE ${LIBS_PREBUILT_DIR}/lib/release/libfmod${lib_suffix})
|
||||
set(FMOD_LIBRARY_DEBUG ${LIBS_PREBUILT_DIR}/lib/debug/libfmodL${lib_suffix})
|
||||
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(fmodstudio)
|
||||
set(FMOD_INCLUDE_DIR
|
||||
${LIBS_PREBUILT_DIR}/include/fmodstudio)
|
||||
endif(NOT FMOD_LIBRARY_RELEASE OR NOT FMOD_INCLUDE_DIR)
|
||||
|
||||
set (FMOD_LIBRARY
|
||||
debug ${FMOD_LINK_LIBRARY_DEBUG}
|
||||
optimized ${FMOD_LINK_LIBRARY_RELEASE}
|
||||
)
|
||||
|
||||
set(FMODSTUDIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio)
|
||||
endif(USE_FMODSTUDIO)
|
||||
|
||||
if(FMOD_LIBRARY_RELEASE AND FMODSTUDIO_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 FMODSTUDIO_INCLUDE_DIR)
|
||||
else (FMOD_LIBRARY_RELEASE AND FMOD_INCLUDE_DIR)
|
||||
message(STATUS "No support for FMOD Studio audio (need to set FMODSTUDIO_SDK_DIR?)")
|
||||
set(FMOD OFF)
|
||||
set(USE_FMODSTUDIO OFF)
|
||||
endif (FMOD_LIBRARY_RELEASE AND FMODSTUDIO_INCLUDE_DIR)
|
||||
set(FMODSTUDIO OFF)
|
||||
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")
|
||||
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
|
||||
)
|
||||
40
indra/cmake/FindGoogleBreakpad.cmake
Normal file
40
indra/cmake/FindGoogleBreakpad.cmake
Normal file
@@ -0,0 +1,40 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# - Find Google BreakPad
|
||||
# Find the Google BreakPad includes and library
|
||||
# This module defines
|
||||
# BREAKPAD_INCLUDE_DIRECTORIES, where to find the Goole BreakPad includes.
|
||||
# BREAKPAD_EXCEPTION_HANDLER_LIBRARIES, the libraries needed to use Google BreakPad.
|
||||
# BREAKPAD_EXCEPTION_HANDLER_FOUND, If false, do not try to use Google BreakPad.
|
||||
# also defined, but not for general use are
|
||||
# BREAKPAD_EXCEPTION_HANDLER_LIBRARY, where to find the Google BreakPad library.
|
||||
|
||||
FIND_PATH(BREAKPAD_INCLUDE_DIRECTORIES common/using_std_string.h PATH_SUFFIXES google_breakpad)
|
||||
|
||||
SET(BREAKPAD_EXCEPTION_HANDLER_NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} breakpad_client)
|
||||
FIND_LIBRARY(BREAKPAD_EXCEPTION_HANDLER_LIBRARY
|
||||
NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES}
|
||||
)
|
||||
|
||||
IF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||
SET(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY})
|
||||
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "YES")
|
||||
ELSE (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||
SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "NO")
|
||||
ENDIF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES)
|
||||
|
||||
|
||||
IF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
||||
IF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Google BreakPad: ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}")
|
||||
ENDIF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
|
||||
ELSE (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
||||
IF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find Google BreakPad library")
|
||||
ENDIF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)
|
||||
ENDIF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
BREAKPAD_EXCEPTION_HANDLER_LIBRARY
|
||||
BREAKPAD_INCLUDE_DIRECTORIES
|
||||
)
|
||||
39
indra/cmake/FindJsonCpp.cmake
Normal file
39
indra/cmake/FindJsonCpp.cmake
Normal file
@@ -0,0 +1,39 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# - Find JSONCpp
|
||||
# Find the JSONCpp includes and library
|
||||
# This module defines
|
||||
# JSONCPP_FOUND, System has libjsoncpp.
|
||||
# JSONCPP_INCLUDE_DIRS - The libjsoncpp include directories.
|
||||
# JSONCPP_LIBRARIES - The libraries needed to use libjsoncpp.
|
||||
# JSONCPP_DEFINITIONS - Compiler switches required for using libjsoncpp.
|
||||
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
PKG_CHECK_MODULES(PC_JSONCPP jsoncpp)
|
||||
SET(JSONCPP_DEFINITIONS ${PC_JSONCPP_CFLAGS_OTHER})
|
||||
|
||||
FIND_PATH(JSONCPP_INCLUDE_DIR json/reader.h
|
||||
HINTS ${PC_JSONCPP_INCLUDE_DIR} ${PC_JSONCPP_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES jsoncpp)
|
||||
|
||||
# Get the GCC compiler version
|
||||
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
|
||||
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE _gcc_COMPILER_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Try to find a library that was compiled with the same compiler version as we currently use.
|
||||
FIND_LIBRARY(JSONCPP_LIBRARY
|
||||
NAMES libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so libjsoncpp.so
|
||||
HINTS ${PC_JSONCPP_LIBDIR} ${PC_JSONCPP_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib)
|
||||
|
||||
SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
|
||||
SET(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JSONCPP DEFAULT_MSG
|
||||
JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(JSONCPP_LIBRARY JSONCPP_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
|
||||
)
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# - Find uriparser
|
||||
# Find the URIPARSER includes and library
|
||||
# This module defines
|
||||
# URIPARSER_INCLUDE_DIRS, where to find uriparser.h, etc.
|
||||
# URIPARSER_LIBRARY, the libraries needed to use uriparser.
|
||||
# URIPARSER_FOUND, If false, do not try to use uriparser.
|
||||
#
|
||||
# This FindURIPARSER is about 43 times as fast the one provided with cmake (2.8.x),
|
||||
# because it doesn't look up the version of uriparser, resulting in a dramatic
|
||||
# speed up for configure (from 4 minutes 22 seconds to 6 seconds).
|
||||
#
|
||||
# Note: Since this file is only used for standalone, the windows
|
||||
# specific parts were left out.
|
||||
|
||||
FIND_PATH(URIPARSER_INCLUDE_DIR uriparser/Uri.h
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(URIPARSER_LIBRARY uriparser)
|
||||
|
||||
if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
|
||||
SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR})
|
||||
SET(URIPARSER_LIBRARY ${URIPARSER_LIBRARY})
|
||||
SET(URIPARSER_FOUND "YES")
|
||||
else (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
|
||||
SET(URIPARSER_FOUND "NO")
|
||||
endif (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
|
||||
|
||||
if (URIPARSER_FOUND)
|
||||
if (NOT URIPARSER_FIND_QUIETLY)
|
||||
message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARY}")
|
||||
SET(URIPARSER_FIND_QUIETLY TRUE)
|
||||
endif (NOT URIPARSER_FIND_QUIETLY)
|
||||
else (URIPARSER_FOUND)
|
||||
if (URIPARSER_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find URIPARSER library")
|
||||
endif (URIPARSER_FIND_REQUIRED)
|
||||
endif (URIPARSER_FOUND)
|
||||
|
||||
mark_as_advanced(
|
||||
URIPARSER_LIBRARY
|
||||
URIPARSER_INCLUDE_DIR
|
||||
)
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (LINUX)
|
||||
if (STANDALONE)
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
||||
else (LINUX)
|
||||
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 (LINUX)
|
||||
endif (STANDALONE)
|
||||
|
||||
link_directories(${FREETYPE_LIBRARY_DIRS})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# Distributed under the MIT Software License
|
||||
# Copyright (c) 2015-2017 Borislav Stanimirov
|
||||
# Modifications Copyright (c) 2019 Cinder Roxley. All rights reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
# this software and associated documentation files (the "Software"), to deal in
|
||||
# the Software without restriction, including without limitation the rights to
|
||||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
# of the Software, and to permit persons to whom the Software is furnished to do
|
||||
# so, subject to the following conditions:
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
# target_precompiled_header
|
||||
#
|
||||
# Sets a precompiled header for a given target
|
||||
# Args:
|
||||
# TARGET_NAME - Name of the target. Only valid after add_library or add_executable
|
||||
# PRECOMPILED_HEADER - Header file to precompile
|
||||
# PRECOMPILED_SOURCE - MSVC specific source to do the actual precompilation. Ignored on other platforms
|
||||
#
|
||||
|
||||
macro(target_precompiled_header TARGET_NAME PRECOMPILED_HEADER PRECOMPILED_SOURCE)
|
||||
get_filename_component(PRECOMPILED_HEADER_NAME ${PRECOMPILED_HEADER} NAME)
|
||||
|
||||
if(MSVC)
|
||||
get_filename_component(PRECOMPILED_SOURCE_NAME ${PRECOMPILED_SOURCE} NAME)
|
||||
get_filename_component(PRECOMPILED_HEADER_PATH ${PRECOMPILED_HEADER} DIRECTORY)
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${PRECOMPILED_HEADER_PATH}) # fixes occasional IntelliSense glitches
|
||||
|
||||
get_filename_component(PRECOMPILED_HEADER_WE ${PRECOMPILED_HEADER} NAME_WE)
|
||||
if(GEN_IS_MULTI_CONFIG)
|
||||
set(PRECOMPILED_BINARY "$(IntDir)/${PRECOMPILED_HEADER_WE}.pch")
|
||||
else()
|
||||
set(PRECOMPILED_BINARY "${CMAKE_CURRENT_BINARY_DIR}/${PRECOMPILED_HEADER_WE}.pch")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${PRECOMPILED_SOURCE} PROPERTIES
|
||||
COMPILE_OPTIONS "/Yc${PRECOMPILED_HEADER_NAME};/Fp${PRECOMPILED_BINARY}"
|
||||
OBJECT_OUTPUTS "${PRECOMPILED_BINARY}")
|
||||
|
||||
get_target_property(TARGET_SOURCES ${TARGET_NAME} SOURCES)
|
||||
foreach(src ${TARGET_SOURCES})
|
||||
if(${src} MATCHES \\.\(cpp|cxx|cc\)$)
|
||||
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${src}" PROPERTIES
|
||||
COMPILE_OPTIONS "/Yu${PRECOMPILED_HEADER_NAME};/FI${PRECOMPILED_HEADER_NAME};/Fp${PRECOMPILED_BINARY}"
|
||||
OBJECT_DEPENDS "${PRECOMPILED_BINARY}"
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
#set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
# COMPILE_OPTIONS "/Yu${PRECOMPILED_HEADER_NAME};/FI${PRECOMPILED_HEADER_NAME};/Fp${PRECOMPILED_BINARY}")
|
||||
|
||||
target_sources(${TARGET_NAME} PRIVATE ${PRECOMPILED_SOURCE} ${PRECOMPILED_HEADER})
|
||||
elseif(CMAKE_GENERATOR STREQUAL Xcode)
|
||||
set_target_properties(
|
||||
${TARGET_NAME}
|
||||
PROPERTIES
|
||||
XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${PRECOMPILED_HEADER}"
|
||||
XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES"
|
||||
)
|
||||
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Create and set output directory.
|
||||
set(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${PRECOMPILED_HEADER_NAME}.gch")
|
||||
make_directory(${OUTPUT_DIR})
|
||||
set(OUTPUT_NAME "${OUTPUT_DIR}/${PRECOMPILED_HEADER_NAME}.gch")
|
||||
|
||||
# Export compiler flags via a generator to a response file
|
||||
set(PCH_FLAGS_FILE "${OUTPUT_DIR}/${PRECOMPILED_HEADER_NAME}.rsp")
|
||||
set(_include_directories "$<TARGET_PROPERTY:${TARGET_NAME},INCLUDE_DIRECTORIES>")
|
||||
set(_compile_definitions "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_DEFINITIONS>")
|
||||
set(_compile_flags "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_FLAGS>")
|
||||
set(_compile_options "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_OPTIONS>")
|
||||
set(_include_directories "$<$<BOOL:${_include_directories}>:-I$<JOIN:${_include_directories},\n-I>\n>")
|
||||
set(_compile_definitions "$<$<BOOL:${_compile_definitions}>:-D$<JOIN:${_compile_definitions},\n-D>\n>")
|
||||
set(_compile_flags "$<$<BOOL:${_compile_flags}>:$<JOIN:${_compile_flags},\n>\n>")
|
||||
set(_compile_options "$<$<BOOL:${_compile_options}>:$<JOIN:${_compile_options},\n>\n>")
|
||||
file(GENERATE OUTPUT "${PCH_FLAGS_FILE}" CONTENT "${_compile_definitions}${_include_directories}${_compile_flags}${_compile_options}\n")
|
||||
|
||||
# Gather global compiler options, definitions, etc.
|
||||
string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" CXX_FLAGS)
|
||||
set(COMPILER_FLAGS "${${CXX_FLAGS}} ${CMAKE_CXX_FLAGS}")
|
||||
separate_arguments(COMPILER_FLAGS)
|
||||
|
||||
# Add a custom target for building the precompiled header.
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_NAME}
|
||||
COMMAND ${CMAKE_CXX_COMPILER} @${PCH_FLAGS_FILE} ${COMPILER_FLAGS} -x c++-header -o ${OUTPUT_NAME} ${PRECOMPILED_HEADER}
|
||||
DEPENDS ${PRECOMPILED_HEADER})
|
||||
add_custom_target(${TARGET_NAME}_gch DEPENDS ${OUTPUT_NAME})
|
||||
add_dependencies(${TARGET_NAME} ${TARGET_NAME}_gch)
|
||||
|
||||
# set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_FLAGS "-include ${PRECOMPILED_HEADER_NAME} -Winvalid-pch")
|
||||
get_target_property(SOURCE_FILES ${TARGET_NAME} SOURCES)
|
||||
get_target_property(asdf ${TARGET_NAME} COMPILE_FLAGS)
|
||||
foreach(SOURCE_FILE ${SOURCE_FILES})
|
||||
if(SOURCE_FILE MATCHES \\.\(c|cc|cxx|cpp\)$)
|
||||
set_source_files_properties(${SOURCE_FILE} PROPERTIES
|
||||
COMPILE_FLAGS "-include ${OUTPUT_DIR}/${PRECOMPILED_HEADER_NAME} -Winvalid-pch"
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown generator for target_precompiled_header. [${CMAKE_CXX_COMPILER_ID}]")
|
||||
endif()
|
||||
endmacro(target_precompiled_header)
|
||||
|
||||
26
indra/cmake/GoogleBreakpad.cmake
Normal file
26
indra/cmake/GoogleBreakpad.cmake
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (STANDALONE)
|
||||
set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
|
||||
include(FindGoogleBreakpad)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(google_breakpad)
|
||||
if (DARWIN)
|
||||
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
|
||||
endif (DARWIN)
|
||||
if (LINUX)
|
||||
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client)
|
||||
endif (LINUX)
|
||||
if (WINDOWS)
|
||||
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client crash_generation_server common)
|
||||
endif (WINDOWS)
|
||||
# yes, this does look dumb, no, it's not incorrect
|
||||
# I think it's incorrect: the second one should go --Aleric
|
||||
set(BREAKPAD_INCLUDE_DIRECTORIES
|
||||
${LIBS_PREBUILT_DIR}/include/google_breakpad
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/google_breakpad
|
||||
${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/google_breakpad/google_breakpad
|
||||
)
|
||||
endif (STANDALONE)
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
include(Prebuilt)
|
||||
|
||||
if(ADDRESS_SIZE EQUAL 64)
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
set(DISABLE_TCMALLOC TRUE)
|
||||
endif(ADDRESS_SIZE EQUAL 64)
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
|
||||
if (STANDALONE)
|
||||
include(FindGooglePerfTools)
|
||||
else (STANDALONE)
|
||||
if (LINUX OR WINDOWS AND NOT ADDRESS_SIZE EQUAL 64)
|
||||
if (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64)
|
||||
use_prebuilt_binary(gperftools)
|
||||
endif (LINUX OR WINDOWS AND NOT ADDRESS_SIZE EQUAL 64)
|
||||
endif (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64)
|
||||
if (WINDOWS AND NOT DISABLE_TCMALLOC)
|
||||
set(TCMALLOC_LIBRARIES libtcmalloc_minimal.lib)
|
||||
set(TCMALLOC_LINKER_FLAGS "/INCLUDE:\"__tcmalloc\"")
|
||||
|
||||
@@ -4,13 +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)
|
||||
use_prebuilt_binary(dictionaries)
|
||||
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)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Prebuilt)
|
||||
|
||||
use_prebuilt_binary(modernjson)
|
||||
set(JSON_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include")
|
||||
31
indra/cmake/JsonCpp.cmake
Normal file
31
indra/cmake/JsonCpp.cmake
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Prebuilt)
|
||||
|
||||
set(JSONCPP_FIND_QUIETLY OFF)
|
||||
set(JSONCPP_FIND_REQUIRED ON)
|
||||
|
||||
if (STANDALONE)
|
||||
include(FindJsonCpp)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(jsoncpp)
|
||||
if (WINDOWS)
|
||||
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/jsoncpp
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/jsoncpp
|
||||
)
|
||||
endif (STANDALONE)
|
||||
@@ -105,6 +105,17 @@ MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files)
|
||||
IF (NOT "$ENV{LD_LIBRARY_PATH}" STREQUAL "")
|
||||
SET(LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}")
|
||||
ENDIF (NOT "$ENV{LD_LIBRARY_PATH}" STREQUAL "")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${TEST_OUTPUT}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
"-DLD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
|
||||
"-DTEST_CMD:STRING=${TEST_CMD}"
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
|
||||
DEPENDS ${name}_test
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(${name}_test_ok ALL DEPENDS ${TEST_OUTPUT})
|
||||
IF (${parent})
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Audio)
|
||||
include(OPENAL)
|
||||
|
||||
set(LLAUDIO_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llaudio
|
||||
)
|
||||
|
||||
#add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
|
||||
add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
|
||||
|
||||
set(LLAUDIO_LIBRARIES llaudio ${OPENAL_LIBRARIES})
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
include(APR)
|
||||
include(Boost)
|
||||
include(EXPAT)
|
||||
include(Linking)
|
||||
include(ZLIB)
|
||||
|
||||
if (DARWIN)
|
||||
@@ -11,6 +10,7 @@ if (DARWIN)
|
||||
find_library(CORESERVICES_LIBRARY CoreServices)
|
||||
endif (DARWIN)
|
||||
|
||||
|
||||
set(LLCOMMON_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/cwdebug
|
||||
${LIBS_OPEN_DIR}/llcommon
|
||||
@@ -19,11 +19,16 @@ set(LLCOMMON_INCLUDE_DIRS
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(LLCOMMON_LIBRARIES llcommon
|
||||
fmt::fmt
|
||||
)
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llcommon uses.
|
||||
# llcommon uses `clock_gettime' which is provided by librt on linux.
|
||||
set(LLCOMMON_LIBRARIES llcommon rt)
|
||||
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)
|
||||
|
||||
@@ -5,4 +5,10 @@ set(LLPLUGIN_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llplugin
|
||||
)
|
||||
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llplugin uses.
|
||||
set(LLPLUGIN_LIBRARIES llplugin pthread)
|
||||
else (LINUX)
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
endif (LINUX)
|
||||
|
||||
@@ -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,40 +1,33 @@
|
||||
# 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(TARGET_LOCATION $<TARGET_FILE:${target_exe}>)
|
||||
get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH)
|
||||
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)
|
||||
SET_TEST_PATH(SEARCH_DIRS)
|
||||
LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32")
|
||||
elseif(LINUX)
|
||||
SET_TEST_PATH(SEARCH_DIRS)
|
||||
set(OUTPUT_PATH ${OUTPUT_PATH}/lib)
|
||||
endif(DARWIN)
|
||||
|
||||
# It's not clear that this does anything useful for us on Darwin. It has
|
||||
# been broken for some time now; the BIN_NAME was being constructed as a
|
||||
# ridiculous nonexistent path with duplicated segments. Fixing that only
|
||||
# produces ominous spammy warnings: at the time the command below is run, we
|
||||
# have not yet populated the nested mac-crash-logger.app/Contents/Resources
|
||||
# with the .dylibs with which it was linked. Moreover, the form of the
|
||||
# embedded @executable_path/../Resources/mumble.dylib pathname confuses the
|
||||
# GetPrerequisites.cmake tool invoked by DeploySharedLibs.cmake. It seems
|
||||
# clear that we have long since accomplished by other means what this was
|
||||
# originally supposed to do. Skipping it only eliminates an annoying
|
||||
# non-fatal error.
|
||||
if(NOT DARWIN)
|
||||
if(WINDOWS)
|
||||
SET_TEST_PATH(SEARCH_DIRS)
|
||||
LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32")
|
||||
elseif(LINUX)
|
||||
SET_TEST_PATH(SEARCH_DIRS)
|
||||
set(OUTPUT_PATH ${OUTPUT_PATH}/lib)
|
||||
endif(WINDOWS)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target_exe} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS
|
||||
"-DBIN_NAME=\"${TARGET_LOCATION}\""
|
||||
"-DSEARCH_DIRS=\"${SEARCH_DIRS}\""
|
||||
"-DDST_PATH=\"${OUTPUT_PATH}\""
|
||||
"-P"
|
||||
"${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake"
|
||||
)
|
||||
endif(NOT DARWIN)
|
||||
add_custom_command(
|
||||
TARGET ${target_exe} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS
|
||||
"-DBIN_NAME=\"$<TARGET_FILE:${target_exe}>\""
|
||||
"-DSEARCH_DIRS=\"${SEARCH_DIRS}\""
|
||||
"-DDST_PATH=\"${OUTPUT_PATH}\""
|
||||
"-P"
|
||||
"${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake"
|
||||
)
|
||||
|
||||
endmacro(ll_deploy_sharedlibs_command)
|
||||
|
||||
@@ -45,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)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(OpenGL)
|
||||
include(Prebuilt)
|
||||
|
||||
if (LINUX)
|
||||
if (STANDALONE)
|
||||
include(FindSDL)
|
||||
|
||||
# This should be done by FindSDL. Sigh.
|
||||
@@ -11,7 +12,22 @@ if (LINUX)
|
||||
SDL_INCLUDE_DIR
|
||||
SDL_LIBRARY
|
||||
)
|
||||
endif (LINUX)
|
||||
else (STANDALONE)
|
||||
if (LINUX)
|
||||
use_prebuilt_binary(mesa)
|
||||
use_prebuilt_binary(SDL)
|
||||
set (SDL_FOUND TRUE)
|
||||
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)
|
||||
|
||||
if (SDL_FOUND)
|
||||
add_definitions(-DLL_SDL=1)
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
include(Variables)
|
||||
|
||||
if (LIBVLCPLUGIN)
|
||||
if (USESYSTEMLIBS)
|
||||
else (USESYSTEMLIBS)
|
||||
use_prebuilt_binary(vlc-bin)
|
||||
set(VLC_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/vlc)
|
||||
endif (USESYSTEMLIBS)
|
||||
|
||||
if (WINDOWS)
|
||||
set(VLC_PLUGIN_LIBRARIES
|
||||
libvlc.lib
|
||||
libvlccore.lib
|
||||
)
|
||||
elseif (DARWIN)
|
||||
set(VLC_PLUGIN_LIBRARIES
|
||||
libvlc.dylib
|
||||
libvlccore.dylib
|
||||
)
|
||||
elseif (LINUX)
|
||||
# Specify a full path to make sure we get a static link
|
||||
set(VLC_PLUGIN_LIBRARIES
|
||||
${LIBS_PREBUILT_DIR}/lib/libvlc.a
|
||||
${LIBS_PREBUILT_DIR}/lib/libvlccore.a
|
||||
)
|
||||
endif (WINDOWS)
|
||||
endif (LIBVLCPLUGIN)
|
||||
@@ -1,66 +1,55 @@
|
||||
# -*- 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(GEN_IS_MULTI_CONFIG)
|
||||
# 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()
|
||||
# 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()
|
||||
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)
|
||||
set(RT_LIBRARY rt)
|
||||
set(PTHREAD_LIBRARY pthread)
|
||||
else (LINUX)
|
||||
set(DL_LIBRARY "")
|
||||
set(RT_LIBRARY "")
|
||||
set(PTHREAD_LIBRARY "")
|
||||
endif (LINUX)
|
||||
|
||||
if (WINDOWS)
|
||||
if (WINDOWS)
|
||||
set(WINDOWS_LIBRARIES
|
||||
advapi32
|
||||
shell32
|
||||
ole32
|
||||
ws2_32
|
||||
mswsock
|
||||
psapi
|
||||
@@ -75,6 +64,6 @@ else (WINDOWS)
|
||||
set(WINDOWS_LIBRARIES "")
|
||||
endif (WINDOWS)
|
||||
|
||||
mark_as_advanced(DL_LIBRARY RT_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES)
|
||||
mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES)
|
||||
|
||||
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
|
||||
|
||||
@@ -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,18 +2,20 @@
|
||||
include(Prebuilt)
|
||||
include(Variables)
|
||||
|
||||
if (USE_NVAPI)
|
||||
set(NVAPI ON CACHE BOOL "Use NVAPI.")
|
||||
|
||||
if (NVAPI)
|
||||
if (WINDOWS)
|
||||
use_prebuilt_binary(nvapi)
|
||||
if (ADDRESS_SIZE EQUAL 32)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(NVAPI_LIBRARY nvapi)
|
||||
elseif (ADDRESS_SIZE EQUAL 64)
|
||||
elseif (WORD_SIZE EQUAL 64)
|
||||
set(NVAPI_LIBRARY nvapi64)
|
||||
endif (ADDRESS_SIZE EQUAL 32)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
else (WINDOWS)
|
||||
set(NVAPI_LIBRARY "")
|
||||
endif (WINDOWS)
|
||||
else (USE_NVAPI)
|
||||
else (NVAPI)
|
||||
set(NVAPI_LIBRARY "")
|
||||
endif (USE_NVAPI)
|
||||
endif (NVAPI)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
include(Linking)
|
||||
include(Prebuilt)
|
||||
|
||||
if(NOT FMOD)
|
||||
if (LINUX)
|
||||
set(OPENAL ON CACHE BOOL "Enable OpenAL")
|
||||
else (LINUX)
|
||||
@@ -9,25 +10,26 @@ else (LINUX)
|
||||
endif (LINUX)
|
||||
|
||||
if (OPENAL)
|
||||
set(OPENAL_LIB_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/AL")
|
||||
if (STANDALONE)
|
||||
include(FindPkgConfig)
|
||||
include(FindOpenAL)
|
||||
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)
|
||||
if(WINDOWS)
|
||||
set(OPENAL_LIBRARIES
|
||||
OpenAL32
|
||||
openal
|
||||
alut
|
||||
)
|
||||
else()
|
||||
set(OPENAL_LIBRARIES
|
||||
openal
|
||||
alut
|
||||
)
|
||||
endif()
|
||||
message(STATUS "Building with OpenAL audio support")
|
||||
set(OPENAL_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (OPENAL)
|
||||
|
||||
if (OPENAL)
|
||||
message(STATUS "Building with OpenAL audio support")
|
||||
set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_OPENAL")
|
||||
endif (OPENAL)
|
||||
endif(NOT FMOD)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Variables)
|
||||
include(Prebuilt)
|
||||
|
||||
if (NOT (STANDALONE OR DARWIN))
|
||||
@@ -10,5 +8,3 @@ if (NOT (STANDALONE OR DARWIN))
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include
|
||||
)
|
||||
endif (NOT (STANDALONE OR DARWIN))
|
||||
|
||||
include(FindOpenGL)
|
||||
|
||||
@@ -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 libssl libcrypto)
|
||||
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,62 +3,14 @@
|
||||
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
|
||||
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
|
||||
|
||||
include(FindAutobuild)
|
||||
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(STATUS "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}
|
||||
${_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
|
||||
|
||||
@@ -5,30 +5,22 @@ set(PYTHONINTERP_FOUND)
|
||||
if (WINDOWS)
|
||||
# On Windows, explicitly avoid Cygwin Python.
|
||||
|
||||
if (DEFINED ENV{VIRTUAL_ENV})
|
||||
find_program(PYTHON_EXECUTABLE
|
||||
NAMES python.exe
|
||||
PATHS
|
||||
"$ENV{VIRTUAL_ENV}\\scripts"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
else()
|
||||
find_program(PYTHON_EXECUTABLE
|
||||
NAMES python25.exe python23.exe python.exe
|
||||
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
|
||||
)
|
||||
endif()
|
||||
find_program(PYTHON_EXECUTABLE
|
||||
NAMES python25.exe python23.exe python.exe
|
||||
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
|
||||
)
|
||||
|
||||
|
||||
elseif (EXISTS /etc/arch-release)
|
||||
# On Archlinux, use Python 2
|
||||
|
||||
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)
|
||||
58
indra/cmake/QuickTimePlugin.cmake
Normal file
58
indra/cmake/QuickTimePlugin.cmake
Normal file
@@ -0,0 +1,58 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
if(INSTALL_PROPRIETARY)
|
||||
include(Prebuilt)
|
||||
use_prebuilt_binary(quicktime)
|
||||
endif(INSTALL_PROPRIETARY)
|
||||
|
||||
if (DARWIN)
|
||||
include(CMakeFindFrameworks)
|
||||
find_library(QUICKTIME_LIBRARY QuickTime)
|
||||
elseif (WINDOWS AND WORD_SIZE EQUAL 32)
|
||||
SET(program_files "ProgramFiles(x86)")
|
||||
SET(program_files $ENV{${program_files}})
|
||||
if(NOT program_files)
|
||||
SET(program_files $ENV{ProgramW6432})
|
||||
endif(NOT program_files)
|
||||
if(NOT program_files)
|
||||
SET(program_files $ENV{ProgramFiles})
|
||||
endif(NOT program_files)
|
||||
|
||||
set(QUICKTIME_SDK_DIR "${program_files}/QuickTime SDK"
|
||||
CACHE PATH "Location of the QuickTime SDK.")
|
||||
|
||||
find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient
|
||||
PATHS
|
||||
${LIBS_PREBUILT_DIR}/lib/debug
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/lib/debug
|
||||
"${QUICKTIME_SDK_DIR}\\libraries"
|
||||
)
|
||||
|
||||
find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient
|
||||
PATHS
|
||||
${LIBS_PREBUILT_DIR}/lib/release
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
|
||||
"${QUICKTIME_SDK_DIR}\\libraries"
|
||||
)
|
||||
|
||||
if (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
|
||||
set(QUICKTIME_LIBRARY
|
||||
optimized ${RELEASE_QUICKTIME_LIBRARY}
|
||||
debug ${DEBUG_QUICKTIME_LIBRARY}
|
||||
)
|
||||
|
||||
endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
|
||||
|
||||
include_directories(
|
||||
${LIBS_PREBUILT_DIR}/include/quicktime
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/quicktime
|
||||
"${QUICKTIME_SDK_DIR}\\CIncludes"
|
||||
)
|
||||
endif (DARWIN)
|
||||
|
||||
mark_as_advanced(QUICKTIME_LIBRARY)
|
||||
|
||||
if (QUICKTIME_LIBRARY)
|
||||
set(QUICKTIME ON CACHE BOOL "Build with QuickTime streaming media support.")
|
||||
endif (QUICKTIME_LIBRARY)
|
||||
|
||||
20
indra/cmake/RunBuildTest.cmake
Normal file
20
indra/cmake/RunBuildTest.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
#This cmake script is meant to be run as a build time custom command.
|
||||
#The script is run using cmake w/ the -P option.
|
||||
# parameters are passed to this scripts execution with the -D option.
|
||||
# A full command line would look like this:
|
||||
# cmake -D LD_LIBRARY_PATH=~/checkout/libraries -D TEST_CMD=./llunit_test -D ARGS=--touch=llunit_test_ok.txt -P RunBuildTest.cmake
|
||||
|
||||
# Parameters:
|
||||
# LD_LIBRARY_PATH: string, What to set the LD_LIBRARY_PATH env var.
|
||||
# TEST_CMD: string list, command to run the unit test with, followed by its args.
|
||||
set(ENV{LD_LIBRARY_PATH} ${LD_LIBRARY_PATH})
|
||||
#message("Running: ${TEST_CMD}")
|
||||
execute_process(
|
||||
COMMAND ${TEST_CMD}
|
||||
RESULT_VARIABLE RES
|
||||
)
|
||||
|
||||
if(NOT ${RES} STREQUAL 0)
|
||||
message(STATUS "Failure running: ${TEST_CMD}")
|
||||
message(FATAL_ERROR "Error: ${RES}")
|
||||
endif(NOT ${RES} STREQUAL 0)
|
||||
@@ -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,9 +1,10 @@
|
||||
# -*- cmake -*-
|
||||
include(FreeType)
|
||||
include(Prebuilt)
|
||||
|
||||
if (LINUX)
|
||||
if (STANDALONE)
|
||||
include(FindPkgConfig)
|
||||
|
||||
|
||||
if (LINUX)
|
||||
set(PKGCONFIG_PACKAGES
|
||||
atk
|
||||
cairo
|
||||
@@ -19,8 +20,8 @@ if (LINUX)
|
||||
pangox
|
||||
pangoxft
|
||||
sdl
|
||||
x11
|
||||
)
|
||||
endif (LINUX)
|
||||
|
||||
foreach(pkg ${PKGCONFIG_PACKAGES})
|
||||
pkg_check_modules(${pkg} REQUIRED ${pkg})
|
||||
@@ -29,6 +30,46 @@ if (LINUX)
|
||||
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
|
||||
add_definitions(${${pkg}_CFLAGS_OTHERS})
|
||||
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
|
||||
X11
|
||||
gdk-x11-2.0
|
||||
gdk_pixbuf-2.0
|
||||
Xinerama
|
||||
glib-2.0
|
||||
gio-2.0
|
||||
gmodule-2.0
|
||||
gobject-2.0
|
||||
gthread-2.0
|
||||
gtk-x11-2.0
|
||||
pango-1.0
|
||||
pangoft2-1.0
|
||||
pangox-1.0
|
||||
pangoxft-1.0
|
||||
pangocairo-1.0
|
||||
)
|
||||
endif (LINUX)
|
||||
|
||||
include_directories (
|
||||
${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}
|
||||
${LIBS_PREBUILT_LEGACY_DIR}/include/${include}
|
||||
)
|
||||
endforeach(include)
|
||||
endif (STANDALONE)
|
||||
|
||||
if (LINUX)
|
||||
add_definitions(-DLL_GTK=1 -DLL_X11=1)
|
||||
endif (LINUX)
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
set(URIPARSER_FIND_QUIETLY ON)
|
||||
set(URIPARSER_FIND_REQUIRED ON)
|
||||
|
||||
include(Prebuilt)
|
||||
|
||||
if (USESYSTEMLIBS)
|
||||
include(FindURIPARSER)
|
||||
else (USESYSTEMLIBS)
|
||||
use_prebuilt_binary(uriparser)
|
||||
if (WINDOWS)
|
||||
set(URIPARSER_LIBRARY
|
||||
debug uriparserd
|
||||
optimized uriparser)
|
||||
elseif (DARWIN OR LINUX)
|
||||
set(URIPARSER_LIBRARY uriparser)
|
||||
endif (WINDOWS)
|
||||
set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser)
|
||||
endif (USESYSTEMLIBS)
|
||||
@@ -9,7 +9,9 @@
|
||||
# LINUX - Linux
|
||||
# WINDOWS - Windows
|
||||
|
||||
|
||||
# Relative and absolute paths to subtrees.
|
||||
|
||||
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
|
||||
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
|
||||
|
||||
@@ -17,153 +19,60 @@ if(NOT DEFINED COMMON_CMAKE_DIR)
|
||||
set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake")
|
||||
endif(NOT DEFINED COMMON_CMAKE_DIR)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
option(GEN_IS_MULTI_CONFIG "" ${_isMultiConfig})
|
||||
mark_as_advanced(GEN_IS_MULTI_CONFIG)
|
||||
|
||||
set(LIBS_CLOSED_PREFIX)
|
||||
set(LIBS_OPEN_PREFIX)
|
||||
set(SCRIPTS_PREFIX ../scripts)
|
||||
set(VIEWER_PREFIX)
|
||||
set(INTEGRATION_TESTS_PREFIX)
|
||||
|
||||
option(LL_TESTS "Build and run unit and integration tests (disable for build timing runs to reduce variation" OFF)
|
||||
option(BUILD_TESTING "Build test suite" OFF)
|
||||
option(UNATTENDED "Disable use of uneeded tooling for automated builds" OFF)
|
||||
|
||||
# Compiler and toolchain options
|
||||
option(USESYSTEMLIBS "Use libraries from your system rather than Linden-supplied prebuilt libraries." OFF)
|
||||
option(STANDALONE "Use libraries from your system rather than Linden-supplied prebuilt libraries." OFF)
|
||||
if (USESYSTEMLIBS)
|
||||
set(STANDALONE ON)
|
||||
elseif (STANDALONE)
|
||||
set(USESYSTEMLIBS ON)
|
||||
endif (USESYSTEMLIBS)
|
||||
option(INCREMENTAL_LINK "Use incremental linking on win32 builds (enable for faster links on some machines)" OFF)
|
||||
option(USE_PRECOMPILED_HEADERS "Enable use of precompiled header directives where supported." ON)
|
||||
option(USE_LTO "Enable global and interprocedural optimizations" OFF)
|
||||
|
||||
# Configure crash reporting
|
||||
option(USE_CRASHPAD "Build support for crashpad reporting engine" OFF)
|
||||
if (DEFINED ENV{VIEWER_USE_CRASHPAD})
|
||||
set(USE_CRASHPAD $ENV{VIEWER_USE_CRASHPAD})
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{VIEWER_CRASHPAD_URL})
|
||||
set(CRASHPAD_URL $ENV{VIEWER_CRASHPAD_URL} CACHE STRING "Viewer Channel Base Name")
|
||||
else()
|
||||
set(CRASHPAD_URL "" CACHE STRING "Crashpad endpoint url")
|
||||
endif()
|
||||
|
||||
set(VIEWER_SYMBOL_FILE "" CACHE STRING "Name of tarball into which to place symbol files")
|
||||
|
||||
# Media Plugins
|
||||
option(ENABLE_MEDIA_PLUGINS "Turn off building media plugins if they are imported by third-party library mechanism" ON)
|
||||
option(LIBVLCPLUGIN "Turn off building support for libvlc plugin" ON)
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(LIBVLCPLUGIN OFF)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
# Mallocs
|
||||
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.")
|
||||
|
||||
# Audio Engines
|
||||
option(USE_FMODSTUDIO "Build with support for the FMOD Studio audio engine" OFF)
|
||||
|
||||
# Proprietary Library Features
|
||||
option(USE_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(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.")
|
||||
|
||||
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 "https://git.alchemyviewer.org/alchemy/master-message-template/raw/master/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)
|
||||
|
||||
# If someone has specified an address size, use that to determine the
|
||||
# architecture. Otherwise, let the architecture specify the address size.
|
||||
if (ADDRESS_SIZE EQUAL 32)
|
||||
#message(STATUS "ADDRESS_SIZE is 32")
|
||||
set(ARCH i686)
|
||||
elseif (ADDRESS_SIZE EQUAL 64)
|
||||
#message(STATUS "ADDRESS_SIZE is 64")
|
||||
set(ARCH x86_64)
|
||||
else (ADDRESS_SIZE EQUAL 32)
|
||||
#message(STATUS "ADDRESS_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(ARCH x86_64)
|
||||
set(ADDRESS_SIZE 64)
|
||||
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
message(STATUS "Size of void pointer is detected as 4; ARCH is 32-bit")
|
||||
set(ADDRESS_SIZE 32)
|
||||
set(ARCH i686)
|
||||
else()
|
||||
message(FATAL_ERROR "Unkown Architecture!")
|
||||
endif()
|
||||
endif (ADDRESS_SIZE EQUAL 32)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set(WINDOWS ON BOOL FORCE)
|
||||
if (ADDRESS_SIZE EQUAL 64)
|
||||
set(LL_ARCH ${ARCH}_win64)
|
||||
set(LL_ARCH_DIR ${ARCH}-win64)
|
||||
elseif (ADDRESS_SIZE EQUAL 32)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(ARCH i686)
|
||||
set(LL_ARCH ${ARCH}_win32)
|
||||
set(LL_ARCH_DIR ${ARCH}-win32)
|
||||
else()
|
||||
message(FATAL_ERROR "Unkown Architecture!")
|
||||
endif ()
|
||||
endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
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")
|
||||
set(LINUX ON BOOL FORCE)
|
||||
set(LINUX ON BOOl FORCE)
|
||||
|
||||
if (ADDRESS_SIZE EQUAL 32)
|
||||
# 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)
|
||||
set(ARCH i686)
|
||||
elseif (WORD_SIZE EQUAL 64)
|
||||
set(ARCH x86_64)
|
||||
else (WORD_SIZE EQUAL 32)
|
||||
if(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||
set(ARCH i686)
|
||||
set(WORD_SIZE 32)
|
||||
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)
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(DEB_ARCHITECTURE i386)
|
||||
set(FIND_LIBRARY_USE_LIB64_PATHS OFF)
|
||||
set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib32 ${CMAKE_SYSTEM_LIBRARY_PATH})
|
||||
else (ADDRESS_SIZE EQUAL 32)
|
||||
else (WORD_SIZE EQUAL 32)
|
||||
set(DEB_ARCHITECTURE amd64)
|
||||
set(FIND_LIBRARY_USE_LIB64_PATHS ON)
|
||||
endif (ADDRESS_SIZE EQUAL 32)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
|
||||
execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
|
||||
RESULT_VARIABLE DPKG_RESULT
|
||||
@@ -176,107 +85,103 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
endif (DPKG_RESULT EQUAL 0)
|
||||
|
||||
include(ConfigurePkgConfig)
|
||||
endif (NOT STANDALONE AND MULTIARCH_HACK)
|
||||
|
||||
set(LL_ARCH ${ARCH}_linux)
|
||||
set(LL_ARCH_DIR ${ARCH}-linux)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(DARWIN ON BOOL FORCE)
|
||||
set(DARWIN 1)
|
||||
|
||||
# Architecture
|
||||
set(CMAKE_OSX_SYSROOT macosx10.14)
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS "x86_64")
|
||||
execute_process(
|
||||
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)
|
||||
|
||||
# Build Options
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=Debug] "dwarf")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=Release] "dwarf-with-dsym")
|
||||
# Hardcode SDK we build against until we can test and allow newer ones
|
||||
# as autodetected in the code above
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
|
||||
set(CMAKE_OSX_SYSROOT macosx10.6)
|
||||
|
||||
# Deployment
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
|
||||
# Support for Unix Makefiles generator
|
||||
if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||
execute_process(COMMAND xcodebuild -version -sdk "${CMAKE_OSX_SYSROOT}" Path | head -n 1 OUTPUT_VARIABLE CMAKE_OSX_SYSROOT)
|
||||
string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
|
||||
endif (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||
|
||||
# LLVM-GCC has been removed in Xcode5
|
||||
if (XCODE_VERSION GREATER 4.9)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
|
||||
else (XCODE_VERSION GREATER 4.9)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
|
||||
endif (XCODE_VERSION GREATER 4.9)
|
||||
|
||||
# Linking
|
||||
set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
|
||||
|
||||
# Apple Clang - Code Gen
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Release] YES)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS sse4.1)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL[variant=Debug] 0)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL[variant=Release] 3)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO)
|
||||
|
||||
# Apple Clang - Custom Compiler Flags
|
||||
set(CMAKE_XCODE_ATTRIBUTE_WARNING_CFLAGS "-Wall -Wextra -Wno-reorder -Wno-sign-compare -Wno-ignored-qualifiers -Wno-unused-local-typedef -Wno-unused-parameter")
|
||||
|
||||
# Apple Clang - Language - C++
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD c++14)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
||||
|
||||
# Apple Clang - Warning Policies
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS YES)
|
||||
message(STATUS "Xcode version: ${XCODE_VERSION}")
|
||||
message(STATUS "OSX sysroot: ${CMAKE_OSX_SYSROOT}")
|
||||
message(STATUS "OSX deployment target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
|
||||
# Build only for i386 by default, system default on MacOSX 10.6 is x86_64
|
||||
set(CMAKE_OSX_ARCHITECTURES i386)
|
||||
set(ARCH i386)
|
||||
set(WORD_SIZE 32)
|
||||
|
||||
set(LL_ARCH ${ARCH}_darwin)
|
||||
set(LL_ARCH_DIR universal-darwin)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
# Platform specific
|
||||
if (WINDOWS)
|
||||
option(LLWINDOW_SDL2 "Use SDL2 for window and input handling. Windows only" OFF)
|
||||
endif()
|
||||
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")
|
||||
|
||||
if (DEFINED ENV{VIEWER_CHANNEL_BASE})
|
||||
set(VIEWER_CHANNEL_BASE $ENV{VIEWER_CHANNEL_BASE} CACHE STRING "Viewer Channel Base Name" FORCE)
|
||||
else()
|
||||
set(VIEWER_CHANNEL_BASE "Singularity" CACHE STRING "Viewer Channel Base Name")
|
||||
endif()
|
||||
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)")
|
||||
|
||||
if (DEFINED ENV{VIEWER_CHANNEL_TYPE})
|
||||
set(VIEWER_CHANNEL_TYPE $ENV{VIEWER_CHANNEL_TYPE} CACHE STRING "Viewer Channel Type Name" FORCE)
|
||||
else()
|
||||
set(VIEWER_CHANNEL_TYPE "Test" CACHE STRING "Viewer Channel Type Name")
|
||||
endif()
|
||||
# *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}")
|
||||
|
||||
if (DEFINED ENV{VIEWER_CHANNEL_CODENAME})
|
||||
set(VIEWER_CHANNEL_CODENAME $ENV{VIEWER_CHANNEL_CODENAME} CACHE STRING "Viewer Channel Code Name for Project type" FORCE)
|
||||
else()
|
||||
set(VIEWER_CHANNEL_CODENAME "Default" CACHE STRING "Viewer Channel Code Name for Project type")
|
||||
endif()
|
||||
|
||||
if("${VIEWER_CHANNEL_TYPE}" STREQUAL "Project")
|
||||
set(VIEWER_CHANNEL "${VIEWER_CHANNEL_BASE} ${VIEWER_CHANNEL_TYPE} ${VIEWER_CHANNEL_CODENAME}")
|
||||
else()
|
||||
set(VIEWER_CHANNEL "${VIEWER_CHANNEL_BASE} ${VIEWER_CHANNEL_TYPE}")
|
||||
endif()
|
||||
|
||||
string(TOLOWER "${VIEWER_CHANNEL_BASE}" VIEWER_BRANDING_ID)
|
||||
string(REPLACE " " "-" VIEWER_BRANDING_ID ${VIEWER_BRANDING_ID})
|
||||
set(VIEWER_BINARY_NAME "${VIEWER_BRANDING_ID}-bin" CACHE STRING
|
||||
"The name of the viewer executable to create.")
|
||||
|
||||
string(REPLACE " " "" VIEWER_CHANNEL_ONEWORD ${VIEWER_CHANNEL})
|
||||
set(VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL_ONEWORD} CACHE STRING "Prefix used for resulting artifacts.")
|
||||
|
||||
option(VIEWER_CHANNEL_GRK "Greek character(s) to represent the viewer channel for support purposes, override only for special branches" "")
|
||||
if (NOT VIEWER_CHANNEL_GRK)
|
||||
if (VIEWER_CHANNEL_TYPE MATCHES "Test")
|
||||
set(VIEWER_CHANNEL_GRK "\\u03C4") # "τ"
|
||||
elseif (VIEWER_CHANNEL_TYPE MATCHES "Alpha")
|
||||
set(VIEWER_CHANNEL_GRK "\\u03B1") # "α"
|
||||
elseif (VIEWER_CHANNEL_TYPE MATCHES "Beta")
|
||||
set(VIEWER_CHANNEL_GRK "\\u03B2") # "β"
|
||||
else()
|
||||
set(VIEWER_CHANNEL_GRK "")
|
||||
endif ()
|
||||
endif (NOT VIEWER_CHANNEL_GRK)
|
||||
|
||||
option(ENABLE_SIGNING "Enable signing the viewer" OFF)
|
||||
set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.")
|
||||
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
|
||||
|
||||
source_group("CMake Rules" FILES CMakeLists.txt)
|
||||
|
||||
|
||||
@@ -2,7 +2,14 @@
|
||||
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)
|
||||
# Download there even when using standalone.
|
||||
set(STANDALONE OFF)
|
||||
@@ -12,10 +19,3 @@ else (NOT STANDALONE)
|
||||
endif(LINUX AND ${ARCH} STREQUAL "x86_64")
|
||||
set(STANDALONE ON)
|
||||
endif(NOT STANDALONE)
|
||||
|
||||
if(LINUX)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
|
||||
endif(LINUX)
|
||||
|
||||
use_prebuilt_binary(fonts)
|
||||
|
||||
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,340 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
"""\
|
||||
@file run_build_test.py
|
||||
@author Nat Goodspeed
|
||||
@date 2009-09-03
|
||||
@brief Helper script to allow CMake to run some command after setting
|
||||
environment variables.
|
||||
|
||||
CMake has commands to run an external program. But remember that each CMake
|
||||
command must be backed by multiple build-system implementations. Unfortunately
|
||||
it seems CMake can't promise that every target build system can set specified
|
||||
environment variables before running the external program of interest.
|
||||
|
||||
This helper script is a workaround. It simply sets the requested environment
|
||||
variables and then executes the program specified on the rest of its command
|
||||
line.
|
||||
|
||||
Example:
|
||||
|
||||
python run_build_test.py -DFOO=bar myprog somearg otherarg
|
||||
|
||||
sets environment variable FOO=bar, then runs:
|
||||
myprog somearg otherarg
|
||||
|
||||
$LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
Second Life Viewer Source Code
|
||||
Copyright (C) 2009-2010, 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 os
|
||||
import sys
|
||||
import errno
|
||||
import HTMLParser
|
||||
import re
|
||||
import signal
|
||||
import subprocess
|
||||
import logging
|
||||
|
||||
def main(command, arguments=[], libpath=[], vars={}):
|
||||
"""Pass:
|
||||
command is the command to be executed
|
||||
|
||||
argument is a sequence (e.g. a list) of strings to be passed to command
|
||||
|
||||
libpath is a sequence of directory pathnames. These will be appended to
|
||||
the platform-specific dynamic library search path environment variable.
|
||||
|
||||
vars is a dict of arbitrary (var, value) pairs to be added to the
|
||||
environment before running 'command'.
|
||||
|
||||
This function runs the specified command, waits for it to terminate and
|
||||
returns its return code. This will be negative if the command terminated
|
||||
with a signal, else it will be the process's specified exit code.
|
||||
"""
|
||||
# Handle platform-dependent libpath first.
|
||||
if sys.platform == "win32":
|
||||
lpvars = ["PATH"]
|
||||
elif sys.platform == "darwin":
|
||||
lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"]
|
||||
elif sys.platform.startswith("linux"):
|
||||
lpvars = ["LD_LIBRARY_PATH"]
|
||||
else:
|
||||
# No idea what the right pathname might be! But only crump if this
|
||||
# feature is requested.
|
||||
if libpath:
|
||||
raise RuntimeError("run_build_test: unknown platform %s" % sys.platform)
|
||||
lpvars = []
|
||||
for var in lpvars:
|
||||
# Split the existing path. Bear in mind that the variable in question
|
||||
# might not exist; instead of KeyError, just use an empty string.
|
||||
dirs = os.environ.get(var, "").split(os.pathsep)
|
||||
# Append the sequence in libpath
|
||||
log.info("%s += %r" % (var, libpath))
|
||||
for dir in libpath:
|
||||
# append system paths at the end
|
||||
if dir in ('/lib', '/usr/lib'):
|
||||
dirs.append(dir)
|
||||
# prepend non-system paths
|
||||
else:
|
||||
dirs.insert(0, dir)
|
||||
|
||||
# Filter out some useless pieces
|
||||
clean_dirs = []
|
||||
for dir in dirs:
|
||||
if dir and dir not in ('', '.'):
|
||||
clean_dirs.append(dir)
|
||||
|
||||
# Now rebuild the path string. This way we use a minimum of separators
|
||||
# -- and we avoid adding a pointless separator when libpath is empty.
|
||||
os.environ[var] = os.pathsep.join(clean_dirs)
|
||||
log.info("%s = %r" % (var, os.environ[var]))
|
||||
# Now handle arbitrary environment variables. The tricky part is ensuring
|
||||
# that all the keys and values we try to pass are actually strings.
|
||||
if vars:
|
||||
log.info("Setting: %s" % ("\n".join(["%s=%s" % (key, value) for key, value in vars.iteritems()])))
|
||||
os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()]))
|
||||
# Run the child process.
|
||||
command_list = [command]
|
||||
command_list.extend(arguments)
|
||||
log.info("Running: %s" % " ".join(command_list))
|
||||
# Make sure we see all relevant output *before* child-process output.
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
return subprocess.call(command_list)
|
||||
except OSError as err:
|
||||
# If the caller is trying to execute a test program that doesn't
|
||||
# exist, we want to produce a reasonable error message rather than a
|
||||
# traceback. This happens when the build is halted by errors, but
|
||||
# CMake tries to proceed with testing anyway <eyeroll/>. However, do
|
||||
# NOT attempt to handle any error but "doesn't exist."
|
||||
if err.errno != errno.ENOENT:
|
||||
raise
|
||||
# In practice, the pathnames into CMake's build tree are so long as to
|
||||
# obscure the name of the test program. Just log its basename.
|
||||
log.warn("No such program %s; check for preceding build errors" % \
|
||||
os.path.basename(command[0]))
|
||||
# What rc should we simulate for missing executable? Windows produces
|
||||
# 9009.
|
||||
return 9009
|
||||
|
||||
# swiped from vita, sigh, seems like a Bad Idea to introduce dependency
|
||||
def translate_rc(rc):
|
||||
"""
|
||||
Accept an rc encoded as for subprocess.Popen.returncode:
|
||||
None means still running
|
||||
int >= 0 means terminated voluntarily with specified rc
|
||||
int < 0 means terminated by signal (-rc)
|
||||
|
||||
Return a string explaining the outcome. In case of a signal, try to
|
||||
name the corresponding symbol from the 'signal' module.
|
||||
"""
|
||||
if rc is None:
|
||||
return "still running"
|
||||
|
||||
if rc >= 0:
|
||||
return "terminated with rc %s" % rc
|
||||
|
||||
if sys.platform.startswith("win"):
|
||||
# From http://stackoverflow.com/questions/20629027/process-finished-with-exit-code-1073741571
|
||||
# [-1073741571] is the signed integer representation of Microsoft's
|
||||
# "stack overflow/stack exhaustion" error code 0xC00000FD.
|
||||
# Anytime you see strange, large negative exit codes in windows, convert
|
||||
# them to hex and then look them up in the ntstatus error codes
|
||||
# http://msdn.microsoft.com/en-us/library/cc704588.aspx
|
||||
|
||||
# Python bends over backwards to give you all the integer precision
|
||||
# you need, avoiding truncation. But only with 32-bit signed ints is
|
||||
# -1073741571 equivalent to 0xC00000FD! Explicitly truncate before
|
||||
# converting.
|
||||
hexrc = "0x%X" % (rc & 0xFFFFFFFF)
|
||||
# At this point, we're only trying to format the rc to make it easier
|
||||
# for a human being to understand. Any exception here -- file doesn't
|
||||
# exist, HTML parsing error, unrecognized table structure, unknown key
|
||||
# -- should NOT kill the script! It should only cause us to shrug and
|
||||
# present our caller with the best information available.
|
||||
try:
|
||||
table = get_windows_table()
|
||||
symbol, desc = table[hexrc]
|
||||
except Exception, err:
|
||||
log.error("(%s -- carrying on)" % err)
|
||||
log.error("terminated with rc %s (%s)" % (rc, hexrc))
|
||||
else:
|
||||
log.info("terminated with rc %s: %s: %s" % (hexrc, symbol, desc))
|
||||
|
||||
else:
|
||||
# On Posix, negative rc means the child was terminated by signal -rc.
|
||||
rc = -rc
|
||||
for attr in dir(signal):
|
||||
if attr.startswith('SIG') and getattr(signal, attr) == rc:
|
||||
strc = attr
|
||||
break
|
||||
else:
|
||||
strc = str(rc)
|
||||
return "terminated by signal %s" % strc
|
||||
|
||||
class TableParser(HTMLParser.HTMLParser):
|
||||
"""
|
||||
This HTMLParser subclass is designed to parse the table we know exists
|
||||
in windows-rcs.html, hopefully without building in too much knowledge of
|
||||
the specific way that table is currently formatted.
|
||||
"""
|
||||
# regular expression matching any string containing only whitespace
|
||||
whitespace = re.compile(r'\s*$')
|
||||
|
||||
def __init__(self):
|
||||
# Because Python 2.x's HTMLParser is an old-style class, we must use
|
||||
# old-style syntax to forward the __init__() call -- not super().
|
||||
HTMLParser.HTMLParser.__init__(self)
|
||||
# this will collect all the data, eventually
|
||||
self.table = []
|
||||
# Stack whose top (last item) indicates where to append current
|
||||
# element data. When empty, don't collect data at all.
|
||||
self.dest = []
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
if tag == "table":
|
||||
# This is the outermost tag we recognize. Collect nested elements
|
||||
# within self.table.
|
||||
self.dest.append(self.table)
|
||||
elif tag in ("tr", "td"):
|
||||
# Nested elements whose contents we want to capture as sublists.
|
||||
# To the list currently designated by the top of the dest stack,
|
||||
# append a new empty sublist.
|
||||
self.dest[-1].append([])
|
||||
# Now push THAT new, empty list as the new top of the dest stack.
|
||||
self.dest.append(self.dest[-1][-1])
|
||||
elif tag == "p":
|
||||
# We could handle <p> ... </p> just like <tr> or <td>, but that
|
||||
# introduces an unnecessary extra level of nesting. Just skip.
|
||||
pass
|
||||
else:
|
||||
# For any tag we don't recognize (notably <th>), push a new, empty
|
||||
# list to the top of the dest stack. This new list is NOT
|
||||
# referenced by anything in self.table; thus, when we pop it, any
|
||||
# data we've collected inside that list will be discarded.
|
||||
self.dest.append([])
|
||||
|
||||
def handle_endtag(self, tag):
|
||||
# Because we avoid pushing self.dest for <p> in handle_starttag(), we
|
||||
# must refrain from popping it for </p> here.
|
||||
if tag != "p":
|
||||
# For everything else, including unrecognized tags, pop the dest
|
||||
# stack, reverting to outer collection.
|
||||
self.dest.pop()
|
||||
|
||||
def handle_startendtag(self, tag, attrs):
|
||||
# The table of interest contains <td> entries of the form:
|
||||
# <p>0x00000000<br />STATUS_SUCCESS</p>
|
||||
# The <br/> is very useful -- we definitely want two different data
|
||||
# items for "0x00000000" and "STATUS_SUCCESS" -- but we don't need or
|
||||
# want it to push, then discard, an empty list as it would if we let
|
||||
# the default HTMLParser.handle_startendtag() call handle_starttag()
|
||||
# followed by handle_endtag(). Just ignore <br/> or any other
|
||||
# singleton tag.
|
||||
pass
|
||||
|
||||
def handle_data(self, data):
|
||||
# Outside the <table> of interest, self.dest is empty. Do not bother
|
||||
# collecting data when self.dest is empty.
|
||||
# HTMLParser calls handle_data() with every chunk of whitespace
|
||||
# between tags. That would be lovely if our eventual goal was to
|
||||
# reconstitute the original input stream with its existing formatting,
|
||||
# but for us, whitespace only clutters the table. Ignore it.
|
||||
if self.dest and not self.whitespace.match(data):
|
||||
# Here we're within our <table> and we have non-whitespace data.
|
||||
# Append it to the list designated by the top of the dest stack.
|
||||
self.dest[-1].append(data)
|
||||
|
||||
# cache for get_windows_table()
|
||||
_windows_table = None
|
||||
|
||||
def get_windows_table():
|
||||
global _windows_table
|
||||
# If we already loaded _windows_table, no need to load it all over again.
|
||||
if _windows_table:
|
||||
return _windows_table
|
||||
|
||||
# windows-rcs.html was fetched on 2015-03-24 with the following command:
|
||||
# curl -o windows-rcs.html \
|
||||
# https://msdn.microsoft.com/en-us/library/cc704588.aspx
|
||||
parser = TableParser()
|
||||
with open(os.path.join(os.path.dirname(__file__), "windows-rcs.html")) as hf:
|
||||
# We tried feeding the file data to TableParser in chunks, to avoid
|
||||
# buffering the entire file as a single string. Unfortunately its
|
||||
# handle_data() cannot tell the difference between distinct calls
|
||||
# separated by HTML tags, and distinct calls necessitated by a chunk
|
||||
# boundary. Sigh! Read in the whole file. At the time this was
|
||||
# written, it was only 500KB anyway.
|
||||
parser.feed(hf.read())
|
||||
parser.close()
|
||||
table = parser.table
|
||||
|
||||
# With our parser, any <tr><th>...</th></tr> row leaves a table entry
|
||||
# consisting only of an empty list. Remove any such.
|
||||
while table and not table[0]:
|
||||
table.pop(0)
|
||||
|
||||
# We expect rows of the form:
|
||||
# [['0x00000000', 'STATUS_SUCCESS'],
|
||||
# ['The operation completed successfully.']]
|
||||
# The latter list will have multiple entries if Microsoft embedded <br/>
|
||||
# or <p> ... </p> in the text, in which case joining with '\n' is
|
||||
# appropriate.
|
||||
# Turn that into a dict whose key is the hex string, and whose value is
|
||||
# the pair (symbol, desc).
|
||||
_windows_table = dict((key, (symbol, '\n'.join(desc)))
|
||||
for (key, symbol), desc in table)
|
||||
|
||||
return _windows_table
|
||||
|
||||
log=logging.getLogger(__name__)
|
||||
logging.basicConfig()
|
||||
|
||||
if __name__ == "__main__":
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-d", "--debug", dest="loglevel", action="store_const",
|
||||
const=logging.DEBUG, default=logging.INFO)
|
||||
parser.add_argument("-D", "--define", dest="vars", default=[], action="append",
|
||||
metavar="VAR=value",
|
||||
help="Add VAR=value to the env variables defined")
|
||||
parser.add_argument("-l", "--libpath", dest="libpath", default=[], action="append",
|
||||
metavar="DIR",
|
||||
help="Add DIR to the platform-dependent DLL search path")
|
||||
parser.add_argument("command")
|
||||
parser.add_argument('args', nargs=argparse.REMAINDER)
|
||||
args = parser.parse_args()
|
||||
|
||||
log.setLevel(args.loglevel)
|
||||
|
||||
# What we have in opts.vars is a list of strings of the form "VAR=value"
|
||||
# or possibly just "VAR". What we want is a dict. We can build that dict by
|
||||
# constructing a list of ["VAR", "value"] pairs -- so split each
|
||||
# "VAR=value" string on the '=' sign (but only once, in case we have
|
||||
# "VAR=some=user=string"). To handle the case of just "VAR", append "" to
|
||||
# the list returned by split(), then slice off anything after the pair we
|
||||
# want.
|
||||
rc = main(command=args.command, arguments=args.args, libpath=args.libpath,
|
||||
vars=dict([(pair.split('=', 1) + [""])[:2] for pair in args.vars]))
|
||||
if rc not in (None, 0):
|
||||
log.error("Failure running: %s" % " ".join([args.command] + args.args))
|
||||
log.error("Error %s: %s" % (rc, translate_rc(rc)))
|
||||
sys.exit((rc < 0) and 255 or rc)
|
||||
@@ -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
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
project(deps)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
set(CMAKE_FOLDER "Third Party")
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v2.11.0
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
FetchContent_Declare(
|
||||
fmt
|
||||
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
|
||||
GIT_TAG 8d78045e7cb44d39ad4cd95dd27816b8749e1944
|
||||
)
|
||||
FetchContent_Declare(
|
||||
nlohmann_json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json.git
|
||||
GIT_TAG v3.7.3
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
FetchContent_Declare(
|
||||
absl
|
||||
GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
|
||||
GIT_TAG 768eb2ca2857342673fcd462792ce04b8bac3fa3
|
||||
)
|
||||
|
||||
# This is a hack because absl has dumb cmake
|
||||
set(OLD_BUILD_TEST ${BUILD_TESTING})
|
||||
set(BUILD_TESTING OFF)
|
||||
FetchContent_MakeAvailable(absl)
|
||||
set(BUILD_TESTING ${OLD_BUILD_TEST})
|
||||
|
||||
# Supress warnings inside abseil under MSVC
|
||||
if(WINDOWS)
|
||||
target_compile_options(absl_strings PRIVATE /wd4018)
|
||||
target_compile_options(absl_str_format_internal PRIVATE /wd4018)
|
||||
target_compile_options(absl_flags_usage_internal PRIVATE /wd4018)
|
||||
endif()
|
||||
|
||||
|
||||
if (BUILD_TESTING)
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
endif()
|
||||
|
||||
#Download the rest of the libraries
|
||||
FetchContent_MakeAvailable(fmt)
|
||||
|
||||
# Typically you don't care so much for a third party library's tests to be
|
||||
# run from your own project's code.
|
||||
set(JSON_BuildTests OFF CACHE INTERNAL "")
|
||||
|
||||
# If you only include this third party in PRIVATE source files, you do not
|
||||
# need to install it when your main project gets installed.
|
||||
set(JSON_Install OFF CACHE INTERNAL "")
|
||||
FetchContent_MakeAvailable(nlohmann_json)
|
||||
|
||||
unset(CMAKE_FOLDER)
|
||||
unset(CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
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)
|
||||
27
indra/lib/python/indra/base/__init__.py
Normal file
27
indra/lib/python/indra/base/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""\
|
||||
@file __init__.py
|
||||
@brief Initialization file for the indra.base module.
|
||||
|
||||
$LicenseInfo:firstyear=2007&license=mit$
|
||||
|
||||
Copyright (c) 2007-2009, Linden Research, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
$/LicenseInfo$
|
||||
"""
|
||||
73
indra/lib/python/indra/base/cllsd_test.py
Normal file
73
indra/lib/python/indra/base/cllsd_test.py
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/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 datetime import datetime
|
||||
import cllsd
|
||||
import time, sys
|
||||
|
||||
class myint(int):
|
||||
pass
|
||||
|
||||
values = (
|
||||
'&<>',
|
||||
u'\u81acj',
|
||||
llsd.uri('http://foo<'),
|
||||
lluuid.UUID(),
|
||||
llsd.LLSD(['thing']),
|
||||
1,
|
||||
myint(31337),
|
||||
sys.maxint + 10,
|
||||
llsd.binary('foo'),
|
||||
[],
|
||||
{},
|
||||
{u'f&\u1212': 3},
|
||||
3.1,
|
||||
True,
|
||||
None,
|
||||
datetime.fromtimestamp(time.time()),
|
||||
)
|
||||
|
||||
def valuator(values):
|
||||
for v in values:
|
||||
yield v
|
||||
|
||||
longvalues = () # (values, list(values), iter(values), valuator(values))
|
||||
|
||||
for v in values + longvalues:
|
||||
print '%r => %r' % (v, cllsd.llsd_to_xml(v))
|
||||
|
||||
a = [[{'a':3}]] * 1000000
|
||||
|
||||
s = time.time()
|
||||
print hash(cllsd.llsd_to_xml(a))
|
||||
e = time.time()
|
||||
t1 = e - s
|
||||
print t1
|
||||
|
||||
s = time.time()
|
||||
print hash(llsd.LLSDXMLFormatter()._format(a))
|
||||
e = time.time()
|
||||
t2 = e - s
|
||||
print t2
|
||||
|
||||
print 'Speedup:', t2 / t1
|
||||
266
indra/lib/python/indra/base/config.py
Normal file
266
indra/lib/python/indra/base/config.py
Normal file
@@ -0,0 +1,266 @@
|
||||
"""\
|
||||
@file config.py
|
||||
@brief Utility module for parsing and accessing the indra.xml config file.
|
||||
|
||||
$LicenseInfo:firstyear=2006&license=mit$
|
||||
|
||||
Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
$/LicenseInfo$
|
||||
"""
|
||||
|
||||
import copy
|
||||
import errno
|
||||
import os
|
||||
import traceback
|
||||
import time
|
||||
import types
|
||||
|
||||
from os.path import dirname, getmtime, join, realpath
|
||||
from indra.base import llsd
|
||||
|
||||
_g_config = None
|
||||
|
||||
class IndraConfig(object):
|
||||
"""
|
||||
IndraConfig loads a 'indra' xml configuration file
|
||||
and loads into memory. This representation in memory
|
||||
can get updated to overwrite values or add new values.
|
||||
|
||||
The xml configuration file is considered a live file and changes
|
||||
to the file are checked and reloaded periodically. If a value had
|
||||
been overwritten via the update or set method, the loaded values
|
||||
from the file are ignored (the values from the update/set methods
|
||||
override)
|
||||
"""
|
||||
def __init__(self, indra_config_file):
|
||||
self._indra_config_file = indra_config_file
|
||||
self._reload_check_interval = 30 # seconds
|
||||
self._last_check_time = 0
|
||||
self._last_mod_time = 0
|
||||
|
||||
self._config_overrides = {}
|
||||
self._config_file_dict = {}
|
||||
self._combined_dict = {}
|
||||
|
||||
self._load()
|
||||
|
||||
def _load(self):
|
||||
# if you initialize the IndraConfig with None, no attempt
|
||||
# is made to load any files
|
||||
if self._indra_config_file is None:
|
||||
return
|
||||
|
||||
config_file = open(self._indra_config_file)
|
||||
self._config_file_dict = llsd.parse(config_file.read())
|
||||
self._combine_dictionaries()
|
||||
config_file.close()
|
||||
|
||||
self._last_mod_time = self._get_last_modified_time()
|
||||
self._last_check_time = time.time() # now
|
||||
|
||||
def _get_last_modified_time(self):
|
||||
"""
|
||||
Returns the mtime (last modified time) of the config file,
|
||||
if such exists.
|
||||
"""
|
||||
if self._indra_config_file is not None:
|
||||
return os.path.getmtime(self._indra_config_file)
|
||||
|
||||
return 0
|
||||
|
||||
def _combine_dictionaries(self):
|
||||
self._combined_dict = {}
|
||||
self._combined_dict.update(self._config_file_dict)
|
||||
self._combined_dict.update(self._config_overrides)
|
||||
|
||||
def _reload_if_necessary(self):
|
||||
now = time.time()
|
||||
|
||||
if (now - self._last_check_time) > self._reload_check_interval:
|
||||
self._last_check_time = now
|
||||
try:
|
||||
modtime = self._get_last_modified_time()
|
||||
if modtime > self._last_mod_time:
|
||||
self._load()
|
||||
except OSError, e:
|
||||
if e.errno == errno.ENOENT: # file not found
|
||||
# someone messed with our internal state
|
||||
# or removed the file
|
||||
|
||||
print 'WARNING: Configuration file has been removed ' + (self._indra_config_file)
|
||||
print 'Disabling reloading of configuration file.'
|
||||
|
||||
traceback.print_exc()
|
||||
|
||||
self._indra_config_file = None
|
||||
self._last_check_time = 0
|
||||
self._last_mod_time = 0
|
||||
else:
|
||||
raise # pass the exception along to the caller
|
||||
|
||||
def __getitem__(self, key):
|
||||
self._reload_if_necessary()
|
||||
|
||||
return self._combined_dict[key]
|
||||
|
||||
def get(self, key, default = None):
|
||||
try:
|
||||
return self.__getitem__(key)
|
||||
except KeyError:
|
||||
return default
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
"""
|
||||
Sets the value of the config setting of key to be newval
|
||||
|
||||
Once any key/value pair is changed via the set method,
|
||||
that key/value pair will remain set with that value until
|
||||
change via the update or set method
|
||||
"""
|
||||
self._config_overrides[key] = value
|
||||
self._combine_dictionaries()
|
||||
|
||||
def set(self, key, newval):
|
||||
return self.__setitem__(key, newval)
|
||||
|
||||
def update(self, new_conf):
|
||||
"""
|
||||
Load an XML file and apply its map as overrides or additions
|
||||
to the existing config. Update can be a file or a dict.
|
||||
|
||||
Once any key/value pair is changed via the update method,
|
||||
that key/value pair will remain set with that value until
|
||||
change via the update or set method
|
||||
"""
|
||||
if isinstance(new_conf, dict):
|
||||
overrides = new_conf
|
||||
else:
|
||||
# assuming that it is a filename
|
||||
config_file = open(new_conf)
|
||||
overrides = llsd.parse(config_file.read())
|
||||
config_file.close()
|
||||
|
||||
self._config_overrides.update(overrides)
|
||||
self._combine_dictionaries()
|
||||
|
||||
def as_dict(self):
|
||||
"""
|
||||
Returns immutable copy of the IndraConfig as a dictionary
|
||||
"""
|
||||
return copy.deepcopy(self._combined_dict)
|
||||
|
||||
def load(config_xml_file = None):
|
||||
global _g_config
|
||||
|
||||
load_default_files = config_xml_file is None
|
||||
if load_default_files:
|
||||
## going from:
|
||||
## "/opt/linden/indra/lib/python/indra/base/config.py"
|
||||
## to:
|
||||
## "/opt/linden/etc/indra.xml"
|
||||
config_xml_file = realpath(
|
||||
dirname(realpath(__file__)) + "../../../../../../etc/indra.xml")
|
||||
|
||||
try:
|
||||
_g_config = IndraConfig(config_xml_file)
|
||||
except IOError:
|
||||
# Failure to load passed in file
|
||||
# or indra.xml default file
|
||||
if load_default_files:
|
||||
try:
|
||||
config_xml_file = realpath(
|
||||
dirname(realpath(__file__)) + "../../../../../../etc/globals.xml")
|
||||
_g_config = IndraConfig(config_xml_file)
|
||||
return
|
||||
except IOError:
|
||||
# Failure to load globals.xml
|
||||
# fall to code below
|
||||
pass
|
||||
|
||||
# Either failed to load passed in file
|
||||
# or failed to load all default files
|
||||
_g_config = IndraConfig(None)
|
||||
|
||||
def dump(indra_xml_file, indra_cfg = None, update_in_mem=False):
|
||||
'''
|
||||
Dump config contents into a file
|
||||
Kindof reverse of load.
|
||||
Optionally takes a new config to dump.
|
||||
Does NOT update global config unless requested.
|
||||
'''
|
||||
global _g_config
|
||||
|
||||
if not indra_cfg:
|
||||
if _g_config is None:
|
||||
return
|
||||
|
||||
indra_cfg = _g_config.as_dict()
|
||||
|
||||
if not indra_cfg:
|
||||
return
|
||||
|
||||
config_file = open(indra_xml_file, 'w')
|
||||
_config_xml = llsd.format_xml(indra_cfg)
|
||||
config_file.write(_config_xml)
|
||||
config_file.close()
|
||||
|
||||
if update_in_mem:
|
||||
update(indra_cfg)
|
||||
|
||||
def update(new_conf):
|
||||
global _g_config
|
||||
|
||||
if _g_config is None:
|
||||
# To keep with how this function behaved
|
||||
# previously, a call to update
|
||||
# before the global is defined
|
||||
# make a new global config which does not
|
||||
# load data from a file.
|
||||
_g_config = IndraConfig(None)
|
||||
|
||||
return _g_config.update(new_conf)
|
||||
|
||||
def get(key, default = None):
|
||||
global _g_config
|
||||
|
||||
if _g_config is None:
|
||||
load()
|
||||
|
||||
return _g_config.get(key, default)
|
||||
|
||||
def set(key, newval):
|
||||
"""
|
||||
Sets the value of the config setting of key to be newval
|
||||
|
||||
Once any key/value pair is changed via the set method,
|
||||
that key/value pair will remain set with that value until
|
||||
change via the update or set method or program termination
|
||||
"""
|
||||
global _g_config
|
||||
|
||||
if _g_config is None:
|
||||
_g_config = IndraConfig(None)
|
||||
|
||||
_g_config.set(key, newval)
|
||||
|
||||
def get_config():
|
||||
global _g_config
|
||||
return _g_config
|
||||
1052
indra/lib/python/indra/base/llsd.py
Normal file
1052
indra/lib/python/indra/base/llsd.py
Normal file
File diff suppressed because it is too large
Load Diff
319
indra/lib/python/indra/base/lluuid.py
Normal file
319
indra/lib/python/indra/base/lluuid.py
Normal file
@@ -0,0 +1,319 @@
|
||||
"""\
|
||||
@file lluuid.py
|
||||
@brief UUID parser/generator.
|
||||
|
||||
$LicenseInfo:firstyear=2004&license=mit$
|
||||
|
||||
Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
$/LicenseInfo$
|
||||
"""
|
||||
|
||||
import random, socket, string, time, re
|
||||
import uuid
|
||||
try:
|
||||
# Python 2.6
|
||||
from hashlib import md5
|
||||
except ImportError:
|
||||
# Python 2.5 and earlier
|
||||
from md5 import new as md5
|
||||
|
||||
def _int2binstr(i,l):
|
||||
s=''
|
||||
for a in range(l):
|
||||
s=chr(i&0xFF)+s
|
||||
i>>=8
|
||||
return s
|
||||
|
||||
def _binstr2int(s):
|
||||
i = long(0)
|
||||
for c in s:
|
||||
i = (i<<8) + ord(c)
|
||||
return i
|
||||
|
||||
class UUID(object):
|
||||
"""
|
||||
A class which represents a 16 byte integer. Stored as a 16 byte 8
|
||||
bit character string.
|
||||
|
||||
The string version is to be of the form:
|
||||
AAAAAAAA-AAAA-BBBB-BBBB-BBBBBBCCCCCC (a 128-bit number in hex)
|
||||
where A=network address, B=timestamp, C=random.
|
||||
"""
|
||||
|
||||
NULL_STR = "00000000-0000-0000-0000-000000000000"
|
||||
|
||||
# the UUIDREGEX_STRING is helpful for parsing UUID's in text
|
||||
hex_wildcard = r"[0-9a-fA-F]"
|
||||
word = hex_wildcard + r"{4,4}-"
|
||||
long_word = hex_wildcard + r"{8,8}-"
|
||||
very_long_word = hex_wildcard + r"{12,12}"
|
||||
UUID_REGEX_STRING = long_word + word + word + word + very_long_word
|
||||
uuid_regex = re.compile(UUID_REGEX_STRING)
|
||||
|
||||
rand = random.Random()
|
||||
ip = ''
|
||||
try:
|
||||
ip = socket.gethostbyname(socket.gethostname())
|
||||
except(socket.gaierror, socket.error):
|
||||
# no ip address, so just default to somewhere in 10.x.x.x
|
||||
ip = '10'
|
||||
for i in range(3):
|
||||
ip += '.' + str(rand.randrange(1,254))
|
||||
hexip = ''.join(["%04x" % long(i) for i in ip.split('.')])
|
||||
lastid = ''
|
||||
|
||||
def __init__(self, possible_uuid=None):
|
||||
"""
|
||||
Initialize to first valid UUID in argument (if a string),
|
||||
or to null UUID if none found or argument is not supplied.
|
||||
|
||||
If the argument is a UUID, the constructed object will be a copy of it.
|
||||
"""
|
||||
self._bits = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
|
||||
if possible_uuid is None:
|
||||
return
|
||||
|
||||
if isinstance(possible_uuid, type(self)):
|
||||
self.set(possible_uuid)
|
||||
return
|
||||
|
||||
uuid_match = UUID.uuid_regex.search(possible_uuid)
|
||||
if uuid_match:
|
||||
uuid_string = uuid_match.group()
|
||||
s = string.replace(uuid_string, '-', '')
|
||||
self._bits = _int2binstr(string.atol(s[:8],16),4) + \
|
||||
_int2binstr(string.atol(s[8:16],16),4) + \
|
||||
_int2binstr(string.atol(s[16:24],16),4) + \
|
||||
_int2binstr(string.atol(s[24:],16),4)
|
||||
|
||||
def __len__(self):
|
||||
"""
|
||||
Used by the len() builtin.
|
||||
"""
|
||||
return 36
|
||||
|
||||
def __nonzero__(self):
|
||||
return self._bits != "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
|
||||
|
||||
def __str__(self):
|
||||
uuid_string = self.toString()
|
||||
return uuid_string
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
def __getitem__(self, index):
|
||||
return str(self)[index]
|
||||
|
||||
def __eq__(self, other):
|
||||
if isinstance(other, (str, unicode)):
|
||||
return other == str(self)
|
||||
return self._bits == getattr(other, '_bits', '')
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self.__eq__(other)
|
||||
|
||||
def __le__(self, other):
|
||||
return self._bits <= other._bits
|
||||
|
||||
def __ge__(self, other):
|
||||
return self._bits >= other._bits
|
||||
|
||||
def __lt__(self, other):
|
||||
return self._bits < other._bits
|
||||
|
||||
def __gt__(self, other):
|
||||
return self._bits > other._bits
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self._bits)
|
||||
|
||||
def set(self, uuid):
|
||||
self._bits = uuid._bits
|
||||
|
||||
def setFromString(self, uuid_string):
|
||||
"""
|
||||
Given a string version of a uuid, set self bits
|
||||
appropriately. Returns self.
|
||||
"""
|
||||
s = string.replace(uuid_string, '-', '')
|
||||
self._bits = _int2binstr(string.atol(s[:8],16),4) + \
|
||||
_int2binstr(string.atol(s[8:16],16),4) + \
|
||||
_int2binstr(string.atol(s[16:24],16),4) + \
|
||||
_int2binstr(string.atol(s[24:],16),4)
|
||||
return self
|
||||
|
||||
def setFromMemoryDump(self, gdb_string):
|
||||
"""
|
||||
We expect to get gdb_string as four hex units. eg:
|
||||
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
|
||||
Which will be translated to:
|
||||
db547d14-1b3f4bc3-9b984f71-d22f890a
|
||||
Returns self.
|
||||
"""
|
||||
s = string.replace(gdb_string, '0x', '')
|
||||
s = string.replace(s, ' ', '')
|
||||
t = ''
|
||||
for i in range(8,40,8):
|
||||
for j in range(0,8,2):
|
||||
t = t + s[i-j-2:i-j]
|
||||
self.setFromString(t)
|
||||
|
||||
def toString(self):
|
||||
"""
|
||||
Return as a string matching the LL standard
|
||||
AAAAAAAA-AAAA-BBBB-BBBB-BBBBBBCCCCCC (a 128-bit number in hex)
|
||||
where A=network address, B=timestamp, C=random.
|
||||
"""
|
||||
return uuid_bits_to_string(self._bits)
|
||||
|
||||
def getAsString(self):
|
||||
"""
|
||||
Return a different string representation of the form
|
||||
AAAAAAAA-AAAABBBB-BBBBBBBB-BBCCCCCC (a 128-bit number in hex)
|
||||
where A=network address, B=timestamp, C=random.
|
||||
"""
|
||||
i1 = _binstr2int(self._bits[0:4])
|
||||
i2 = _binstr2int(self._bits[4:8])
|
||||
i3 = _binstr2int(self._bits[8:12])
|
||||
i4 = _binstr2int(self._bits[12:16])
|
||||
return '%08lx-%08lx-%08lx-%08lx' % (i1,i2,i3,i4)
|
||||
|
||||
def generate(self):
|
||||
"""
|
||||
Generate a new uuid. This algorithm is slightly different
|
||||
from c++ implementation for portability reasons.
|
||||
Returns self.
|
||||
"""
|
||||
m = md5()
|
||||
m.update(uuid.uuid1().bytes)
|
||||
self._bits = m.digest()
|
||||
return self
|
||||
|
||||
def isNull(self):
|
||||
"""
|
||||
Returns 1 if the uuid is null - ie, equal to default uuid.
|
||||
"""
|
||||
return (self._bits == "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")
|
||||
|
||||
def xor(self, rhs):
|
||||
"""
|
||||
xors self with rhs.
|
||||
"""
|
||||
v1 = _binstr2int(self._bits[0:4]) ^ _binstr2int(rhs._bits[0:4])
|
||||
v2 = _binstr2int(self._bits[4:8]) ^ _binstr2int(rhs._bits[4:8])
|
||||
v3 = _binstr2int(self._bits[8:12]) ^ _binstr2int(rhs._bits[8:12])
|
||||
v4 = _binstr2int(self._bits[12:16]) ^ _binstr2int(rhs._bits[12:16])
|
||||
self._bits = _int2binstr(v1,4) + \
|
||||
_int2binstr(v2,4) + \
|
||||
_int2binstr(v3,4) + \
|
||||
_int2binstr(v4,4)
|
||||
|
||||
|
||||
# module-level null constant
|
||||
NULL = UUID()
|
||||
|
||||
def printTranslatedMemory(four_hex_uints):
|
||||
"""
|
||||
We expect to get the string as four hex units. eg:
|
||||
0x147d54db 0xc34b3f1b 0x714f989b 0x0a892fd2
|
||||
Which will be translated to:
|
||||
db547d14-1b3f4bc3-9b984f71-d22f890a
|
||||
"""
|
||||
uuid = UUID()
|
||||
uuid.setFromMemoryDump(four_hex_uints)
|
||||
print uuid.toString()
|
||||
|
||||
def isUUID(id_str):
|
||||
"""
|
||||
This function returns:
|
||||
- 1 if the string passed is a UUID
|
||||
- 0 is the string passed is not a UUID
|
||||
- None if it neither of the if's below is satisfied
|
||||
"""
|
||||
if not id_str or len(id_str) < 5 or len(id_str) > 36:
|
||||
return 0
|
||||
|
||||
if isinstance(id_str, UUID) or UUID.uuid_regex.match(id_str):
|
||||
return 1
|
||||
|
||||
return None
|
||||
|
||||
def isPossiblyID(id_str):
|
||||
"""
|
||||
This function returns 1 if the string passed has some uuid-like
|
||||
characteristics. Otherwise returns 0.
|
||||
"""
|
||||
|
||||
is_uuid = isUUID(id_str)
|
||||
if is_uuid is not None:
|
||||
return is_uuid
|
||||
|
||||
# build a string which matches every character.
|
||||
hex_wildcard = r"[0-9a-fA-F]"
|
||||
chars = len(id_str)
|
||||
next = min(chars, 8)
|
||||
matcher = hex_wildcard+"{"+str(next)+","+str(next)+"}"
|
||||
chars = chars - next
|
||||
if chars > 0:
|
||||
matcher = matcher + "-"
|
||||
chars = chars - 1
|
||||
for block in range(3):
|
||||
next = max(min(chars, 4), 0)
|
||||
if next:
|
||||
matcher = matcher + hex_wildcard+"{"+str(next)+","+str(next)+"}"
|
||||
chars = chars - next
|
||||
if chars > 0:
|
||||
matcher = matcher + "-"
|
||||
chars = chars - 1
|
||||
if chars > 0:
|
||||
next = min(chars, 12)
|
||||
matcher = matcher + hex_wildcard+"{"+str(next)+","+str(next)+"}"
|
||||
#print matcher
|
||||
uuid_matcher = re.compile(matcher)
|
||||
if uuid_matcher.match(id_str):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def uuid_bits_to_string(bits):
|
||||
i1 = _binstr2int(bits[0:4])
|
||||
i2 = _binstr2int(bits[4:6])
|
||||
i3 = _binstr2int(bits[6:8])
|
||||
i4 = _binstr2int(bits[8:10])
|
||||
i5 = _binstr2int(bits[10:12])
|
||||
i6 = _binstr2int(bits[12:16])
|
||||
return '%08lx-%04lx-%04lx-%04lx-%04lx%08lx' % (i1,i2,i3,i4,i5,i6)
|
||||
|
||||
def uuid_bits_to_uuid(bits):
|
||||
return UUID(uuid_bits_to_string(bits))
|
||||
|
||||
|
||||
try:
|
||||
from mulib import stacked
|
||||
stacked.NoProducer() # just to exercise stacked
|
||||
except:
|
||||
#print "Couldn't import mulib.stacked, not registering UUID converter"
|
||||
pass
|
||||
else:
|
||||
def convertUUID(uuid, req):
|
||||
req.write(str(uuid))
|
||||
|
||||
stacked.add_producer(UUID, convertUUID, "*/*")
|
||||
stacked.add_producer(UUID, convertUUID, "text/html")
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user