server-2.2.0-stable/ 0000775 0000000 0000000 00000000000 13411752632 0014275 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/.clang-format 0000664 0000000 0000000 00000005622 13411752632 0016655 0 ustar 00root root 0000000 0000000 ---
# TODO BreakBeforeLambdaBody
# TODO IncludeBlocks
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
#AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true
#IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
#RawStringFormats:
# - Delimiter: pb
# Language: TextProto
# BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
UseTab: Never
...
server-2.2.0-stable/.dockerignore 0000664 0000000 0000000 00000000145 13411752632 0016751 0 ustar 00root root 0000000 0000000 src/packages
src/cmake-build-*
build-scripts
build
resources
.git
.vscode
CMakeFiles
casparcg_server
server-2.2.0-stable/.editorconfig 0000664 0000000 0000000 00000000223 13411752632 0016747 0 ustar 00root root 0000000 0000000 root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
server-2.2.0-stable/.github/ 0000775 0000000 0000000 00000000000 13411752632 0015635 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 13411752632 0020020 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/.github/ISSUE_TEMPLATE/bug_report.md 0000664 0000000 0000000 00000000741 13411752632 0022514 0 ustar 00root root 0000000 0000000 ---
name: Bug report
about: Create a report to help us improve
---
### Expected behaviour
A clear and concise description of what you expected to happen.
### Current behaviour
A clear and concise description of what the current behaviour is.
----
### Steps to reproduce
1.
2.
3. ...
### Environment
* Commit: [e.g. ab1234c]
* Server version: [e.g. v2.2]
* Operating system: [e.g. Windows 10]
---
### Screenshots
If applicable, add screenshots as complementary information.
server-2.2.0-stable/.github/ISSUE_TEMPLATE/feature_request.md 0000664 0000000 0000000 00000000563 13411752632 0023551 0 ustar 00root root 0000000 0000000 ---
name: Feature request
about: Suggest an idea for this project
---
### Description
A clear and concise description describing to us how your feature/enhancement request should work.
### Solution suggestion
A clear and concise description if you have an idea about a solution.
---
### Additional information
If you have some additional information or attachments.
server-2.2.0-stable/.gitignore 0000664 0000000 0000000 00000000203 13411752632 0016260 0 ustar 00root root 0000000 0000000 *.dir
*.vcxproj
*.vcxproj.filters
*.tlog
*.sln
.settings
.vscode
.vs
build
CMakeFiles
casparcg_server
src/cmake-build-*
src/.idea
server-2.2.0-stable/BUILDING.md 0000664 0000000 0000000 00000005601 13411752632 0016016 0 ustar 00root root 0000000 0000000 Building the CasparCG Server
============================
The CasparCG Server source code uses the CMake build system in order to easily
generate build systems for multiple platforms. CMake is basically a build
system for generating build systems.
On Windows we can use CMake to generate a .sln file and .vcproj files. On
Linux CMake can generate make files or ninja files. Qt Creator has support for
loading CMakeLists.txt files directly.
Windows
=======
Development using Visual Studio
-------------------------------
1. Install Visual Studio 2017.
2. Install CMake (http://www.cmake.org/download/).
3. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`
4. `cd casparcg-server-master`
5. `mkdir build`
6. `cd build`
7. `cmake -G "Visual Studio 15 2017" -A x64 ../src`
8. Open `CasparCG Server.sln`
Linux
=====
Building inside Docker
----------------------
1. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`
2. `cd casparcg-server-master`
3. `./tools/linux/build-in-docker`
If all goes to plan, a docker image `casparcg/server` has been created containing CasparCG Server.
Extracting CasparCG Server from Docker
--------------------------------------
1. `./tools/linux/extract-from-docker`
You will then find a folder called `casparcg_server` which should contain everything you need to run CasparCG Server.
_Note: if you ran docker with sudo, CasparCG server will not be able to run without sudo out of the box. For security reasons we do not recommend to run CasparCG with sudo. Instead you can use chown to change the ownership of the CasparCG Server folder._
Development
-----------
1. Install dependencies `apt-get install git cmake build-essential g++ libglew-dev libfreeimage-dev libtbb-dev libsndfile1-dev libopenal-dev libjpeg-dev libfreetype6-dev libglfw3-dev libxcursor-dev libxinerama-dev libxi-dev libsfml-dev libvpx-dev libwebp-dev liblzma-dev libfdk-aac-dev libmp3lame-dev libopus-dev libtheora-dev libx264-dev libx265-dev libbz2-dev libssl-dev libcrypto++-dev librtmp-dev libgmp-dev libxcb-shm0-dev libass-dev libgconf2-dev`
2. Install Docker by following installation instructions from [Docker Docs][1]
3. `git clone --single-branch --branch master https://github.com/CasparCG/server casparcg-server-master`
4. `cd casparcg-server-master`
5. Extract Boost, FFmpeg and CEF from the docker images via `sudo ./tools/linux/extract-deps-from-docker`. Alternatively these can be prepared manually by following the steps laid out in each Dockerfile
6. `mkdir build && cd build`
7. `cmake ../src`
8. `make -j8`
If all goes to plan, a folder called 'staging' has been created with everything you need to run CasparCG server.
[1]: https://docs.docker.com/install/linux/docker-ce/ubuntu/
Build options
-------------
-DENABLE_HTML=OFF - useful if you lack CEF, and would like to build without that module.
server-2.2.0-stable/CHANGELOG.md 0000664 0000000 0000000 00000145226 13411752632 0016120 0 ustar 00root root 0000000 0000000 CasparCG 2.2.0 Beta
==========================================
General
-------
* C++14
* Major refactoring, cleanup, optimization
and stability improvements.
* Removed unmaintained documentation API.
* Removed unmaintained program options API.
* Removed unused frame age API.
* Removed misc unused and/or unmaintained APIs.
* Removed TCP logger.
* Fixed memory leak in transition producer.
* Removed PSD Producer (moved to 3.0.0).
* Removed Text Producer (moved to 3.0.0).
* Removed SyncTo consumer.
* Removed channel layout in favor of 8 channel passthrough
and FFMPEG audio filters.
* Major stability and performance improvements of GPU code.
* Requires OpenGL 4.5.
* Repo cleanup (>2GB => <100MB when cloning).
* Misc cleanup and fixes.
Build
-----
* Linux build re done with Docker.
* Windows build re done with Nuget.
HTML
----
* Updated to Chromium 63 (Julusian).
* Allow running templates from arbitrary urls (Julusian).
DECKLINK
--------
* Fixed broken Linux.
* Misc cleanup and fixes.
* Complex FFMPEG filters (VF, AF).
MIXER
-----
* Performance improvements.
* Removed straight output (moved to 3.0.0).
* Proper OpenGL pipelining.
* Blend modes are always enabled.
* Misc cleanup and fixes.
* Removed CPU mixer.
* Mixer always runs in progressive mode. Consumers are expected to convert to interlaced if required.
IMAGE
-----
* Correctly apply alpha to base64 encoded pngs from AMCP (Julusian).
* Unmultiply frame before writing to png (Julusian).
* Removed scroll producer (moved to 3.0.0)
ROUTE
-----
* Reimplemented, simplified.
* Cross channel routing will render full stage instead of simply copying channel output.
* Reduced overhead and latency.
FFMPEG
------
* Rewritten from scratch for better accuracy, stability and
performance.
* Update freezed frame during seeking.
* FFMPEG 3.4.1.
* Reduce blocking during initialization.
* Fixed timestamp handling.
* Fixed V/A sync.
* Fixed interlacing.
* Fixed framerate handling.
* Fixed looping.
* Fixed seeking.
* Fixed duration.
* Audio resampling to match timestamps.
* Fixed invalid interlaced YUV (411, 420) handling.
* Added YUV(A)444.
* Added IO timeout.
* Added HTTP reconnect.
* FFMPEG video filter support.
* FFMPEG audio filter support.
* Complex FFMPEG filters (VF, AF).
* CALL SEEK return actually seeked value.
* All AMCP options are based on channel format.
* Misc improvements, cleanup and fixes.
Bluefish
--------
* Bluefish Consumer removed (moved to 3.0.0).
OAL
------------
* Added audio sample compensation to avoid audio distortions
during time drift.
* Misc cleanup and fixes.
Screen
---------------
* Proper OpenGL pipelining.
* Misc cleanup and fixes.
AMCP
----
* Added PING command (Julusian).
* Removed INFO commands in favor of OSC.
* Moved CLS, CINF, TLS, FLS, TLS, THUMBNAIL implementations into
a separate NodeJS service which is proxied through
an HTTP API.
* Misc cleanup and fixes.
CasparCG 2.1.0 Next (w.r.t 2.1.0 Beta 2)
==========================================
General
-------
* Removed asmlib dependency in favor of using standard library std::memcpy and
std::memset, because of better performance.
CasparCG 2.1.0 Beta 2 (w.r.t 2.1.0 Beta 1)
==========================================
General
-------
* Fail early with clear error message if configured paths are not
creatable/writable.
* Added backwards compatibility (with deprecation warning) for using
thumbnails-path instead of thumbnail-path in casparcg.config.
* Suppress the logging of full path names in stack traces so that only the
relative path within the source tree is visible.
* General stability improvements.
* Native thread id is now logged in Linux as well. Finally they are mappable
against INFO THREADS, ps and top.
* Created automatically generated build number, so that it is easier to see
whether a build is newer or older than an other.
* Changed configuration element mipmapping_default_on to mipmapping-default-on
for consistency with the rest of the configuration (Jesper Stærkær).
* Handle stdin EOF as EXIT.
* Added support for RESTART in Linux startup script run.sh.
* Copy casparcg_auto_restart.bat into Windows releases.
* Fixed bug with thumbnail generation when there are .-files in the media
folder.
* Removed CMake platform specification in Linux build script
(Krzysztof Pyrkosz).
* Build script for building FFmpeg for Linux now part of the repository.
Contributions during development (not w.r.t 2.1.0 Beta 1):
* Fix ffmpeg build dependencies on clean Ubuntu desktop amd64 14.04.3 or
higher (Walter Sonius).
* Added support for video modes 2160p5000, 2160p5994 and 2160p6000
(Antonio Ruano Cuesta).
* Fixed serious buffer overrun in FFmpeg logging code.
Consumers
---------
* FFmpeg consumer:
* Fixed long overdue bug where HD material was always recorded using the
BT.601 color matrix instead of the BT.709 color matrix. RGB codecs like
qtrle was never affected but all the YCbCr based codecs were.
* Fixed bug in parsing of paths containing -.
* Fixed bugs where previously effective arguments like -pix_fmt were
ignored.
* Fixed bug where interlaced channels where not recorded correctly for
some codecs.
* DeckLink consumer:
* Rewrote the frame hand-off between send() and ScheduledFrameCompleted() in
a way that hopefully resolves all dead-lock scenarios previously possible.
* Bluefish consumer:
* Largely rewritten against newest SDK Driver 5.11.0.47 (Satchit Nambiar and
James Wise sponsored by Bluefish444):
* Added support for Epoch Neutron and Supernova CG. All current Epoch
cards are now supported.
* Added support for for multiple SDI channels per card. 1 to 4 channels
per Bluefish444 card depending on model and firmware.
* Added support for single SDI output, complementing existing external key
output support.
* Added support for internal key using the Bluefish444 hardware keyer.
* Screen consumer:
* Fixed full screen mode.
Producers
---------
* FFmpeg producer:
* Increased the max number of frames that audio/video can be badly
interleaved with (Dimitry Ishenko).
* Fixed bug where decoders sometimes requires more than one video packet to
decode the first frame.
* Added support for IN and OUT parameters (Dimitry Ishenko).
* Added DV/HDV video device support under Linux (Walter Sonius).
* Remove unused flags variable in queued_seek (Dimitry Ishenko).
* Now recognizes .ts files without probing contents (Ovidijus Striaukas).
* Fixed uninitialized value causing initial log printout to usually say that
clips are interlaced when they are not.
* Destroy producer proxy:
* Created workaround for bug in FFmpeg where every new thread used to
cleanup caused handles to leak (not sure why). Reduced the effect by using
only one thread for all producer destructions.
* Framerate producer:
* Fixed bug when INFO was used on a not yet playing framerate producer.
* HTML producer:
* Fixed bug where only URL:s with . in them where recognized.
* Image producer:
* Added LENGTH parameter to allow for queueing with LOADBG AUTO.
* Fixed inconsistency in what file extensions are supported vs listed in
CLS/CINF.
* Layer producer:
* Fixed serious bug where a circular reference of layer producers caused a
stack overflow and server crash.
* Can now route from layer on a channel with an incompatible framerate.
* Channel producer:
* Can now route from channel with an incompatible framerate.
* Deinterlaces interlaced content from source channel.
* Added optional NO_AUTO_DEINTERLACE parameter to opt out of the mentioned
deinterlacing.
* Scene producer:
* Added abs(), floor(), to_lower(), to_upper() and length() functions to the
expression language.
* Created XML Schema for the *.scene XML format. Allows for IDE-like auto-
completion, API documentation and validation.
* Added possibility to specify the width and height of a layer instead of
letting the producer on the layer decide.
* Added global variables scene_width, scene_height and fps.
* Made it possible to use expressions in keyframe values.
* Fixed serious bug where uninitialized values were used.
* Created more example scenes.
* Can now forward CALL, CG PLAY, CG STOP, CG NEXT and CG INVOKE to the
producer on a layer.
* CG proxy wrapper producer:
* New in 2.1.0.
* Allows all CG producers to be used as an ordinary producer inside a layer
in a scene.
* Allows the Scene producer to know what variables are available in a
template.
* Color producer:
* Now has support for gradients.
* PSD producer:
* Added support for centered and right justified text.
* Text producer:
* Fixed bug where tracking contributed to the overall text width on the
last character.
Mixer
-----
* Fixed bug in the contrast/saturation/brightness code where the wrong luma
coefficients was used.
* Rewrote the chroma key code to support variable hue, instead of fixed green
or blue. Threshold setting was removed in favour of separate hue width,
minimum saturation and minimum brightness constraints. Also a much more
effective spill suppression method was implemented.
* Fixed bug where glReadPixels() was done from the last drawn to texture
instead of always from the target texture. This means that for example a
MIXER KEYER layer without a layer above to key, as well as a separate alpha
file with MIXER OPACITY 0 now works as expected.
* Fixed bug where already drawn GL_QUADS were not composited against, causing
for example italic texts to be rendered incorrectly in the text_producer.
AMCP
----
* INFO PATHS now adds all the path elements even if they are using the default
values.
* MIXER CHROMA syntax deprecated (still supported) in favour of the more
advanced syntax required by the rewritten chroma key code.
* Added special command REQ that can be prepended before any command to
identify the response with a client specified request id, allowing a client
to know exactly what asynchronous response matched a specific request.
* Added support for listing contents of a specific directory for CLS, TLS,
DATA LIST and THUMBNAIL LIST.
* Fixed bug where CINF only returned the first match.
* Fixed bug where a client closing the connection after BYE instead of
letting the server close the connection caused an exception to be logged.
CasparCG 2.1.0 Beta 1 (w.r.t 2.0.7 Stable)
==========================================
General
-------
* 64 bit!
* Linux support!
* Moved to CMake build system for better platform independence.
* Contributions before build system switch (not w.r.t 2.0.7 Stable):
* gitrev.bat adaptions for 2.1 (Thomas Kaltz III).
* Thanks to our already heavy use of the pimpl idiom, abstracting platform
specifics was easily done by having different versions of the .cpp files
included in the build depending on target platform. No #ifdef necessary,
except for in header only platform specific code.
* Flash, Bluefish and NewTek modules are not ported to the Linux build.
* Contributions during development (not w.r.t 2.0.7 Stable):
* Fixed compilation problems in Linux build (Dimitry Ishenko).
* Fixed compilation problem in GCC 5 (Krzysztof Pyrkosz).
* Fixed thumbnail image saving on Linux (Krzysztof Pyrkosz).
* Fixed compilation problem in PSD module (Krzysztof Pyrkosz).
* Major code refactoring:
* Mixer abstraction so different implementations can be created. Currently
CPU mixer and GPU mixer (previously the usage of the GPU was mandatory)
exists.
* Flattened folder structure for easier inclusion of header files.
* Many classes renamed to better describe the abstractions they provide.
* Sink parameters usually taken by value and moved into place instead of
taken by const reference as previously done.
* Old Windows specific AsyncEventServer class has been replaced by platform
independent implementation based on Boost.Asio.
* Pimpl classes are now stack allocated with internal shared_ptr to
implementation, instead of both handle and body being dynamically
allocated. This means that objects are now often passed by value instead
of via safe_ptr/shared_ptr, because they are internally reference counted.
* Protocol strategies are now easier to implement correctly, because of
separation of state between different client connections.
* Complete AMCP command refactoring.
* On-line help system that forces the developer to document AMCP commands,
producer syntaxes and consumer syntaxes making the documentation coupled
to the code, which is great.
* Added missing help for VERSION command (Jesper Stærkær).
* Upgraded Windows build to target Visual Studio 2015 making it possible to
use the C++11 features also supported by GCC 4.8 which is targeted on
Linux.
* Fixed compilation problems in Visual Studio 2015 Update 1
(Roman Tarasov)
* Created abstraction of the different forms of templates (flash, html, psd
and scene). Each module registers itself as a CG producer provides. All CG
commands transparently works with all of them.
* Audio mixer now uses double samples instead of float samples to fully
accommodate all int32 samples.
* Reduced coupling between core and modules (and modules and modules):
* Modules can register system info providers to contribute to INFO SYSTEM.
* XML configuration factories for adding support for new consumer elements
in casparcg.config.
* Server startup hooks can be registered (used by HTML producer to fork
its sub process).
* Version providers can contribute content to the VERSION command.
* Refactored multichannel audio support to use FFmpeg's PAN filter and
simplified the configuration a lot.
* Upgraded most third party libraries we depend on.
* Some unit tests have been created.
* Renamed README.txt to README, CHANGES.txt to CHANGELOG and LICENSE.txt to
LICENSE
* Created README.md for github front page in addition to README which is
distributed with builds.
* README file updates (Jonas Hummelstrand).
* Created BUILDING file describing how to build the server on Windows and
Linux.
* Diagnostics:
* Now also sent over OSC.
* Diag window is now scrollable and without squeezing of graphs.
* Contextual information such as video channel and video layer now included
in graphs.
* Logging:
* Implemented a TCP server, simply sending every log line to each connected
client. Default port is 3250.
* Changed default log level to info and moved debug statements that are
interesting in a production system to info.
* Try to not log full stack traces when user error is the cause. Stacktraces
should ideally only be logged when a system error or a programming error
has occurred.
* More contextual information about an error added to exceptions. An example
of this is that XML configuration errors now cause the XPath of the error
is logged.
* Improved the readability of the log format.
* Added optional calltrace.log for logging method calls. Allows for trace
logging to be enabled while calltracing is disabled etc.
OSC
---
* Improved message formatting performance.
* Added possibility to disable sending OSC to connected AMCP clients.
* Fixed inconsistent element name predefined_client to predefined-client in
casparcg.config (Krzysztof Pyrkosz).
Consumers
---------
* System audio consumer:
* Pushes data to openal instead of being callbacked by SFML when data is
needed.
* Added possibility to specify the expected delay in the sound card. Might
help get better consumer synchronization.
* Screen consumer:
* Added mouse interaction support, usable by the producers running on the
video channel.
* FFmpeg consumer:
* Replaced by Streaming Consumer after it was adapted to support everything
that FFmpeg Consumer did.
* Added support for recording all audio channels into separate mono audio
streams.
* Now sends recording progress via OSC.
* SyncTo consumer:
* New in 2.1.0.
* Allows the pace of a channel to follow another channel. This is useful for
virtual "precomp" channels without a DeckLink consumer to pace it.
* DeckLink consumer:
* Added workaround for timescale bug found in Decklink SDK 10.7.
* Now ScheduledFrameCompleted is no longer only used for video scheduling
but for audio as well, simplifying the code a lot.
* iVGA consumer:
* No longer provides sync to the video channel.
* Supports NewTek NDI out of the box just by upgrading the
Processing.AirSend library.
Producers
---------
* Scene producer:
* New in 2.1.0.
* Utilizes CasparCG concepts such as producers, mixer transforms and uses
them in a nested way to form infinite number of sub layers. Think movie
clip in Flash.
* A scene consists of variables, layers, timelines and marks (intro and
outro for example).
* Mostly for use by other producers but comes with a XML based producer that
is a registered CG producer and shows up in TLS.
* Enables frame accurate compositions and animations.
* Has a powerful variable binding system (think expressions in After Effects
or JavaFX Bindings).
* PSD producer:
* New in 2.1.0.
* Parses PSD files and sets up a scene for the Scene producer to display.
* Text layers based on CG parameters.
* Supports Photoshop timeline.
* Uses Photoshop comment key-frames to describe where intro and outro (CG
PLAY and CG STOP) should be in the timeline.
* Shows up as regular templates in TLS.
* Text producer:
* New in 2.1.0.
* Renders text using FreeType library.
* Is used by the PSD producer for dynamic text layers.
* Image scroll producer:
* Speed can be changed while running using a CALL. The speed change can be
tweened.
* Added support for an absolute end time so that the duration is calculated
based on when PLAY is called for shows when an exact end time is
important.
* Image producer:
* Fixed bug where too large (OpenGL limit) images were accepted, causing
problems during thumbnail generation.
* Framerate producer:
* New in 2.1.0.
* Wraps a producer with one framerate and converts it to another. It is not
usable on its own but is utilized in the FFmpeg producer and the DeckLink
consumer.
* Supports different interpolation algorithms. Currently a no-op
drop-and-repeat mode and a two different frame blending modes.
* It also supports changing the speed on demand with tweening support.
* FFmpeg producer:
* Supports decoding all audio streams from a clip. Useful with .mxf files
which usually have separate mono streams for every audio channel.
* No longer do framerate conversion (half or double), but delegates that
task to the Framerate producer.
* Added support for v4l2 devices.
* Added relative and "from end" seeking (Dimitry Ishenko).
* Contributions during development (not w.r.t 2.0.7 Stable):
* Fixed 100% CPU problem on clip EOF (Peter Keuter, Robert Nagy).
* Constrained SEEK within the length of a clip (Dimitry Ishenko).
* Fixed a regular expression (Dimitry Ishenko).
* DeckLink producer:
* No longer do framerate conversion (half or double), but delegates that
task to the Framerate producer.
* Route producer:
* Added possibility to delay frames routed from a layer or a channel.
* HTML Producer:
* Disabled web security in HTML Producer (Robert Nagy).
* Reimplemented requestAnimationFrame handling in Javascript instead of C++.
* Implemented cancelAnimationFrame.
* Increased animation smoothness in HTML Producer with interlaced video
modes.
* Added remote debugging support.
* Added mouse interaction support by utilizing the Screen consumer's new
interaction support.
* Flash Producer:
* Contributions during development (not w.r.t 2.0.7 Stable):
* Workaround for flickering with high CPU usage and CPU accelerator
(Robert Nagy)
AMCP
----
* TLS has a new column for "template type" for clients that want to
differentiate between html and flash for example.
* SET CHANNEL_LAYOUT added to be able to change the audio channel layout of a
video channel at runtime.
* HELP command added for accessing the new on-line help system.
* FLS added to list the fonts usable by the Text producer.
* LOCK command added for controlling/gaining exclusive access to a video
channel.
* LOG CATEGORY command added to enable/disable the new log categories.
* SWAP command now optionally supports swapping the transforms as well as the
layers.
* VERSION command can now provide CEF version.
CasparCG Server 2.0.7 Stable (as compared to CasparCG Server 2.0.7 Beta 2)
==========================================================================
General
-------
* Added support for using a different configuration file at startup than the
default casparcg.config by simply adding the name of the file to use as the
first command line argument to casparcg.exe.
* Upgraded FFmpeg to latest stable.
* Created build script.
* Fixed bug where both layer_producer and channel_producer display:s and
empty/late first frame when the producer is called before the consumer in
the other end has received the first frame.
* Added rudimentary support for audio for layer_producer and channel_producer.
* Upgraded DeckLink SDK to 10.1.4, bringing new 2K and 4K DCI video modes. New
template hosts also available for those modes.
* General bug fixes (mostly memory and resource leaks, some serious).
* Updated Boost to version 1.57
* Frontend no longer maintained and therefore not included in the release.
Mixer
-----
* Added support for rotation.
* Added support for changing the anchor point around which fill_translation,
fill_scale and rotation will be done from.
* Added support for perspective correct corner pinning.
* Added support for mipmapped textures with anisotropic filtering for
increased downscaling quality. Whether to enable by default can be
configured in casparcg.config.
* Added support for cropping a layer. Not the same as clipping.
AMCP
----
* Added RESUME command to complement PAUSE. (Peter Keuter)
* To support the new mixer features the following commands has been added:
* MIXER ANCHOR -- will return or modify the anchor point for a layer
(default is 0 0 for backwards compatibility). Example:
MIXER 1-10 ANCHOR 0.5 0.5
...for changing the anchor to the middle of the layer
(a MIXER 1-10 FILL 0.5 0.5 1 1 will be necessary to place the layer at the
same place on screen as it was before).
* MIXER ROTATION -- will return or modify the angle of which a layer is
rotated by (clockwise degrees) around the point specified by ANCHOR.
* MIXER PERSPECTIVE -- will return or modify the corners of the perspective
transformation of a layer. One X Y pair for each corner (order upper left,
upper right, lower right and lower left). Example:
MIXER 1-10 PERSPECTIVE 0.4 0.4 0.6 0.4 1 1 0 1
* MIXER MIPMAP -- will return or modify whether to enable mipmapping of
textures produced on a layer. Only frames produced after a change will be
affected. So for example image_producer will not be affected while the
image is displayed.
* MIXER CROP -- will return or modify how textures on a layer will be
cropped. One X Y pair each for the upper left corner and for the lower
right corner.
* Added INFO QUEUES command for debugging AMCP command queues. Useful for
debugging command queue overflows, where a command is deadlocked. Hopefully
always accessible via console, even though the TCP command queue may be
full.
* Added GL command:
- GL INFO prints information about device buffers and host buffers.
- GL GC garbage collects pooled but unused GL resources.
* Added INFO THREADS command listing the known threads and their descriptive
names. Can be matched against the thread id column of log entries.
Consumers
---------
* Removed blocking_decklink_consumer. It was more like an experiment at best
and its usefulness was questionable.
* Added a 10 second time-out for consumer sends, to detect/recover from
blocked consumers.
* Some consumers which are usually added and removed during playout (for
example ffmpeg_consumer, streaming_consumer and channel_consumer) no longer
affect the presentation time on other consumers. Previously a lag on the SDI
output could be seen when adding such consumers.
HTML producer
-------------
* No longer tries to play all files with a . in their name.
(Georgi Chorbadzhiyski)
* Reimplemented using CEF3 instead of Berkelium, which enables use of WebGL
and more. CEF3 is actively maintained, which Berkelium is not. (Robert Nagy)
* Implements a custom version of window.requestAnimationFrame which will
follow the pace of the channel, for perfectly smooth animations.
* No longer manually interlaces frames, to allow for mixer fill transforms
without artifacts.
* Now uses CEF3 event loop to avoid 100% CPU core usage.
CasparCG Server 2.0.7 Beta 2 (as compared to CasparCG Server 2.0.7 Beta 1)
==========================================================================
General
-------
* Added sending of OSC messages for channel_grid channel in addition to
regular channels.
Producers
---------
* FFmpeg: Reports correct nb_frames() when using SEEK (Thomas Kaltz III)
* Flash: Fixed bug where CG PLAY, CG INVOKE did not work.
Consumers
---------
* channel_consumer: Added support for more than one channel_consumer per
channel.
* decklink_consumer: Added support for a single instance of the consumer to
manage a separate key output for use with DeckLink Duo/Quad cards:
1
2
external_separate_device
...in the configuration will enable the feature. The value of
defaults to the value of + 1.
* synchronizing_consumer: Removed in favour of a single decklink_consumer
managing both fill and key device.
* streaming_consumer: A new implementation of ffmpeg_consumer with added
support for streaming and other PTS dependent protocols. Examples:
udp://localhost:5004
-vcodec libx264 -tune zerolatency -preset ultrafast -crf 25 -format mpegts -vf scale=240:180
...in configuration or:
ADD 1 STREAM udp://localhost:5004 -vcodec libx264 -tune zerolatency -preset ultrafast -crf 25 -format mpegts -vf scale=240:180
...via AMCP. (Robert Nagy sponsored by Ericsson Broadcasting Services)
* newtek_ivga_consumer: Added support for iVGA consumer to not provide channel
sync even though connected. Useful for iVGA clients that downloads as fast
as possible instead of in frame-rate pace, like Wirecast. To enable:
false
...in config to not provide channel sync when connected. The default is
true.
AMCP
----
* Added support in ADD and REMOVE for a placeholder which
will resolve to the connected AMCP client's IPV4 address.
* Fixed bug where AMCP commands split into multiple TCP packets where not
correctly parsed (http://casparcg.com/forum/viewtopic.php?f=3&t=2480)
CasparCG Server 2.0.7 Beta 1 (as compared to 2.0.6 Stable)
==========================================================
General
-------
* FFmpeg: Upgraded to master and adapted CasparCG to FFmpeg API changes
(Robert Nagy sponsored by SVT)
* FFmpeg: Fixed problem with frame count calculation (Thomas Kaltz III)
* Fixed broken CG UPDATE.
Producers
---------
* New HTML producer has been created (Robert Nagy sponsored by Flemish Radio
and Television Broadcasting Organization, VRT)
CasparCG Server 2.0.6 Stable (as compared to 2.0.4 Stable)
==========================================================
General
-------
* iVGA: Allow for the server to work without Processing.AirSend.x86.dll to
prevent a possible GPL violation. It is available as a separate optional
download.
* iVGA: Only provide sync to channel while connected, to prevent channel
ticking too fast.
* FFmpeg: Fixed bug during deinterlace-bob-reinterlace where output fields
were offset by one field in relation to input fields.
* FFmpeg: Fixed bug in ffmpeg_consumer where an access violation occurred
during destruction.
* FFmpeg: Improved seeking. (Robert Nagy and Thomas Kaltz III)
* Frontend: Only writes elements to casparcg.config which overrides a default
value to keep the file as compact as possible.
* System audio: Patched sfml-audio to work better with oal-consumer and
therefore removed PortAudio as the system audio implementation and went back
to oal.
* Flash: Changed so that the initial buffer fill of frames is rendered at a
frame-duration pace instead of as fast as possible. Otherwise time based
animations render incorrectly. During buffer recovery, a higher paced
rendering takes place, but still not as fast as possible, which can cause
animations to be somewhat incorrectly rendered. This is the only way though
if we want the buffer to be able to recover after depletion.
* Fixed race condition during server shutdown.
* OSC: outgoing audio levels from the audio mixer for each audio channel is
now transmitted (pFS and dBFS). (Thomas Kaltz III)
* Stage: Fixed bug where tweened transforms were only ticked when a
corresponding layer existed.
* Screen consumer: Added borderless option and correct handling of name
option. (Thomas Kaltz III)
* AMCP: CLS now reports duration and framerate for MOVIE files were
information is possible to extract. (Robert Nagy)
* Version bump to keep up with CasparCG Client version.
CasparCG Server 2.0.4 Stable (as compared to 2.0.4 Beta 1)
==========================================================
General
-------
* Can now open media with file names that only consist of digits.
(Cambell Prince)
* Miscellaneous stability and performance improvements.
Video mixer
-----------
* Conditional compilation of chroma key support and straight alpha output
support in shader (just like with blend-modes) because of performance impact
even when not in use on a layer or on a channel. New element added
to configuration for turning on mixer features that not everybody would want
to pay for (performance-wise.) blend-modes also moved into this element.
* Fixed bug where MIXER LEVELS interpreted arguments in the wrong order, so
that gamma was interpreted as max_input and vice versa.
Consumers
---------
* Added support for NewTek iVGA, which enables the use of CasparCG Server
fill+key output(s) as input source(s) to a NewTek TriCaster without
requiring video card(s) in the CasparCG Server machine, or taking up inputs
in the TriCaster. element in config enables iVGA on a
channel. (Robert Nagy sponsored by NewTek)
* DeckLink: Created custom decklink allocator to reduce the memory footprint.
* Replaced usage of SFML for with PortAudio, because of
problems with SFML since change to static linkage. Also PortAudio seems to
give lower latency.
Producers
---------
* FFmpeg: Added support for arbitrary FFmpeg options/parameters
in ffmpeg_producer. (Cambell Prince)
* Flash: Flash Player 11.8 now tested and fully supported.
* Flash: No longer starts a Flash Player to service CG commands that mean
nothing without an already running Flash Player.
* Flash: globally serialize initialization and destruction of Flash Players,
to avoid race conditions in Flash.
* Flash: changed so that the Flash buffer is filled with Flash Player
generated content at initialization instead of empty frames.
OSC
---
* Performance improvements. (Robert Nagy sponsored by Boffins Technologies)
* Never sends old values to OSC receivers. Collects the latest value of each
path logged since last UDP send, and sends the new UDP packet (to each
subscribing OSC receiver) with the values collected. (Robert Nagy sponsored
by Boffins Technologies)
* Batches as many OSC messages as possible in an OSC bundle to reduce the
number of UDP packets sent. Breakup into separate packages if necessary to
avoid fragmentation. (Robert Nagy sponsored by Boffins Technologies)
* Removed usage of Microsoft Agents library (Server ran out of memory after a
while) in favour of direct synchronous invocations.
CasparCG Server 2.0.4 Beta 1 (as compared to 2.0.3 Stable)
==========================================================
General
-------
* Front-end GUI for simplified configuration and easy access to common tasks.
(Thomas Kaltz III and Jeff Lafforgue)
* Added support for video and images file thumbnail generation. By default the
media directory is scanned every 5 seconds for new/modified/removed files
and thumbnails are generated/regenerated/removed accordingly.
* Support for new video modes: 1556p2398, 1556p2400, 1556p2500, 2160p2398,
2160p2400, 2160p2500, 2160p2997 and 2160p3000.
* Experimental ATI graphics card support by using static linking against SFML
instead of dynamic. Should improve ATI GPU support, but needs testing.
* Added support for playback and pass-through of up to 16 audio channels. See
http://casparcg.com/forum/viewtopic.php?f=3&t=1453 for more information.
* Optimizations in AMCP protocol implementations for large incoming messages,
for example base64 encoded PNG images.
* Logging output now includes milliseconds and has modified format:
YYYY-MM-DD hh:mm:ss.zzz
* Improved audio playback with 720p5994 and 720p6000 channels.
* An attempt to improve output synchronization of consumers has been made. Use
for example:
1
true
2
true
...to instruct the server to keep both DeckLink consumers in sync with each
other. Consider this experimental, so don't wrap everything in
unless synchronization of consumer outputs is needed. For
synchronization to be effective all synchronized cards must have genlock
reference signal connected.
* Transfer of source code and issue tracker to github. (Thomas Kaltz III)
Layer
-----
* Fixed a problem where the first frame was not always shown on LOAD.
(Robert Nagy)
Stage
-----
* Support for layer consumers for listening to frames coming out of producers.
(Cambell Prince)
Audio mixer
-----------
* Added support for a master volume mixer setting for each channel.
Video mixer
-----------
* Added support for chroma keying. (Cambell Prince)
* Fixed bug where MIXER CONTRAST set to < 1 can cause transparency issues.
* Experimental support for straight alpha output.
Consumers
---------
* Avoid that the FFmpeg consumer blocks the channel output when it can't keep
up with the frame rate (drops frames instead).
* Added support for to create a separate key and fill file when recording with
the FFmpeg consumer. Add the SEPARATE_KEY parameter to the FFmpeg consumer
parameter list. The key file will get the _A file name suffix to be picked
up by the separated_producer when doing playback.
* The Image consumer now writes to the media folder instead of the data
folder.
* Fixed bug in DeckLink consumer where we submit too few audio samples to the
driver when the video format has a frame rate > 50.
* Added another experimental DeckLink consumer implementation where scheduled
playback is not used, but a similar approach as in the bluefish consumer
where we wait for a frame to be displayed and then display the next frame.
It is configured via a consumer element. The benefits of
this consumer is lower latency and more deterministic synchronization
between multiple instances (should not need to be wrapped in a
element when separated key/fill is used).
Producers
---------
* Added support for playing .swf files using the Flash producer. (Robert Nagy)
* Image producer premultiplies PNG images with their alpha.
* Image producer can load a PNG image encoded as base64 via:
PLAY 1-0 [PNG_BASE64]
* FFmpeg producer can now use a directshow input filters:
PLAY 1-10 "dshow://video=Some Camera"
(Cambell Prince, Julian Waller and Robert Nagy)
* New layer producer which directs the output of a layer to another layer via
a layer consumer. (Cambell Prince)
AMCP
----
* The master volume feature is controlled via the MASTERVOLUME MIXER
parameter. Example: MIXER 1 MASTERVOLUME 0.5
* THUMBNAIL LIST/RETRIEVE/GENERATE/GENERATE_ALL command was added to support
the thumbnail feature.
* ADD 1 FILE output.mov SEPARATE_KEY activates the separate key feature of the
FFmpeg consumer creating an additional output_a.mov containing only the key.
* Added KILL command for shutting down the server without console access.
* Added RESTART command for shutting down the server in the same way as KILL
except that the return code from CasparCG Server is 5 instead of 0, which
can be used by parent process to take other actions. The
'casparcg_auto_restart.bat' script restarts the server if the return code is
5.
* DATA RETRIEVE now returns linefeeds encoded as an actual linefeed (the
single character 0x0a) instead of the previous two characters:
\ followed by n.
* MIXER CHROMA command added to control the chroma keying. Example:
MIXER 1-1 CHROMA GREEN|BLUE 0.10 0.04
(Cambell Prince)
* Fixed bug where MIXER FILL overrides any previous MIXER CLIP on the same
layer. The bug-fix also has the side effect of supporting negative scale on
MIXER FILL, causing the image to be flipped.
* MIXER STRAIGHT_ALPHA_OUTPUT added to control whether to output straight
alpha or not.
* Added INFO DELAY and INFO - DELAY commands for showing some
delay measurements.
* PLAY 1-1 2-10 creates a layer producer on 1-1 redirecting the output of
2-10. (Cambell Prince)
OSC
---
* Support for sending OSC messages over UDP to either a predefined set of
clients (servers in the OSC sense) or dynamically to the ip addresses of the
currently connected AMCP clients.
(Robert Nagy sponsored by Boffins Technologies)
* /channel/[1-9]/stage/layer/[0-9]
* always /paused [paused or not]
* color producer /color [color string]
* ffmpeg producer /profiler/time [render time] [frame duration]
* ffmpeg producer /file/time [elapsed seconds] [total seconds]
* ffmpeg producer /file/frame [frame] [total frames]
* ffmpeg producer /file/fps [fps]
* ffmpeg producer /file/path [file path]
* ffmpeg producer /loop [looping or not]
* during transitions /transition/frame [current frame] [total frames]
* during transitions /transition/type [transition type]
* flash producer /host/path [filename]
* flash producer /host/width [width]
* flash producer /host/height [height]
* flash producer /host/fps [fps]
* flash producer /buffer [buffered] [buffer size]
* image producer /file/path [file path]
CasparCG Server 2.0.3 Stable (as compared to 2.0.3 Alpha)
=========================================================
Stage
-----
* Fixed dead-lock that can occur with multiple mixer tweens. (Robert Nagy)
AMCP
----
* DATA STORE now supports creating folders of path specified if they does not
exist. (Jeff Lafforgue)
* DATA REMOVE command was added. (Jeff Lafforgue)
CasparCG Server 2.0.3 Alpha (as compared to 2.0 Stable)
=======================================================
General
-------
* Data files are now stored in UTF-8 with BOM. Latin1 files are still
supported for backwards compatibility.
* Commands written in UTF-8 to log file but only ASCII characters to console.
* Added supported video formats:
* 720p2398 (not supported by DeckLink)
* 720p2400 (not supported by DeckLink)
* 1080p5994
* 1080p6000
* 720p30 (not supported by DeckLink)
* 720p29.976 (not supported by DeckLink)
CLK
---
* CLK protocol implementation can now serve more than one connection at a time
safely.
* Added timeline support to the CLK protocol.
* Refactored parts of the CLK parser implementation.
Consumers
---------
* Consumers on same channel now invoked asynchronously to allow for proper
sync of multiple consumers.
* System audio consumer:
* no longer provides sync to the video channel.
* Screen consumer:
* Support for multiple screen consumers on the same channel
* No longer spin-waits for vsync.
* Now deinterlaces to two separate frames so for example 50i will no longer
be converted to 25p but instead to 50p for smooth playback of interlaced
content.
* DeckLink consumer now logs whether a reference signal is detected or not.
Producers
---------
* Image scroll producer:
* Field-rate motion instead of frame-rate motion with interlaced video
formats. This can be overridden by giving the PROGRESSIVE parameter.
* SPEED parameter now defines pixels per frame/field instead of half pixels
per frame. The scrolling direction is also reversed so SPEED 0.5 is the
previous equivalent of SPEED -1. Movements are done with sub-pixel
accuracy.
* Fixed incorrect starting position of image.
* Rounding error fixes to allow for more exact scrolling.
* Added support for motion blur via a new BLUR parameter
* Added PREMULTIPLY parameter to support images stored with straight alpha.
CasparCG Server 2.0 Stable (as compared to Beta 3)
==================================================
General
-------
* Misc stability and performance fixes.
Consumers
---------
* File Consumer
* Changed semantics to more closely follow FFmpeg (see forums).
* Added options, -r, -acodec, -s, -pix_fmt, -f and more.
* Screen Consumer
* Added vsync support.
CasparCG Server 2.0 Beta 3 (as compared to Beta 1)
==================================================
Formats
-------
* ProRes Support
* Both encoding and decoding.
* NTSC Support
* Updated audio-pipeline for native NTSC support. Previous implementation
did not fully support NTSC audio and could cause incorrect behaviour or
even crashes.
Consumers
---------
* File Consumer added
* See updated wiki or ask in forum for more information.
* Should support anything FFmpeg supports. However, we will work mainly with
DNxHD, PRORES and H264.
- Key-only is not supported.
* Bluefish Consumer
* 24 bit audio support.
- Embedded-audio does not work with Epoch cards.
* DeckLink Consumer
* Low latency enabled by default.
* Added graphs for driver buffers.
* Screen Consumer
* Changed screen consumer square PAL to the more common wide-square PAL.
* Can now be closed.
* Fixed interpolation artifacts when running non-square video-modes.
* Automatically deinterlace interlaced input.
Producers
---------
* DeckLink Producer
* Improved color quality be avoiding unnecessary conversion to BGRA.
* FFMPEG Producer
* Fixed missing alpha for (RGB)A formats when deinterlacing.
* Updated buffering to work better with files with long audio/video
interleaving.
* Seekable while running and after reaching EOF. CALL 1-1 SEEK 200.
* Enable/disable/query looping while running. CALL 1-1 LOOP 1.
* Fixed bug with duration calculation.
* Fixed bug with fps calculation.
* Improved auto-transcode accuracy.
* Improved seeking accuracy.
* Fixed bug with looping and LENGTH.
* Updated to newer FFmpeg version.
* Fixed incorrect scaling of NTSC DV files.
* Optimized color conversion when using YADIF filters.
* Flash Producer
* Release Flash Player when empty.
* Use native resolution TemplateHost.
* TemplateHosts are now chosen automatically if not configured. The
TemplateHost with the corresponding video-mode name is now chosen.
* Use square pixel dimensions.
AMCP
----
* When possible, commands will no longer wait for rendering pipeline. This
reduces command execution latencies, especially when sending a lot of
commands in a short timespan.
* Fixed CINF command.
* ADD/REMOVE no longer require subindex,
e.g. "ADD 1 SCREEN" / "REMOVE 1 SCREEN" instead of "ADD 1-1 SCREEN" / ...
* PARAM is renamed to CALL.
* STATUS command is replaced by INFO.
* INFO command has been extended:
* INFO (lists channels).
* INFO 1 (channel info).
* INFO 1-1 (layer info).
* INFO 1-1 F (foreground producer info).
* INFO 1-1 B (background producer info).
* INFO TEMPLATE mytemplate (template meta-data info, e.g. field names).
* CG INFO command has been extended.
* CG INFO 1 (template-host information, e.g. what layers are occupied).
Mixer
-----
* Fixed alpha with blend modes.
* Automatically deinterlace for MIXER FILL commands.
Channel
-------
* SET MODE now reverts back to old video-mode on failure.
Diagnostics
-----------
* Improved graphs and added more status information.
* Print configuration into log at startup.
* Use the same log file for the entire day, instead of one per startup as
previously.
* Diagnostics window is now closable.
CasparCG Server 2.0 Beta 1 (as compared to Alpha)
=================================================
* Blending Modes (needs to be explicitly enabled)
* overlay
* screen
* multiply
* and many more.
* Added additive keyer in addition to linear keyer.
* Image adjustments
* saturation
* brightness
* contrast
* min input-level
* max input-level
* min output-level
* max output-level
* gamma
* Support for FFmpeg-filters such as (ee http://ffmpeg.org/libavfilter.html)
* yadif deinterlacer (optimized in CasparCG for full multi-core support)
* de-noising
* dithering
* box blur
* and many more
* 32-bit SSE optimized audio pipeline.
* DeckLink-Consumer uses external-key by default.
* DeckLink-Consumer has 24 bit embedded-audio support.
* DeckLink-Producer has 24 bit embedded-audio support.
* LOADBG with AUTO feature which automatically plays queued clip when
foreground clip has ended.
* STATUS command for layers.
* LOG LEVEL command for log filtering.
* MIX transition works with transparent clips.
* Freeze on last frame.
* Producer buffering is now configurable.
* Consumer buffering is now configurable.
* Now possible to configure template-hosts for different video-modes.
* Added auto transcoder for FFmpeg producer which automatically transcodes
input video into compatible video format for the channel.
* interlacing (50p -> 50i)
* deinterlacing (50i -> 25p)
* bob-deinterlacing (50i -> 50p)
* bob-deinterlacing and reinterlacing (w1xh150i -> w2xh250i)
* doubling (25p -> 50p)
* halfing (50p -> 25p)
* field-order swap (upper <-> lower)
* Screen consumer now automatically deinterlaces when receiving interlaced
content.
* Optimized renderer.
* Renderer can now be run asynchronously with producer by using a
producer-buffer size greater than 0.
* Improved error and crash recovery.
* Improved logging.
* Added Image-Scroll-Producer.
* Key-only has now near zero performance overhead.
* Reduced memory requirements.
* Removed "warm up lag" which occurred when playing the first media clip after
the server has started.
* Added read-back fence for OpenGL device for improved multi-channel
performance.
* Memory support increased from standard 2 GB to 4 GB on 64 bit Win 7 OS.
* Added support for 2* DeckLink cards in Full HD.
* Misc bugs fixes and performance improvements.
* Color producer now support some color codes in addition to color codes, e.g.
EMPTY, BLACK, RED etc...
* Alpha value in color codes is now optional.
* More than 2 DeckLink cards might be possible but have not yet been tested.
CasparCG Server 2.0 Alpha (as compared to 1.8)
==============================================
General
-------
* Mayor refactoring for improved readability and maintainability.
* Some work towards platform-independence. Currently the greatest challenge
for full platform-independence is flash-producer.
* Misc improved scalability.
* XML-configuration.
* DeckLink
* Support for multiple DeckLink cards.
Core
----
* Multiple producers per video_channel.
* Multiple consumers per video_channel.
* Swap producers between layers and channels during run-time.
* Support for upper-field and lower-field interlacing.
* Add and remove consumers during run-time.
* Preliminary support for NTSC.
AMCP
----
* Query flash and template-host version.
* Recursive media-folder listing.
* Misc changes.
Mixer
-----
* Animated tween transforms.
* Image-Mixer
* Fully GPU accelerated (all features listed below are done on the GPU),
* Layer composition.
* Color spaces (rgba, bgra, argb, yuv, yuva, yuv-hd, yuva-hd).
* Interlacing.
* Per-layer image transforms:
* Opacity
* Gain
* Scaling
* Clipping
* Translation
* Audio Mixer
* Per-layer and per-sample audio transforms:
* Gain
* Fully internal audio mixing. Single output video_channel.
Consumers
---------
* DeckLink Consumer
* Embedded audio.
* HD support.
* Hardware clock.
* Bluefish Consumer
* Drivers are loaded on-demand (server now runs on computers without
installed Bluefish drivers).
* Embedded audio.
* Allocated frames are no longer leaked.
Producers
---------
* Decklink Producer
* Embedded audio.
* HD support.
* Color Producer
* GPU accelerated.
* FFMPEG Producer
* Asynchronous file IO.
* Parallel decoding of audio and video.
* Color space transform are moved to GPU.
* Transition Producer
* Fully interlaced transition (previously only progressive, even when
running in interlaced mode).
* Per-sample mixing between source and destination clips.
* Tween transitions.
* Flash Producer
* DirectDraw access (slightly improved performance).
* Improved time-sync. Smoother animations and proper interlacing.
* Image Producer
* Support for various image formats through FreeImage library.
Diagnostics
-----------
* Graphs for monitoring performance and events.
* Misc logging improvements.
* Separate log file for every run of the server.
* Error logging provides full exception details, instead of only printing that
an error has occurred.
* Console with real-time logging output.
* Console with AMCP input.
Removed
-------
* Registry configuration (replaced by XML Configuration).
* TGA Producer (replaced by Image Producer).
* TGA Scroll Producer
server-2.2.0-stable/CODE_OF_CONDUCT.MD 0000664 0000000 0000000 00000004305 13411752632 0016776 0 ustar 00root root 0000000 0000000 # CasparCG Code of Conduct
> CasparCG is all about showing respect and professionalism one to another.
## Community
We want a positive and inspiring community that welcomes and embraces new ideas with respect and professionalism. CasparCG community has arisen through hard work and tremendous enthusiasm of hundreds of people around the world.
This Code of Conduct is about how we behave, act and cooperate in this positive and inspiring community. Contributors and users who engage in the CasparCG project in one way or another share this Code of Conduct.
## We strive to:
### Be considerate
CasparCG is used by other people and in various environments such as production. Your actions will affect other community members and therefore we expect you to take those consequences into account when making decisions.
### Be respectful
In a community there will always be some form of disagreement, but that is no excuse for poor behavior and poor manners. Treat one another with respect and professionalism to make community members feel comfortable. We work together, as a union, to resolve conflicts and to maintain the positive and inspiring atmosphere in our community.
We do not tolerate personal attacks, racism, sexism or any other form of discrimination or abuses. Maintainers of the project have right to suspend the person who persistently breaks to our Code of Conduct.
### Be collaborative
Collaboration helps to reduce redundancy while improving the quality of the project and the software produced. To avoid misunderstanding, try to be clear when requesting for help, giving help or asking for feedback. If something is unclear ask for clarification.
### Be supportive
CasparCG community is made up by mutual respect, collaboration and professional behavior. If you witness others being discriminated or abused, think about how you can be supportive. If the identified situation is beyond your ability, ask the victim privately if some form of official intervention is needed to solve the uncomfortable situation.
### Ask for help
By asking questions early we can avoid many problems that can arise later on. We encourage you to ask questions. Those who are asked should be helpful and answer with professionalism in mind.
server-2.2.0-stable/LICENSE.md 0000664 0000000 0000000 00000104513 13411752632 0015705 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
server-2.2.0-stable/README.md 0000664 0000000 0000000 00000010542 13411752632 0015556 0 ustar 00root root 0000000 0000000 CasparCG Server
===============
Thank you for your interest in CasparCG Server, a professional software used to
play out and record professional graphics, audio and video to multiple outputs.
CasparCG Server has been in 24/7 broadcast production since 2006.
The CasparCG Server works on Windows and Linux.
Development
-----------
```bash
git clone --single-branch --branch master https://github.com/CasparCG/server
```
See [BUILDING](BUILDING.md) for instructions on how to build the CasparCG Server from source manually.
License
-------
CasparCG Server is distributed under the GNU General Public License GPLv3 or
higher, see [LICENSE](LICENSE.md) for details.
More information about CasparCG is available at http://casparcg.com/ and
in the forum at https://casparcgforum.org/
COMMON SYSTEM REQUIREMENTS FOR WINDOWS AND LINUX
------------------------------------------------
- A graphics card (GPU) capable of OpenGL 4.5 is required.
SYSTEM REQUIREMENTS FOR WINDOWS
-------------------------------
SYSTEM REQUIREMENTS FOR LINUX
-----------------------------
INSTALLATION ON WINDOWS
-----------------------
INSTALLATION ON LINUX
---------------------
RESOLVING COMMON ISSUES ON LINUX
--------------------------------
Common problems you may encounter when running on newer and unsupported
Ubuntu editions:
1. HTML producer freezes and/or throws "Fontconfig error" message
Add below line to run.sh script:
export FONTCONFIG_PATH=/etc/fonts
2. HTML producer throws "GTK theme error" message
Install gnome-themes-standard package:
sudo apt install gnome-themes-standard
3. Error while loading libgcrypt.so.11
Extract libgcrypt.so.11 and libgcrypt.so.11.8.2 to CasparCG lib/ directory.
You can get it from:
https://launchpad.net/ubuntu/+archive/primary/+files/libgcrypt11_1.5.3-2ubuntu4.2_amd64.deb
4. Error while loading libcgmanager.so.0
Install central cgroup manager daemon (client library):
sudo apt install libcgmanager0
5. Error while loading shared libraries: libgconf-2.so.4
Install GNOME configuration database system:
sudo apt -y install libgconf2-4
6. lib/libz.so.1: version `ZLIB_1.2.9' not found
cd your_casparcg_directory/lib/
sudo mv libz.so.1 libz.so.1.old
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1
INSTALLATION OF ADDITIONAL NON-GPL SOFTWARE
-------------------------------------------
- For Flash template support (Windows only):
1. Uninstall any previous version of the Adobe Flash Player using this file:
http://download.macromedia.com/get/flashplayer/current/support/uninstall_flash_player.exe
2. Download and unpack
http://download.macromedia.com/pub/flashplayer/installers/archive/fp_11.8.800.94_archive.zip
3. Install Adobe Flash Player 11.8.800.94 from the unpacked archive:
fp_11.8.800.94_archive\11_8_r800_94\flashplayer11_8r800_94_winax.exe
- For NewTek iVGA support (Windows only), please download and install the
following driver:
http://new.tk/NetworkSendRedist
CONFIGURATION
-------------
1. Configure the server by editing the self-documented "casparcg.config" file in
a text editor.
2.
1. Windows: start `casparcg_auto_restart.bat`, or `casparcg.exe` and `scanner.exe` separately.
1. Linux: start the `run.sh` program.
3. Connect to the Server from a client software, such as the "CasparCG Client"
which is available as a separate download.
DOCUMENTATION
-------------
The most up-to-date documentation is always available at
https://github.com/CasparCG/help/wiki
Ask questions in the forum: https://casparcgforum.org/
LICENSING
---------
CasparCG is distributed under the GNU General Public License GPLv3 or higher,
see the file LICENSE.txt for details.
More information, samples and documentation at:
http://casparcg.com/
https://casparcgforum.org/
https://github.com/CasparCG/help/wiki
CasparCG Server uses FFmpeg (http://ffmpeg.org/) under the GPLv2 Licence.
FFmpeg is a trademark of Fabrice Bellard, originator of the FFmpeg project.
CasparCG Server uses the Threading Building Blocks
(http://www.threadingbuildingblocks.org/) library under the GPLv2 Licence.
CasparCG Server uses FreeImage (http://freeimage.sourceforge.net/) under the
GPLv2 License.
CasparCG Server uses SFML (http://www.sfml-dev.org/) under the zlib/libpng
License.
CasparCG Server uses GLEW (http://glew.sourceforge.net) under the modified BSD
License.
CasparCG Server uses boost (http://www.boost.org/) under the Boost Software
License, version 1.0.
server-2.2.0-stable/resources/ 0000775 0000000 0000000 00000000000 13411752632 0016307 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/resources/windows/ 0000775 0000000 0000000 00000000000 13411752632 0020001 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/src/ 0000775 0000000 0000000 00000000000 13411752632 0015064 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/src/CMakeLists.txt 0000664 0000000 0000000 00000002531 13411752632 0017625 0 ustar 00root root 0000000 0000000 CMAKE_MINIMUM_REQUIRED (VERSION 3.0)
# Project settings
PROJECT ("CasparCG Server")
SET (CONFIG_VERSION_MAJOR 2)
SET (CONFIG_VERSION_MINOR 2)
SET (CONFIG_VERSION_BUG 0)
SET (CONFIG_VERSION_TAG "Stable")
option(ENABLE_HTML "Enable HTML module, require CEF" ON)
# Add custom cmake modules path
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
if (MSVC)
INCLUDE (Bootstrap_Windows)
else ()
INCLUDE (Bootstrap_Linux)
# Output build settings
IF (SUPPORTED_PLATFORM)
MESSAGE (STATUS "Supported target platform: ${SUPPORTED_PLATFORM}")
ELSE ()
MESSAGE (STATUS "Unsupported target platform, will still attempt build!")
ENDIF ()
MESSAGE (STATUS "Target platform: ${CONFIG_PLATFORM}")
MESSAGE (STATUS "Target architecture: ${CONFIG_ARCH}")
MESSAGE (STATUS "CPU Count: ${CONFIG_CPU_COUNT}")
MESSAGE (STATUS "Target build type: ${CMAKE_BUILD_TYPE}")
MESSAGE (STATUS "Build Version: ${CONFIG_VERSION_MAJOR}.${CONFIG_VERSION_MINOR}.${CONFIG_VERSION_BUG} ${CONFIG_VERSION_TAG} (Revision: ${CONFIG_VERSION_GIT_HASH})")
CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/version.tmpl" "${CMAKE_BINARY_DIR}/generated/version.h")
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/generated")
ADD_SUBDIRECTORY (accelerator)
ADD_SUBDIRECTORY (common)
ADD_SUBDIRECTORY (core)
ADD_SUBDIRECTORY (modules)
ADD_SUBDIRECTORY (protocol)
ADD_SUBDIRECTORY (shell)
endif ()
server-2.2.0-stable/src/CMakeModules/ 0000775 0000000 0000000 00000000000 13411752632 0017375 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/src/CMakeModules/Bootstrap_Linux.cmake 0000664 0000000 0000000 00000013062 13411752632 0023535 0 ustar 00root root 0000000 0000000 # Determine build (target) platform
INCLUDE (PlatformIntrospection)
TEST_FOR_SUPPORTED_PLATFORM (SUPPORTED_PLATFORM)
_DETERMINE_PLATFORM (CONFIG_PLATFORM)
_DETERMINE_ARCH (CONFIG_ARCH)
_DETERMINE_CPU_COUNT (CONFIG_CPU_COUNT)
SET (PLATFORM_FOLDER_NAME "linux")
IF (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
MESSAGE (STATUS "Setting build type to 'Release' as none was specified.")
SET (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
SET_PROPERTY (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
ENDIF ()
MARK_AS_ADVANCED (CMAKE_INSTALL_PREFIX)
FIND_PACKAGE (Git)
SET (CONFIG_VERSION_GIT_HASH "N/A")
IF (DEFINED ENV{GIT_HASH} AND NOT $ENV{GIT_HASH} STREQUAL "")
SET (CONFIG_VERSION_GIT_HASH "$ENV{GIT_HASH}")
ELSEIF (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/../.git")
EXEC_PROGRAM ("${GIT_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/../" ARGS rev-parse --verify --short HEAD OUTPUT_VARIABLE CONFIG_VERSION_GIT_HASH)
ENDIF ()
SET (BOOST_ROOT_PATH "/opt/boost" CACHE STRING "Path to Boost")
SET (ENV{BOOST_ROOT} "${BOOST_ROOT_PATH}")
SET (Boost_USE_DEBUG_LIBS ON)
SET (Boost_USE_RELEASE_LIBS OFF)
SET (Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE (Boost 1.66.0 COMPONENTS system thread chrono filesystem log locale regex date_time coroutine REQUIRED)
SET (FFMPEG_ROOT_PATH "/opt/ffmpeg/lib/pkgconfig" CACHE STRING "Path to FFMPEG")
SET (ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${FFMPEG_ROOT_PATH}")
FIND_PACKAGE (FFmpeg REQUIRED)
LINK_DIRECTORIES( ${FFMPEG_LIBRARY_DIRS} )
FIND_PACKAGE (OpenGL REQUIRED)
FIND_PACKAGE (JPEG REQUIRED)
FIND_PACKAGE (FreeImage REQUIRED)
FIND_PACKAGE (Freetype REQUIRED)
FIND_PACKAGE (GLEW REQUIRED)
FIND_PACKAGE (TBB REQUIRED)
FIND_PACKAGE (SndFile REQUIRED)
FIND_PACKAGE (OpenAL REQUIRED)
FIND_PACKAGE (GLFW REQUIRED)
FIND_PACKAGE (SFML 2 COMPONENTS graphics window system REQUIRED)
if (ENABLE_HTML)
SET(CEF_ROOT_DIR "/opt/cef" CACHE STRING "Path to CEF")
FIND_PACKAGE (CEF REQUIRED)
endif ()
SET (BOOST_INCLUDE_PATH "${Boost_INCLUDE_DIRS}")
SET (TBB_INCLUDE_PATH "${TBB_INCLUDE_DIRS}")
SET (GLEW_INCLUDE_PATH "${GLEW_INCLUDE_DIRS}")
SET (SFML_INCLUDE_PATH "${SFML_INCLUDE_DIR}")
SET (FREETYPE_INCLUDE_PATH "${FREETYPE_INCLUDE_DIRS}")
SET (FFMPEG_INCLUDE_PATH "${FFMPEG_INCLUDE_DIRS}")
SET (ASMLIB_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH}")
SET (FREEIMAGE_INCLUDE_PATH "${FreeImage_INCLUDE_DIRS}")
set(CEF_INCLUDE_PATH "${CEF_ROOT_DIR}")
set(CEF_BIN_PATH "${CEF_ROOT_DIR}/Release")
set(CEF_RESOURCE_PATH "${CEF_ROOT_DIR}/Resources")
SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON)
ADD_DEFINITIONS (-DSFML_STATIC)
ADD_DEFINITIONS (-DUNICODE)
ADD_DEFINITIONS (-D_UNICODE)
ADD_DEFINITIONS (-DGLEW_NO_GLU)
ADD_DEFINITIONS (-D__NO_INLINE__) # Needed for precompiled headers to work
ADD_DEFINITIONS (-DBOOST_NO_SWPRINTF) # swprintf on Linux seems to always use , as decimal point regardless of C-locale or C++-locale
ADD_DEFINITIONS (-DTBB_USE_CAPTURED_EXCEPTION=1)
ADD_DEFINITIONS (-DNDEBUG) # Needed for precompiled headers to work
ADD_COMPILE_OPTIONS (-std=c++14) # Needed for precompiled headers to work
ADD_COMPILE_OPTIONS (-O3) # Needed for precompiled headers to work
ADD_COMPILE_OPTIONS (-Wno-deprecated-declarations -Wno-write-strings -Wno-terminate -Wno-multichar -Wno-cpp)
ADD_COMPILE_OPTIONS (-msse3)
ADD_COMPILE_OPTIONS (-mssse3)
ADD_COMPILE_OPTIONS (-msse4.1)
ADD_COMPILE_OPTIONS (-fnon-call-exceptions) # Allow signal handler to throw exception
IF (POLICY CMP0045)
CMAKE_POLICY (SET CMP0045 OLD)
ENDIF ()
SET (CASPARCG_MODULE_INCLUDE_STATEMENTS "" CACHE INTERNAL "")
SET (CASPARCG_MODULE_INIT_STATEMENTS "" CACHE INTERNAL "")
SET (CASPARCG_MODULE_UNINIT_STATEMENTS "" CACHE INTERNAL "")
SET (CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS "" CACHE INTERNAL "")
SET (CASPARCG_MODULE_PROJECTS "" CACHE INTERNAL "")
SET (CASPARCG_RUNTIME_DEPENDENCIES "" CACHE INTERNAL "")
INCLUDE (PrecompiledHeader)
FUNCTION (casparcg_add_include_statement HEADER_FILE_TO_INCLUDE)
SET (CASPARCG_MODULE_INCLUDE_STATEMENTS "${CASPARCG_MODULE_INCLUDE_STATEMENTS}"
"#include <${HEADER_FILE_TO_INCLUDE}>"
CACHE INTERNAL ""
)
ENDFUNCTION ()
FUNCTION (casparcg_add_init_statement INIT_FUNCTION_NAME NAME_TO_LOG)
SET (CASPARCG_MODULE_INIT_STATEMENTS "${CASPARCG_MODULE_INIT_STATEMENTS}"
" ${INIT_FUNCTION_NAME}(dependencies)\;"
" CASPAR_LOG(info) << L\"Initialized ${NAME_TO_LOG} module.\"\;"
""
CACHE INTERNAL ""
)
ENDFUNCTION ()
FUNCTION (casparcg_add_uninit_statement UNINIT_FUNCTION_NAME)
SET (CASPARCG_MODULE_UNINIT_STATEMENTS
" ${UNINIT_FUNCTION_NAME}()\;"
"${CASPARCG_MODULE_UNINIT_STATEMENTS}"
CACHE INTERNAL ""
)
ENDFUNCTION ()
FUNCTION (casparcg_add_command_line_arg_interceptor INTERCEPTOR_FUNCTION_NAME)
set(CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS "${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS}"
" if (${INTERCEPTOR_FUNCTION_NAME}(argc, argv))"
" return true\;"
""
CACHE INTERNAL ""
)
ENDFUNCTION ()
FUNCTION (casparcg_add_module_project PROJECT)
SET (CASPARCG_MODULE_PROJECTS "${CASPARCG_MODULE_PROJECTS}" "${PROJECT}" CACHE INTERNAL "")
ENDFUNCTION ()
# http://stackoverflow.com/questions/7172670/best-shortest-way-to-join-a-list-in-cmake
FUNCTION (join_list VALUES GLUE OUTPUT)
STRING (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
STRING (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
SET (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
ENDFUNCTION ()
FUNCTION (casparcg_add_runtime_dependency FILE_TO_COPY)
SET (CASPARCG_RUNTIME_DEPENDENCIES "${CASPARCG_RUNTIME_DEPENDENCIES}" "${FILE_TO_COPY}" CACHE INTERNAL "")
ENDFUNCTION ()
server-2.2.0-stable/src/CMakeModules/Bootstrap_Windows.cmake 0000664 0000000 0000000 00000024624 13411752632 0024076 0 ustar 00root root 0000000 0000000 find_package(Git)
set(CONFIG_VERSION_GIT_HASH "N/A")
if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/../.git")
exec_program("${GIT_EXECUTABLE}" "${PROJECT_SOURCE_DIR}"
ARGS rev-parse --verify --short HEAD
OUTPUT_VARIABLE CONFIG_VERSION_GIT_HASH)
endif ()
CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/version.tmpl" "${CMAKE_BINARY_DIR}/generated/version.h")
INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/generated")
set(CASPARCG_MODULE_INCLUDE_STATEMENTS "" CACHE INTERNAL "")
set(CASPARCG_MODULE_INIT_STATEMENTS "" CACHE INTERNAL "")
set(CASPARCG_MODULE_UNINIT_STATEMENTS "" CACHE INTERNAL "")
set(CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS "" CACHE INTERNAL "")
set(CASPARCG_MODULE_PROJECTS "" CACHE INTERNAL "")
set(CASPARCG_RUNTIME_DEPENDENCIES "" CACHE INTERNAL "")
function(casparcg_add_include_statement HEADER_FILE_TO_INCLUDE)
set(CASPARCG_MODULE_INCLUDE_STATEMENTS "${CASPARCG_MODULE_INCLUDE_STATEMENTS}"
"#include <${HEADER_FILE_TO_INCLUDE}>"
CACHE INTERNAL "")
endfunction()
function(casparcg_add_init_statement INIT_FUNCTION_NAME NAME_TO_LOG)
set(CASPARCG_MODULE_INIT_STATEMENTS "${CASPARCG_MODULE_INIT_STATEMENTS}"
" ${INIT_FUNCTION_NAME}(dependencies)\;"
" CASPAR_LOG(info) << L\"Initialized ${NAME_TO_LOG} module.\"\;"
""
CACHE INTERNAL "")
endfunction()
function(casparcg_add_uninit_statement UNINIT_FUNCTION_NAME)
set(CASPARCG_MODULE_UNINIT_STATEMENTS
" ${UNINIT_FUNCTION_NAME}()\;"
"${CASPARCG_MODULE_UNINIT_STATEMENTS}"
CACHE INTERNAL "")
endfunction()
function(casparcg_add_command_line_arg_interceptor INTERCEPTOR_FUNCTION_NAME)
set(CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS "${CASPARCG_MODULE_COMMAND_LINE_ARG_INTERCEPTORS_STATEMENTS}"
" if (${INTERCEPTOR_FUNCTION_NAME}(argc, argv))"
" return true\;"
""
CACHE INTERNAL "")
endfunction()
function(casparcg_add_module_project PROJECT)
set(CASPARCG_MODULE_PROJECTS "${CASPARCG_MODULE_PROJECTS}" "${PROJECT}" CACHE INTERNAL "")
endfunction()
# http://stackoverflow.com/questions/7172670/best-shortest-way-to-join-a-list-in-cmake
function(join_list VALUES GLUE OUTPUT)
string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()
function(casparcg_add_runtime_dependency FILE_TO_COPY)
set(CASPARCG_RUNTIME_DEPENDENCIES "${CASPARCG_RUNTIME_DEPENDENCIES}" "${FILE_TO_COPY}" CACHE INTERNAL "")
endfunction()
set(PACKAGES_FOLDER "${PROJECT_SOURCE_DIR}/packages")
set(NUGET_PACKAGES_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/packages")
casparcg_add_runtime_dependency("${PROJECT_SOURCE_DIR}/shell/casparcg.config")
# BOOST
set(BOOST_INCLUDE_PATH "${NUGET_PACKAGES_FOLDER}/boost.1.66.0.0/lib/native/include")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_atomic-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_chrono-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_context-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_coroutine-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_date_time-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_filesystem-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_locale-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_log-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_log_setup-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_regex-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_system-vc141.1.66.0.0/lib/native")
link_directories("${NUGET_PACKAGES_FOLDER}/boost_thread-vc141.1.66.0.0/lib/native")
add_definitions( -DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE )
add_definitions( -DBOOST_COROUTINES_NO_DEPRECATION_WARNING )
# FFMPEG
set(FFMPEG_INCLUDE_PATH "${NUGET_PACKAGES_FOLDER}/FFmpeg.Nightly.20180711.0.0/build/native/include")
set(FFMPEG_BIN_PATH "${NUGET_PACKAGES_FOLDER}/FFmpeg.Nightly.20180711.0.0/build/native/bin/x64")
link_directories("${NUGET_PACKAGES_FOLDER}/FFmpeg.Nightly.20180711.0.0/build/native/lib/x64")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avcodec-58.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avdevice-58.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avfilter-7.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avformat-58.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/avutil-56.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/postproc-55.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swresample-3.dll")
casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swscale-5.dll")
# TBB
set(TBB_INCLUDE_PATH "${PACKAGES_FOLDER}/tbb/include")
set(TBB_BIN_PATH "${PACKAGES_FOLDER}/tbb/bin/win32")
link_directories("${PACKAGES_FOLDER}/tbb/lib/win32")
casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb.dll")
casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbb_debug.dll")
casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc.dll")
casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_debug.dll")
casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy.dll")
casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy_debug.dll")
# GLEW
set(GLEW_INCLUDE_PATH "${PACKAGES_FOLDER}/glew/include")
set(GLEW_BIN_PATH "${PACKAGES_FOLDER}/glew/bin/win32")
link_directories("${PACKAGES_FOLDER}/glew/lib/win32")
add_definitions( -DGLEW_NO_GLU )
casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/glew32.dll")
# SFML
set(SFML_INCLUDE_PATH "${NUGET_PACKAGES_FOLDER}/sfml-system.2.4.2.0/build/native/include")
link_directories("${NUGET_PACKAGES_FOLDER}/sfml-graphics.2.4.2.0/build/native/lib/x64/v140/Debug/dynamic")
link_directories("${NUGET_PACKAGES_FOLDER}/sfml-graphics.2.4.2.0/build/native/lib/x64/v140/Release/dynamic")
link_directories("${NUGET_PACKAGES_FOLDER}/sfml-window.2.4.2.0/build/native/lib/x64/v140/Debug/dynamic")
link_directories("${NUGET_PACKAGES_FOLDER}/sfml-window.2.4.2.0/build/native/lib/x64/v140/Release/dynamic")
link_directories("${NUGET_PACKAGES_FOLDER}/sfml-system.2.4.2.0/build/native/lib/x64/v140/Debug/dynamic")
link_directories("${NUGET_PACKAGES_FOLDER}/sfml-system.2.4.2.0/build/native/lib/x64/v140/Release/dynamic")
casparcg_add_runtime_dependency("${NUGET_PACKAGES_FOLDER}/sfml-graphics.redist.2.4.2.0/build/native/bin/x64/v140/Debug/dynamic/sfml-graphics-d-2.dll")
casparcg_add_runtime_dependency("${NUGET_PACKAGES_FOLDER}/sfml-graphics.redist.2.4.2.0/build/native/bin/x64/v140/Release/dynamic/sfml-graphics-2.dll")
casparcg_add_runtime_dependency("${NUGET_PACKAGES_FOLDER}/sfml-window.redist.2.4.2.0/build/native/bin/x64/v140/Debug/dynamic/sfml-window-d-2.dll")
casparcg_add_runtime_dependency("${NUGET_PACKAGES_FOLDER}/sfml-window.redist.2.4.2.0/build/native/bin/x64/v140/Release/dynamic/sfml-window-2.dll")
casparcg_add_runtime_dependency("${NUGET_PACKAGES_FOLDER}/sfml-system.redist.2.4.2.0/build/native/bin/x64/v140/Debug/dynamic/sfml-system-d-2.dll")
casparcg_add_runtime_dependency("${NUGET_PACKAGES_FOLDER}/sfml-system.redist.2.4.2.0/build/native/bin/x64/v140/Release/dynamic/sfml-system-2.dll")
# FREEIMAGE
set(FREEIMAGE_INCLUDE_PATH "${NUGET_PACKAGES_FOLDER}/native.freeimage.vc140.3.17.0/build/native/include")
set(FREEIMAGE_BIN_PATH "${NUGET_PACKAGES_FOLDER}/native.freeimage.vc140.redist.3.17.0/build/native/bin/x64/dynamic")
link_directories("${NUGET_PACKAGES_FOLDER}/native.freeimage.vc140.3.17.0/build/native/lib/x64")
casparcg_add_runtime_dependency("${FREEIMAGE_BIN_PATH}/FreeImage.dll")
casparcg_add_runtime_dependency("${FREEIMAGE_BIN_PATH}/FreeImaged.dll")
#ZLIB
set(ZLIB_INCLUDE_PATH "${NUGET_PACKAGES_FOLDER}/zlib-msvc-x64.1.2.11.8900/build/native/include")
link_directories("${NUGET_PACKAGES_FOLDER}/zlib-msvc-x64.1.2.11.8900/build/native/lib_release")
link_directories("${NUGET_PACKAGES_FOLDER}/zlib-msvc-x64.1.2.11.8900/build/native/lib_debug")
# OPENAL
set(OPENAL_INCLUDE_PATH "${PACKAGES_FOLDER}/openal/include")
set(OPENAL_BIN_PATH "${PACKAGES_FOLDER}/openal/bin/win32")
link_directories("${PACKAGES_FOLDER}/openal/lib/win32")
casparcg_add_runtime_dependency("${OPENAL_BIN_PATH}/OpenAL32.dll")
# LIBERATION_FONTS
set(LIBERATION_FONTS_BIN_PATH "${PROJECT_SOURCE_DIR}/shell/liberation-fonts")
casparcg_add_runtime_dependency("${LIBERATION_FONTS_BIN_PATH}/LiberationMono-Regular.ttf")
# CEF
if (ENABLE_HTML)
set(CEF_INCLUDE_PATH "${NUGET_PACKAGES_FOLDER}/cef.sdk.3.3239.1723/CEF")
set(CEF_BIN_PATH "${NUGET_PACKAGES_FOLDER}/cef.redist.x64.3.3239.1723/CEF")
set(CEF_RESOURCE_PATH "${NUGET_PACKAGES_FOLDER}/cef.redist.x64.3.3239.1723/CEF")
link_directories("${NUGET_PACKAGES_FOLDER}/cef.sdk.3.3239.1723/CEF/x64")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/locales")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/swiftshader")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/cef.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/cef_100_percent.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/cef_200_percent.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/cef_extensions.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/devtools_resources.pak")
casparcg_add_runtime_dependency("${CEF_RESOURCE_PATH}/icudtl.dat")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/natives_blob.bin")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/snapshot_blob.bin")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libcef.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/chrome_elf.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/d3dcompiler_47.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libEGL.dll")
casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libGLESv2.dll")
endif ()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
add_definitions(-DCASPAR_SOURCE_PREFIX="${CMAKE_CURRENT_SOURCE_DIR}")
add_definitions(-D_WIN32_WINNT=0x601)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa /Zi /W4 /WX /MP /fp:fast /Zm192 /FIcommon/compiler/vs/disable_silly_warnings.h")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D TBB_USE_ASSERT=1 /D TBB_USE_DEBUG /bigobj")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /Ot /Gy /bigobj")
if (POLICY CMP0045)
cmake_policy(SET CMP0045 OLD)
endif ()
include(CMakeModules/PrecompiledHeader.cmake)
add_subdirectory(accelerator)
add_subdirectory(common)
add_subdirectory(core)
add_subdirectory(modules)
add_subdirectory(protocol)
add_subdirectory(shell)
server-2.2.0-stable/src/CMakeModules/FindBoost.cmake 0000664 0000000 0000000 00000264176 13411752632 0022306 0 ustar 00root root 0000000 0000000 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindBoost
# ---------
#
# Find Boost include dirs and libraries
#
# Use this module by invoking find_package with the form::
#
# find_package(Boost
# [version] [EXACT] # Minimum or EXACT version e.g. 1.36.0
# [REQUIRED] # Fail with error if Boost is not found
# [COMPONENTS ...] # Boost libraries by their canonical name
# # e.g. "date_time" for "libboost_date_time"
# [OPTIONAL_COMPONENTS ...]
# # Optional Boost libraries by their canonical name)
# ) # e.g. "date_time" for "libboost_date_time"
#
# This module finds headers and requested component libraries OR a CMake
# package configuration file provided by a "Boost CMake" build. For the
# latter case skip to the "Boost CMake" section below. For the former
# case results are reported in variables::
#
# Boost_FOUND - True if headers and requested libraries were found
# Boost_INCLUDE_DIRS - Boost include directories
# Boost_LIBRARY_DIRS - Link directories for Boost libraries
# Boost_LIBRARIES - Boost component libraries to be linked
# Boost__FOUND - True if component was found ( is upper-case)
# Boost__LIBRARY - Libraries to link for component (may include
# target_link_libraries debug/optimized keywords)
# Boost_VERSION - BOOST_VERSION value from boost/version.hpp
# Boost_LIB_VERSION - Version string appended to library filenames
# Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
# Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
# Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
# Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
# - Pass to add_definitions() to have diagnostic
# information about Boost's automatic linking
# displayed during compilation
#
# This module reads hints about search locations from variables::
#
# BOOST_ROOT - Preferred installation prefix
# (or BOOSTROOT)
# BOOST_INCLUDEDIR - Preferred include directory e.g. /include
# BOOST_LIBRARYDIR - Preferred library directory e.g. /lib
# Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
# specified by these hint variables. Default is OFF.
# Boost_ADDITIONAL_VERSIONS
# - List of Boost versions not known to this module
# (Boost install locations may contain the version)
#
# and saves search results persistently in CMake cache entries::
#
# Boost_INCLUDE_DIR - Directory containing Boost headers
# Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
# Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
# Boost__LIBRARY_DEBUG - Component library debug variant
# Boost__LIBRARY_RELEASE - Component library release variant
#
# The following :prop_tgt:`IMPORTED` targets are also defined::
#
# Boost::boost - Target for header-only dependencies
# (Boost include directory)
# Boost:: - Target for specific component dependency
# (shared or static library); is lower-
# case
# Boost::diagnostic_definitions - interface target to enable diagnostic
# information about Boost's automatic linking
# during compilation (adds BOOST_LIB_DIAGNOSTIC)
# Boost::disable_autolinking - interface target to disable automatic
# linking with MSVC (adds BOOST_ALL_NO_LIB)
# Boost::dynamic_linking - interface target to enable dynamic linking
# linking with MSVC (adds BOOST_ALL_DYN_LINK)
#
# Implicit dependencies such as Boost::filesystem requiring
# Boost::system will be automatically detected and satisfied, even
# if system is not specified when using find_package and if
# Boost::system is not added to target_link_libraries. If using
# Boost::thread, then Threads::Threads will also be added automatically.
#
# It is important to note that the imported targets behave differently
# than variables created by this module: multiple calls to
# find_package(Boost) in the same directory or sub-directories with
# different options (e.g. static or shared) will not override the
# values of the targets created by the first call.
#
# Users may set these hints or results as cache entries. Projects
# should not read these entries directly but instead use the above
# result variables. Note that some hint names start in upper-case
# "BOOST". One may specify these as environment variables if they are
# not specified as CMake variables or cache entries.
#
# This module first searches for the Boost header files using the above
# hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
# Boost_INCLUDE_DIR. Then it searches for requested component libraries
# using the above hints (excluding BOOST_INCLUDEDIR and
# Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
# and the library name configuration settings below. It saves the
# library directories in Boost_LIBRARY_DIR_DEBUG and
# Boost_LIBRARY_DIR_RELEASE and individual library
# locations in Boost__LIBRARY_DEBUG and Boost__LIBRARY_RELEASE.
# When one changes settings used by previous searches in the same build
# tree (excluding environment variables) this module discards previous
# search results affected by the changes and searches again.
#
# Boost libraries come in many variants encoded in their file name.
# Users or projects may tell this module which variant to find by
# setting variables::
#
# Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
# and use the debug libraries. Default is ON.
# Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
# and use the release libraries. Default is ON.
# Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
# libraries ('mt' tag). Default is ON.
# Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
# libraries. Default is OFF.
# Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
# libraries linked statically to the C++ runtime
# ('s' tag). Default is platform dependent.
# Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
# libraries linked to the MS debug C++ runtime
# ('g' tag). Default is ON.
# Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
# debug Python build ('y' tag). Default is OFF.
# Boost_USE_STLPORT - Set to ON to use libraries compiled with
# STLPort ('p' tag). Default is OFF.
# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
# - Set to ON to use libraries compiled with
# STLPort deprecated "native iostreams"
# ('n' tag). Default is OFF.
# Boost_COMPILER - Set to the compiler-specific library suffix
# (e.g. "-gcc43"). Default is auto-computed
# for the C++ compiler in use. A list may be
# used if multiple compatible suffixes should
# be tested for, in decreasing order of
# preference.
# Boost_THREADAPI - Suffix for "thread" component library name,
# such as "pthread" or "win32". Names with
# and without this suffix will both be tried.
# Boost_NAMESPACE - Alternate namespace used to build boost with
# e.g. if set to "myboost", will search for
# myboost_thread instead of boost_thread.
#
# Other variables one may set to control this module are::
#
# Boost_DEBUG - Set to ON to enable debug output from FindBoost.
# Please enable this before filing any bug report.
# Boost_DETAILED_FAILURE_MSG
# - Set to ON to add detailed information to the
# failure message even when the REQUIRED option
# is not given to the find_package call.
# Boost_REALPATH - Set to ON to resolve symlinks for discovered
# libraries to assist with packaging. For example,
# the "system" component library may be resolved to
# "/usr/lib/libboost_system.so.1.42.0" instead of
# "/usr/lib/libboost_system.so". This does not
# affect linking and should not be enabled unless
# the user needs this information.
# Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
# Boost_LIBRARY_DIR_DEBUG.
#
# On Visual Studio and Borland compilers Boost headers request automatic
# linking to corresponding libraries. This requires matching libraries
# to be linked explicitly or available in the link library search path.
# In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
# dynamic linking. Boost automatic linking typically requests static
# libraries with a few exceptions (such as Boost.Python). Use::
#
# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
#
# to ask Boost to report information about automatic linking requests.
#
# Example to find Boost headers only::
#
# find_package(Boost 1.36.0)
# if(Boost_FOUND)
# include_directories(${Boost_INCLUDE_DIRS})
# add_executable(foo foo.cc)
# endif()
#
# Example to find Boost libraries and use imported targets::
#
# find_package(Boost 1.56 REQUIRED COMPONENTS
# date_time filesystem iostreams)
# add_executable(foo foo.cc)
# target_link_libraries(foo Boost::date_time Boost::filesystem
# Boost::iostreams)
#
# Example to find Boost headers and some *static* (release only) libraries::
#
# set(Boost_USE_STATIC_LIBS ON) # only find static libs
# set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
# set(Boost_USE_RELEASE_LIBS ON) # only find release libs
# set(Boost_USE_MULTITHREADED ON)
# set(Boost_USE_STATIC_RUNTIME OFF)
# find_package(Boost 1.36.0 COMPONENTS date_time filesystem system ...)
# if(Boost_FOUND)
# include_directories(${Boost_INCLUDE_DIRS})
# add_executable(foo foo.cc)
# target_link_libraries(foo ${Boost_LIBRARIES})
# endif()
#
# Boost CMake
# ^^^^^^^^^^^
#
# If Boost was built using the boost-cmake project it provides a package
# configuration file for use with find_package's Config mode. This
# module looks for the package configuration file called
# BoostConfig.cmake or boost-config.cmake and stores the result in cache
# entry "Boost_DIR". If found, the package configuration file is loaded
# and this module returns with no further action. See documentation of
# the Boost CMake package configuration for details on what it provides.
#
# Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
# Save project's policies
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
#-------------------------------------------------------------------------------
# Before we go searching, check whether boost-cmake is available, unless the
# user specifically asked NOT to search for boost-cmake.
#
# If Boost_DIR is set, this behaves as any find_package call would. If not,
# it looks at BOOST_ROOT and BOOSTROOT to find Boost.
#
if (NOT Boost_NO_BOOST_CMAKE)
# If Boost_DIR is not set, look for BOOSTROOT and BOOST_ROOT as alternatives,
# since these are more conventional for Boost.
if ("$ENV{Boost_DIR}" STREQUAL "")
if (NOT "$ENV{BOOST_ROOT}" STREQUAL "")
set(ENV{Boost_DIR} $ENV{BOOST_ROOT})
elseif (NOT "$ENV{BOOSTROOT}" STREQUAL "")
set(ENV{Boost_DIR} $ENV{BOOSTROOT})
endif()
endif()
# Do the same find_package call but look specifically for the CMake version.
# Note that args are passed in the Boost_FIND_xxxxx variables, so there is no
# need to delegate them to this find_package call.
find_package(Boost QUIET NO_MODULE)
mark_as_advanced(Boost_DIR)
# If we found boost-cmake, then we're done. Print out what we found.
# Otherwise let the rest of the module try to find it.
if (Boost_FOUND)
message(STATUS "Boost ${Boost_FIND_VERSION} found.")
if (Boost_FIND_COMPONENTS)
message(STATUS "Found Boost components:\n ${Boost_FIND_COMPONENTS}")
endif()
# Restore project's policies
cmake_policy(POP)
return()
endif()
endif()
#-------------------------------------------------------------------------------
# FindBoost functions & macros
#
############################################
#
# Check the existence of the libraries.
#
############################################
# This macro was taken directly from the FindQt4.cmake file that is included
# with the CMake distribution. This is NOT my work. All work was done by the
# original authors of the FindQt4.cmake file. Only minor modifications were
# made to remove references to Qt and make this file more generally applicable
# And ELSE/ENDIF pairs were removed for readability.
#########################################################################
macro(_Boost_ADJUST_LIB_VARS basename)
if(Boost_INCLUDE_DIR )
if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
# single-config generators, set optimized and debug libraries
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig OR CMAKE_BUILD_TYPE)
set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
else()
# For single-config generators where CMAKE_BUILD_TYPE has no value,
# just use the release libraries
set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
endif()
# FIXME: This probably should be set for both cases
set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
endif()
# if only the release version was found, set the debug variable also to the release version
if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
endif()
# if only the debug version was found, set the release variable also to the debug version
if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
endif()
# If the debug & release library ends up being the same, omit the keywords
if("${Boost_${basename}_LIBRARY_RELEASE}" STREQUAL "${Boost_${basename}_LIBRARY_DEBUG}")
set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE} )
endif()
if(Boost_${basename}_LIBRARY AND Boost_${basename}_HEADER)
set(Boost_${basename}_FOUND ON)
if("x${basename}" STREQUAL "xTHREAD" AND NOT TARGET Threads::Threads)
string(APPEND Boost_ERROR_REASON_THREAD " (missing dependency: Threads)")
set(Boost_THREAD_FOUND OFF)
endif()
endif()
endif()
# Make variables changeable to the advanced user
mark_as_advanced(
Boost_${basename}_LIBRARY_RELEASE
Boost_${basename}_LIBRARY_DEBUG
)
endmacro()
# Detect changes in used variables.
# Compares the current variable value with the last one.
# In short form:
# v != v_LAST -> CHANGED = 1
# v is defined, v_LAST not -> CHANGED = 1
# v is not defined, but v_LAST is -> CHANGED = 1
# otherwise -> CHANGED = 0
# CHANGED is returned in variable named ${changed_var}
macro(_Boost_CHANGE_DETECT changed_var)
set(${changed_var} 0)
foreach(v ${ARGN})
if(DEFINED _Boost_COMPONENTS_SEARCHED)
if(${v})
if(_${v}_LAST)
string(COMPARE NOTEQUAL "${${v}}" "${_${v}_LAST}" _${v}_CHANGED)
else()
set(_${v}_CHANGED 1)
endif()
elseif(_${v}_LAST)
set(_${v}_CHANGED 1)
endif()
if(_${v}_CHANGED)
set(${changed_var} 1)
endif()
else()
set(_${v}_CHANGED 0)
endif()
endforeach()
endmacro()
#
# Find the given library (var).
# Use 'build_type' to support different lib paths for RELEASE or DEBUG builds
#
macro(_Boost_FIND_LIBRARY var build_type)
find_library(${var} ${ARGN})
if(${var})
# If this is the first library found then save Boost_LIBRARY_DIR_[RELEASE,DEBUG].
if(NOT Boost_LIBRARY_DIR_${build_type})
get_filename_component(_dir "${${var}}" PATH)
set(Boost_LIBRARY_DIR_${build_type} "${_dir}" CACHE PATH "Boost library directory ${build_type}" FORCE)
endif()
elseif(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
# Try component-specific hints but do not save Boost_LIBRARY_DIR_[RELEASE,DEBUG].
find_library(${var} HINTS ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT} ${ARGN})
endif()
# If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is known then search only there.
if(Boost_LIBRARY_DIR_${build_type})
set(_boost_LIBRARY_SEARCH_DIRS_${build_type} ${Boost_LIBRARY_DIR_${build_type}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
" Boost_LIBRARY_DIR_${build_type} = ${Boost_LIBRARY_DIR_${build_type}}"
" _boost_LIBRARY_SEARCH_DIRS_${build_type} = ${_boost_LIBRARY_SEARCH_DIRS_${build_type}}")
endif()
endif()
endmacro()
#-------------------------------------------------------------------------------
#
# Runs compiler with "-dumpversion" and parses major/minor
# version with a regex.
#
function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION)
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1\\2"
_boost_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
endfunction()
#
# Take a list of libraries with "thread" in it
# and prepend duplicates with "thread_${Boost_THREADAPI}"
# at the front of the list
#
function(_Boost_PREPEND_LIST_WITH_THREADAPI _output)
set(_orig_libnames ${ARGN})
string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames "${_orig_libnames}")
set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE)
endfunction()
#
# If a library is found, replace its cache entry with its REALPATH
#
function(_Boost_SWAP_WITH_REALPATH _library _docstring)
if(${_library})
get_filename_component(_boost_filepathreal ${${_library}} REALPATH)
unset(${_library} CACHE)
set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}")
endif()
endfunction()
function(_Boost_CHECK_SPELLING _var)
if(${_var})
string(TOUPPER ${_var} _var_UC)
message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling. The proper spelling is ${_var_UC}.")
endif()
endfunction()
# Guesses Boost's compiler prefix used in built library names
# Returns the guess by setting the variable pointed to by _ret
function(_Boost_GUESS_COMPILER_PREFIX _ret)
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel")
if(WIN32)
set (_boost_COMPILER "-iw")
else()
set (_boost_COMPILER "-il")
endif()
elseif (GHSMULTI)
set(_boost_COMPILER "-ghs")
elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
set(_boost_COMPILER "-vc141;-vc140")
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
set(_boost_COMPILER "-vc140")
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
set(_boost_COMPILER "-vc120")
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)
set(_boost_COMPILER "-vc110")
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
set(_boost_COMPILER "-vc100")
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15)
set(_boost_COMPILER "-vc90")
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
set(_boost_COMPILER "-vc80")
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)
set(_boost_COMPILER "-vc71")
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) # Good luck!
set(_boost_COMPILER "-vc7") # yes, this is correct
else() # VS 6.0 Good luck!
set(_boost_COMPILER "-vc6") # yes, this is correct
endif()
elseif (BORLAND)
set(_boost_COMPILER "-bcb")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
set(_boost_COMPILER "-sw")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
set(_boost_COMPILER "-xlc")
elseif (MINGW)
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
else()
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
endif()
elseif (UNIX)
if (CMAKE_COMPILER_IS_GNUCXX)
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
else()
_Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION)
# Determine which version of GCC we have.
if(APPLE)
if(Boost_MINOR_VERSION)
if(${Boost_MINOR_VERSION} GREATER 35)
# In Boost 1.36.0 and newer, the mangled compiler name used
# on Mac OS X/Darwin is "xgcc".
set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
else()
# In Boost <= 1.35.0, there is no mangled compiler name for
# the Mac OS X/Darwin version of GCC.
set(_boost_COMPILER "")
endif()
else()
# We don't know the Boost version, so assume it's
# pre-1.36.0.
set(_boost_COMPILER "")
endif()
else()
set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
endif()
endif()
endif ()
else()
# TODO at least Boost_DEBUG here?
set(_boost_COMPILER "")
endif()
set(${_ret} ${_boost_COMPILER} PARENT_SCOPE)
endfunction()
#
# Get component dependencies. Requires the dependencies to have been
# defined for the Boost release version.
#
# component - the component to check
# _ret - list of library dependencies
#
function(_Boost_COMPONENT_DEPENDENCIES component _ret)
# Note: to add a new Boost release, run
#
# % cmake -DBOOST_DIR=/path/to/boost/source -P Utilities/Scripts/BoostScanDeps.cmake
#
# The output may be added in a new block below. If it's the same as
# the previous release, simply update the version range of the block
# for the previous release. Also check if any new components have
# been added, and add any new components to
# _Boost_COMPONENT_HEADERS.
#
# This information was originally generated by running
# BoostScanDeps.cmake against every boost release to date supported
# by FindBoost:
#
# % for version in /path/to/boost/sources/*
# do
# cmake -DBOOST_DIR=$version -P Utilities/Scripts/BoostScanDeps.cmake
# done
#
# The output was then updated by search and replace with these regexes:
#
# - Strip message(STATUS) prefix dashes
# s;^-- ;;
# - Indent
# s;^set(; set(;;
# - Add conditionals
# s;Scanning /path/to/boost/sources/boost_\(.*\)_\(.*\)_\(.*); elseif(NOT Boost_VERSION VERSION_LESS \10\20\3 AND Boost_VERSION VERSION_LESS xxxx);
#
# This results in the logic seen below, but will require the xxxx
# replacing with the following Boost release version (or the next
# minor version to be released, e.g. 1.59 was the latest at the time
# of writing, making 1.60 the next, so 106000 is the needed version
# number). Identical consecutive releases were then merged together
# by updating the end range of the first block and removing the
# following redundant blocks.
#
# Running the script against all historical releases should be
# required only if the BoostScanDeps.cmake script logic is changed.
# The addition of a new release should only require it to be run
# against the new release.
set(_Boost_IMPORTED_TARGETS TRUE)
if(Boost_VERSION VERSION_LESS 103300)
message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION} (all versions older than 1.33)")
set(_Boost_IMPORTED_TARGETS FALSE)
elseif(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
set(_Boost_REGEX_DEPENDENCIES thread)
set(_Boost_WAVE_DEPENDENCIES filesystem thread)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 103500 AND Boost_VERSION VERSION_LESS 103600)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 103600 AND Boost_VERSION VERSION_LESS 103800)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 103800 AND Boost_VERSION VERSION_LESS 104300)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104300 AND Boost_VERSION VERSION_LESS 104400)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104400 AND Boost_VERSION VERSION_LESS 104500)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104500 AND Boost_VERSION VERSION_LESS 104700)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104700 AND Boost_VERSION VERSION_LESS 104800)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104800 AND Boost_VERSION VERSION_LESS 105000)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105000 AND Boost_VERSION VERSION_LESS 105300)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105300 AND Boost_VERSION VERSION_LESS 105400)
set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105400 AND Boost_VERSION VERSION_LESS 105500)
set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105500 AND Boost_VERSION VERSION_LESS 105600)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105600 AND Boost_VERSION VERSION_LESS 105900)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105900 AND Boost_VERSION VERSION_LESS 106000)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 106000 AND Boost_VERSION VERSION_LESS 106100)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 106100 AND Boost_VERSION VERSION_LESS 106200)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106300)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 106300 AND Boost_VERSION VERSION_LESS 106500)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_COROUTINE2_DEPENDENCIES context fiber thread chrono system date_time)
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
else()
if(NOT Boost_VERSION VERSION_LESS 106500)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_NUMPY_DEPENDENCIES python)
set(_Boost_RANDOM_DEPENDENCIES system)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
endif()
if(NOT Boost_VERSION VERSION_LESS 106700)
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
endif()
endif()
string(TOUPPER ${component} uppercomponent)
set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${uppercomponent}_DEPENDENCIES}")
if (NOT _boost_DEPS_STRING)
set(_boost_DEPS_STRING "(none)")
endif()
# message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}")
endfunction()
#
# Get component headers. This is the primary header (or headers) for
# a given component, and is used to check that the headers are present
# as well as the library itself as an extra sanity check of the build
# environment.
#
# component - the component to check
# _hdrs
#
function(_Boost_COMPONENT_HEADERS component _hdrs)
# Note: new boost components will require adding here. The header
# must be present in all versions of Boost providing a library.
set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp")
set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
set(_Boost_FIBER_HEADERS "boost/fiber/all.hpp")
set(_Boost_FILESYSTEM_HEADERS "boost/filesystem/path.hpp")
set(_Boost_GRAPH_HEADERS "boost/graph/adjacency_list.hpp")
set(_Boost_GRAPH_PARALLEL_HEADERS "boost/graph/adjacency_list.hpp")
set(_Boost_IOSTREAMS_HEADERS "boost/iostreams/stream.hpp")
set(_Boost_LOCALE_HEADERS "boost/locale.hpp")
set(_Boost_LOG_HEADERS "boost/log/core.hpp")
set(_Boost_LOG_SETUP_HEADERS "boost/log/detail/setup_config.hpp")
set(_Boost_MATH_HEADERS "boost/math_fwd.hpp")
set(_Boost_MATH_C99_HEADERS "boost/math/tr1.hpp")
set(_Boost_MATH_C99F_HEADERS "boost/math/tr1.hpp")
set(_Boost_MATH_C99L_HEADERS "boost/math/tr1.hpp")
set(_Boost_MATH_TR1_HEADERS "boost/math/tr1.hpp")
set(_Boost_MATH_TR1F_HEADERS "boost/math/tr1.hpp")
set(_Boost_MATH_TR1L_HEADERS "boost/math/tr1.hpp")
set(_Boost_MPI_HEADERS "boost/mpi.hpp")
set(_Boost_MPI_PYTHON_HEADERS "boost/mpi/python/config.hpp")
set(_Boost_NUMPY_HEADERS "boost/python/numpy.hpp")
set(_Boost_PRG_EXEC_MONITOR_HEADERS "boost/test/prg_exec_monitor.hpp")
set(_Boost_PROGRAM_OPTIONS_HEADERS "boost/program_options.hpp")
set(_Boost_PYTHON_HEADERS "boost/python.hpp")
set(_Boost_RANDOM_HEADERS "boost/random.hpp")
set(_Boost_REGEX_HEADERS "boost/regex.hpp")
set(_Boost_SERIALIZATION_HEADERS "boost/serialization/serialization.hpp")
set(_Boost_SIGNALS_HEADERS "boost/signals.hpp")
set(_Boost_SYSTEM_HEADERS "boost/system/config.hpp")
set(_Boost_TEST_EXEC_MONITOR_HEADERS "boost/test/test_exec_monitor.hpp")
set(_Boost_THREAD_HEADERS "boost/thread.hpp")
set(_Boost_TIMER_HEADERS "boost/timer.hpp")
set(_Boost_TYPE_ERASURE_HEADERS "boost/type_erasure/config.hpp")
set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp")
set(_Boost_WAVE_HEADERS "boost/wave.hpp")
set(_Boost_WSERIALIZATION_HEADERS "boost/archive/text_wiarchive.hpp")
if(WIN32)
set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
endif()
string(TOUPPER ${component} uppercomponent)
set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE)
string(REGEX REPLACE ";" " " _boost_HDRS_STRING "${_Boost_${uppercomponent}_HEADERS}")
if (NOT _boost_HDRS_STRING)
set(_boost_HDRS_STRING "(none)")
endif()
# message(STATUS "Headers for Boost::${component}: ${_boost_HDRS_STRING}")
endfunction()
#
# Determine if any missing dependencies require adding to the component list.
#
# Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component,
# plus _Boost_IMPORTED_TARGETS (TRUE if imported targets should be
# defined; FALSE if dependency information is unavailable).
#
# componentvar - the component list variable name
# extravar - the indirect dependency list variable name
#
#
function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
# _boost_unprocessed_components - list of components requiring processing
# _boost_processed_components - components already processed (or currently being processed)
# _boost_new_components - new components discovered for future processing
#
list(APPEND _boost_unprocessed_components ${${componentvar}})
while(_boost_unprocessed_components)
list(APPEND _boost_processed_components ${_boost_unprocessed_components})
foreach(component ${_boost_unprocessed_components})
string(TOUPPER ${component} uppercomponent)
set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
_Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES)
set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES})
if (NOT ("${componentdep}" IN_LIST _boost_processed_components OR "${componentdep}" IN_LIST _boost_new_components))
list(APPEND _boost_new_components ${componentdep})
endif()
endforeach()
endforeach()
set(_boost_unprocessed_components ${_boost_new_components})
unset(_boost_new_components)
endwhile()
set(_boost_extra_components ${_boost_processed_components})
if(_boost_extra_components AND ${componentvar})
list(REMOVE_ITEM _boost_extra_components ${${componentvar}})
endif()
set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
set(${extravar} ${_boost_extra_components} PARENT_SCOPE)
endfunction()
#
# Some boost libraries may require particular set of compler features.
# The very first one was `boost::fiber` introduced in Boost 1.62.
# One can check required compiler features of it in
# `${Boost_ROOT}/libs/fiber/build/Jamfile.v2`.
#
function(_Boost_COMPILER_FEATURES component _ret)
# Boost >= 1.62 and < 1.67
if(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106700)
set(_Boost_FIBER_COMPILER_FEATURES
cxx_alias_templates
cxx_auto_type
cxx_constexpr
cxx_defaulted_functions
cxx_final
cxx_lambdas
cxx_noexcept
cxx_nullptr
cxx_rvalue_references
cxx_thread_local
cxx_variadic_templates
)
endif()
string(TOUPPER ${component} uppercomponent)
set(${_ret} ${_Boost_${uppercomponent}_COMPILER_FEATURES} PARENT_SCOPE)
endfunction()
#
# Update library search directory hint variable with paths used by prebuilt boost binaries.
#
# Prebuilt windows binaries (https://sourceforge.net/projects/boost/files/boost-binaries/)
# have library directories named using MSVC compiler version and architecture.
# This function would append corresponding directories if MSVC is a current compiler,
# so having `BOOST_ROOT` would be enough to specify to find everything.
#
function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlibvar basedir)
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_arch_suffix 64)
else()
set(_arch_suffix 32)
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.1)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.0)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.0)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-12.0)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-11.0)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-10.0)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-9.0)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-8.0)
endif()
set(${componentlibvar} ${${componentlibvar}} PARENT_SCOPE)
endif()
endfunction()
#
# End functions/macros
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# main.
#-------------------------------------------------------------------------------
# If the user sets Boost_LIBRARY_DIR, use it as the default for both
# configurations.
if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR)
set(Boost_LIBRARY_DIR_RELEASE "${Boost_LIBRARY_DIR}")
endif()
if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR)
set(Boost_LIBRARY_DIR_DEBUG "${Boost_LIBRARY_DIR}")
endif()
if(NOT DEFINED Boost_USE_DEBUG_LIBS)
set(Boost_USE_DEBUG_LIBS TRUE)
endif()
if(NOT DEFINED Boost_USE_RELEASE_LIBS)
set(Boost_USE_RELEASE_LIBS TRUE)
endif()
if(NOT DEFINED Boost_USE_MULTITHREADED)
set(Boost_USE_MULTITHREADED TRUE)
endif()
if(NOT DEFINED Boost_USE_DEBUG_RUNTIME)
set(Boost_USE_DEBUG_RUNTIME TRUE)
endif()
# Check the version of Boost against the requested version.
if(Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34")
endif()
if(Boost_FIND_VERSION_EXACT)
# The version may appear in a directory with or without the patch
# level, even when the patch level is non-zero.
set(_boost_TEST_VERSIONS
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
else()
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
#
# Note: When adding a new Boost release, also update the dependency
# information in _Boost_COMPONENT_DEPENDENCIES and
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
"1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"
"1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
"1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
"1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
"1.34" "1.33.1" "1.33.0" "1.33")
set(_boost_TEST_VERSIONS)
if(Boost_FIND_VERSION)
set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
# Select acceptable versions.
foreach(version ${_Boost_KNOWN_VERSIONS})
if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
# This version is high enough.
list(APPEND _boost_TEST_VERSIONS "${version}")
elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
# This version is a short-form for the requested version with
# the patch level dropped.
list(APPEND _boost_TEST_VERSIONS "${version}")
endif()
endforeach()
else()
# Any version is acceptable.
set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
endif()
endif()
# The reason that we failed to find Boost. This will be set to a
# user-friendly message when we fail to find some necessary piece of
# Boost.
set(Boost_ERROR_REASON)
if(Boost_DEBUG)
# Output some of their choices
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
endif()
# Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
# will only contain any interface definitions on WIN32, but is created
# on all platforms to keep end user code free from platform dependent
# code. Also provide convenience targets to disable autolinking and
# enable dynamic linking.
if(NOT TARGET Boost::diagnostic_definitions)
add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
add_library(Boost::disable_autolinking INTERFACE IMPORTED)
add_library(Boost::dynamic_linking INTERFACE IMPORTED)
endif()
if(WIN32)
# In windows, automatic linking is performed, so you do not have
# to specify the libraries. If you are linking to a dynamic
# runtime, then you can choose to link to either a static or a
# dynamic Boost library, the default is to do a static link. You
# can alter this for a specific library "whatever" by defining
# BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
# linked dynamically. Alternatively you can force all Boost
# libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
# This feature can be disabled for Boost library "whatever" by
# defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
# BOOST_ALL_NO_LIB.
# If you want to observe which libraries are being linked against
# then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
# code to emit a #pragma message each time a library is selected
# for linking.
set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
set_target_properties(Boost::diagnostic_definitions PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
set_target_properties(Boost::disable_autolinking PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
set_target_properties(Boost::dynamic_linking PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
endif()
_Boost_CHECK_SPELLING(Boost_ROOT)
_Boost_CHECK_SPELLING(Boost_LIBRARYDIR)
_Boost_CHECK_SPELLING(Boost_INCLUDEDIR)
# Collect environment variable inputs as hints. Do not consider changes.
foreach(v BOOSTROOT BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR)
set(_env $ENV{${v}})
if(_env)
file(TO_CMAKE_PATH "${_env}" _ENV_${v})
else()
set(_ENV_${v} "")
endif()
endforeach()
if(NOT _ENV_BOOST_ROOT AND _ENV_BOOSTROOT)
set(_ENV_BOOST_ROOT "${_ENV_BOOSTROOT}")
endif()
# Collect inputs and cached results. Detect changes since the last run.
if(NOT BOOST_ROOT AND BOOSTROOT)
set(BOOST_ROOT "${BOOSTROOT}")
endif()
set(_Boost_VARS_DIR
BOOST_ROOT
Boost_NO_SYSTEM_PATHS
)
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Declared as CMake or Environmental Variables:")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
" BOOST_ROOT = ${BOOST_ROOT}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
" BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
" BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
endif()
# ------------------------------------------------------------------------
# Search for Boost include DIR
# ------------------------------------------------------------------------
set(_Boost_VARS_INC BOOST_INCLUDEDIR Boost_INCLUDE_DIR Boost_ADDITIONAL_VERSIONS)
_Boost_CHANGE_DETECT(_Boost_CHANGE_INCDIR ${_Boost_VARS_DIR} ${_Boost_VARS_INC})
# Clear Boost_INCLUDE_DIR if it did not change but other input affecting the
# location did. We will find a new one based on the new inputs.
if(_Boost_CHANGE_INCDIR AND NOT _Boost_INCLUDE_DIR_CHANGED)
unset(Boost_INCLUDE_DIR CACHE)
endif()
if(NOT Boost_INCLUDE_DIR)
set(_boost_INCLUDE_SEARCH_DIRS "")
if(BOOST_INCLUDEDIR)
list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR})
elseif(_ENV_BOOST_INCLUDEDIR)
list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_INCLUDEDIR})
endif()
if( BOOST_ROOT )
list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${BOOST_ROOT})
elseif( _ENV_BOOST_ROOT )
list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_ROOT}/include ${_ENV_BOOST_ROOT})
endif()
if( Boost_NO_SYSTEM_PATHS)
list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
else()
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
foreach(ver ${_Boost_KNOWN_VERSIONS})
string(REPLACE "." "_" ver "${ver}")
list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
endforeach()
endif()
list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS
C:/boost/include
C:/boost
/sw/local/include
)
endif()
# Try to find Boost by stepping backwards through the Boost versions
# we know about.
# Build a list of path suffixes for each version.
set(_boost_PATH_SUFFIXES)
foreach(_boost_VER ${_boost_TEST_VERSIONS})
# Add in a path suffix, based on the required version, ideally
# we could read this from version.hpp, but for that to work we'd
# need to know the include dir already
set(_boost_BOOSTIFIED_VERSION)
# Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
if(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
set(_boost_BOOSTIFIED_VERSION
"${CMAKE_MATCH_1}_${CMAKE_MATCH_2}_${CMAKE_MATCH_3}")
elseif(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)")
set(_boost_BOOSTIFIED_VERSION
"${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
endif()
list(APPEND _boost_PATH_SUFFIXES
"boost-${_boost_BOOSTIFIED_VERSION}"
"boost_${_boost_BOOSTIFIED_VERSION}"
"boost/boost-${_boost_BOOSTIFIED_VERSION}"
"boost/boost_${_boost_BOOSTIFIED_VERSION}"
)
endforeach()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Include debugging info:")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
" _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
" _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}")
endif()
# Look for a standard boost header file.
find_path(Boost_INCLUDE_DIR
NAMES boost/config.hpp
HINTS ${_boost_INCLUDE_SEARCH_DIRS}
PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
)
endif()
# ------------------------------------------------------------------------
# Extract version information from version.hpp
# ------------------------------------------------------------------------
# Set Boost_FOUND based only on header location and version.
# It will be updated below for component libraries.
if(Boost_INCLUDE_DIR)
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
endif()
# Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
set(Boost_VERSION 0)
set(Boost_LIB_VERSION "")
file(STRINGS "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS REGEX "#define BOOST_(LIB_)?VERSION ")
set(_Boost_VERSION_REGEX "([0-9]+)")
set(_Boost_LIB_VERSION_REGEX "\"([0-9_]+)\"")
foreach(v VERSION LIB_VERSION)
if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_${v} ${_Boost_${v}_REGEX}")
set(Boost_${v} "${CMAKE_MATCH_1}")
endif()
endforeach()
unset(_boost_VERSION_HPP_CONTENTS)
math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
string(APPEND Boost_ERROR_REASON
"Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"version.hpp reveals boost "
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
endif()
if(Boost_FIND_VERSION)
# Set Boost_FOUND based on requested version.
set(_Boost_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
if("${_Boost_VERSION}" VERSION_LESS "${Boost_FIND_VERSION}")
set(Boost_FOUND 0)
set(_Boost_VERSION_AGE "old")
elseif(Boost_FIND_VERSION_EXACT AND
NOT "${_Boost_VERSION}" VERSION_EQUAL "${Boost_FIND_VERSION}")
set(Boost_FOUND 0)
set(_Boost_VERSION_AGE "new")
else()
set(Boost_FOUND 1)
endif()
if(NOT Boost_FOUND)
# State that we found a version of Boost that is too new or too old.
string(APPEND Boost_ERROR_REASON
"\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
if (Boost_FIND_VERSION_PATCH)
string(APPEND Boost_ERROR_REASON
".${Boost_FIND_VERSION_PATCH}")
endif ()
if (NOT Boost_FIND_VERSION_EXACT)
string(APPEND Boost_ERROR_REASON " (or newer)")
endif ()
string(APPEND Boost_ERROR_REASON ".")
endif ()
else()
# Caller will accept any Boost version.
set(Boost_FOUND 1)
endif()
else()
set(Boost_FOUND 0)
string(APPEND Boost_ERROR_REASON
"Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
endif()
# ------------------------------------------------------------------------
# Prefix initialization
# ------------------------------------------------------------------------
set(Boost_LIB_PREFIX "")
if ( (GHSMULTI AND Boost_USE_STATIC_LIBS) OR
(WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) )
set(Boost_LIB_PREFIX "lib")
endif()
if ( NOT Boost_NAMESPACE )
set(Boost_NAMESPACE "boost")
endif()
# ------------------------------------------------------------------------
# Suffix initialization and compiler suffix detection.
# ------------------------------------------------------------------------
set(_Boost_VARS_NAME
Boost_NAMESPACE
Boost_COMPILER
Boost_THREADAPI
Boost_USE_DEBUG_PYTHON
Boost_USE_MULTITHREADED
Boost_USE_STATIC_LIBS
Boost_USE_STATIC_RUNTIME
Boost_USE_STLPORT
Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
)
_Boost_CHANGE_DETECT(_Boost_CHANGE_LIBNAME ${_Boost_VARS_NAME})
# Setting some more suffixes for the library
if (Boost_COMPILER)
set(_boost_COMPILER ${Boost_COMPILER})
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"using user-specified Boost_COMPILER = ${_boost_COMPILER}")
endif()
else()
# Attempt to guess the compiler suffix
# NOTE: this is not perfect yet, if you experience any issues
# please report them and use the Boost_COMPILER variable
# to work around the problems.
_Boost_GUESS_COMPILER_PREFIX(_boost_COMPILER)
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"guessed _boost_COMPILER = ${_boost_COMPILER}")
endif()
endif()
set (_boost_MULTITHREADED "-mt")
if( NOT Boost_USE_MULTITHREADED )
set (_boost_MULTITHREADED "")
endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_MULTITHREADED = ${_boost_MULTITHREADED}")
endif()
#======================
# Systematically build up the Boost ABI tag for the 'tagged' and 'versioned' layouts
# http://boost.org/doc/libs/1_66_0/more/getting_started/windows.html#library-naming
# http://boost.org/doc/libs/1_66_0/boost/config/auto_link.hpp
# http://boost.org/doc/libs/1_66_0/tools/build/src/tools/common.jam
# http://boost.org/doc/libs/1_66_0/boostcpp.jam
set( _boost_RELEASE_ABI_TAG "-")
set( _boost_DEBUG_ABI_TAG "-")
# Key Use this library when:
# s linking statically to the C++ standard library and
# compiler runtime support libraries.
if(Boost_USE_STATIC_RUNTIME)
set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s")
set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s")
endif()
# g using debug versions of the standard and runtime
# support libraries
if(WIN32 AND Boost_USE_DEBUG_RUNTIME)
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang"
OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel")
string(APPEND _boost_DEBUG_ABI_TAG "g")
endif()
endif()
# y using special debug build of python
if(Boost_USE_DEBUG_PYTHON)
string(APPEND _boost_DEBUG_ABI_TAG "y")
endif()
# d using a debug version of your code
string(APPEND _boost_DEBUG_ABI_TAG "d")
# p using the STLport standard library rather than the
# default one supplied with your compiler
if(Boost_USE_STLPORT)
string(APPEND _boost_RELEASE_ABI_TAG "p")
string(APPEND _boost_DEBUG_ABI_TAG "p")
endif()
# n using the STLport deprecated "native iostreams" feature
# removed from the documentation in 1.43.0 but still present in
# boost/config/auto_link.hpp
if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
string(APPEND _boost_RELEASE_ABI_TAG "n")
string(APPEND _boost_DEBUG_ABI_TAG "n")
endif()
# -x86 Architecture and address model tag
# First character is the architecture, then word-size, either 32 or 64
# Only used in 'versioned' layout, added in Boost 1.66.0
set(_boost_ARCHITECTURE_TAG "")
# {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600)
string(APPEND _boost_ARCHITECTURE_TAG "-")
# This needs to be kept in-sync with the section of CMakePlatformId.h.in
# inside 'defined(_WIN32) && defined(_MSC_VER)'
if(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "IA64")
string(APPEND _boost_ARCHITECTURE_TAG "i")
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "X86"
OR ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "x64")
string(APPEND _boost_ARCHITECTURE_TAG "x")
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} MATCHES "^ARM")
string(APPEND _boost_ARCHITECTURE_TAG "a")
elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "MIPS")
string(APPEND _boost_ARCHITECTURE_TAG "m")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
string(APPEND _boost_ARCHITECTURE_TAG "64")
else()
string(APPEND _boost_ARCHITECTURE_TAG "32")
endif()
endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}")
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}")
endif()
# ------------------------------------------------------------------------
# Begin finding boost libraries
# ------------------------------------------------------------------------
set(_Boost_VARS_LIB "")
foreach(c DEBUG RELEASE)
set(_Boost_VARS_LIB_${c} BOOST_LIBRARYDIR Boost_LIBRARY_DIR_${c})
list(APPEND _Boost_VARS_LIB ${_Boost_VARS_LIB_${c}})
_Boost_CHANGE_DETECT(_Boost_CHANGE_LIBDIR_${c} ${_Boost_VARS_DIR} ${_Boost_VARS_LIB_${c}} Boost_INCLUDE_DIR)
# Clear Boost_LIBRARY_DIR_${c} if it did not change but other input affecting the
# location did. We will find a new one based on the new inputs.
if(_Boost_CHANGE_LIBDIR_${c} AND NOT _Boost_LIBRARY_DIR_${c}_CHANGED)
unset(Boost_LIBRARY_DIR_${c} CACHE)
endif()
# If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is set, prefer its value.
if(Boost_LIBRARY_DIR_${c})
set(_boost_LIBRARY_SEARCH_DIRS_${c} ${Boost_LIBRARY_DIR_${c}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
else()
set(_boost_LIBRARY_SEARCH_DIRS_${c} "")
if(BOOST_LIBRARYDIR)
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_LIBRARYDIR})
elseif(_ENV_BOOST_LIBRARYDIR)
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_LIBRARYDIR})
endif()
if(BOOST_ROOT)
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_ROOT}/lib ${BOOST_ROOT}/stage/lib)
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${BOOST_ROOT}")
elseif(_ENV_BOOST_ROOT)
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_ROOT}/lib ${_ENV_BOOST_ROOT}/stage/lib)
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${_ENV_BOOST_ROOT}")
endif()
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c}
${Boost_INCLUDE_DIR}/lib
${Boost_INCLUDE_DIR}/../lib
${Boost_INCLUDE_DIR}/stage/lib
)
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}/..")
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}")
if( Boost_NO_SYSTEM_PATHS )
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
else()
foreach(ver ${_Boost_KNOWN_VERSIONS})
string(REPLACE "." "_" ver "${ver}")
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
endforeach()
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/boost")
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} PATHS
C:/boost/lib
C:/boost
/sw/local/lib
)
endif()
endif()
endforeach()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"_boost_LIBRARY_SEARCH_DIRS_RELEASE = ${_boost_LIBRARY_SEARCH_DIRS_RELEASE}"
"_boost_LIBRARY_SEARCH_DIRS_DEBUG = ${_boost_LIBRARY_SEARCH_DIRS_DEBUG}")
endif()
# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
if( Boost_USE_STATIC_LIBS )
set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(WIN32)
list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .lib .a)
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif()
endif()
# We want to use the tag inline below without risking double dashes
if(_boost_RELEASE_ABI_TAG)
if(${_boost_RELEASE_ABI_TAG} STREQUAL "-")
set(_boost_RELEASE_ABI_TAG "")
endif()
endif()
if(_boost_DEBUG_ABI_TAG)
if(${_boost_DEBUG_ABI_TAG} STREQUAL "-")
set(_boost_DEBUG_ABI_TAG "")
endif()
endif()
# The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled
# on WIN32 was to:
# 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
# 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
# We maintain this behavior since changing it could break people's builds.
# To disable the ambiguous behavior, the user need only
# set Boost_USE_STATIC_RUNTIME either ON or OFF.
set(_boost_STATIC_RUNTIME_WORKAROUND false)
if(WIN32 AND Boost_USE_STATIC_LIBS)
if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
set(_boost_STATIC_RUNTIME_WORKAROUND TRUE)
endif()
endif()
# On versions < 1.35, remove the System library from the considered list
# since it wasn't added until 1.35.
if(Boost_VERSION AND Boost_FIND_COMPONENTS)
if(Boost_VERSION LESS 103500)
list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
endif()
endif()
# Additional components may be required via component dependencies.
# Add any missing components to the list.
_Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS _Boost_EXTRA_FIND_COMPONENTS)
# If thread is required, get the thread libs as a dependency
if("thread" IN_LIST Boost_FIND_COMPONENTS)
if(Boost_FIND_QUIETLY)
set(_Boost_find_quiet QUIET)
else()
set(_Boost_find_quiet "")
endif()
find_package(Threads ${_Boost_find_quiet})
unset(_Boost_find_quiet)
endif()
# If the user changed any of our control inputs flush previous results.
if(_Boost_CHANGE_LIBDIR_DEBUG OR _Boost_CHANGE_LIBDIR_RELEASE OR _Boost_CHANGE_LIBNAME)
foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
foreach(c DEBUG RELEASE)
set(_var Boost_${UPPERCOMPONENT}_LIBRARY_${c})
unset(${_var} CACHE)
set(${_var} "${_var}-NOTFOUND")
endforeach()
endforeach()
set(_Boost_COMPONENTS_SEARCHED "")
endif()
foreach(COMPONENT ${Boost_FIND_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
set( _boost_docstring_release "Boost ${COMPONENT} library (release)")
set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)")
# Compute component-specific hints.
set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "")
if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR
${COMPONENT} STREQUAL "graph_parallel")
foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES})
if(IS_ABSOLUTE "${lib}")
get_filename_component(libdir "${lib}" PATH)
string(REPLACE "\\" "/" libdir "${libdir}")
list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT ${libdir})
endif()
endforeach()
endif()
# Consolidate and report component-specific hints.
if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Component-specific library search paths for ${COMPONENT}: "
"${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT}")
endif()
endif()
#
# Find headers
#
_Boost_COMPONENT_HEADERS("${COMPONENT}" Boost_${UPPERCOMPONENT}_HEADER_NAME)
# Look for a standard boost header file.
if(Boost_${UPPERCOMPONENT}_HEADER_NAME)
if(EXISTS "${Boost_INCLUDE_DIR}/${Boost_${UPPERCOMPONENT}_HEADER_NAME}")
set(Boost_${UPPERCOMPONENT}_HEADER ON)
else()
set(Boost_${UPPERCOMPONENT}_HEADER OFF)
endif()
else()
set(Boost_${UPPERCOMPONENT}_HEADER ON)
message(WARNING "No header defined for ${COMPONENT}; skipping header check")
endif()
#
# Find RELEASE libraries
#
unset(_boost_RELEASE_NAMES)
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
endforeach()
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
if(_boost_STATIC_RUNTIME_WORKAROUND)
set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
endforeach()
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
endif()
if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
_Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}")
endif()
# if Boost_LIBRARY_DIR_RELEASE is not defined,
# but Boost_LIBRARY_DIR_DEBUG is, look there first for RELEASE libs
if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR_DEBUG)
list(INSERT _boost_LIBRARY_SEARCH_DIRS_RELEASE 0 ${Boost_LIBRARY_DIR_DEBUG})
endif()
# Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_RELEASE}")
if(Boost_USE_RELEASE_LIBS)
_Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE RELEASE
NAMES ${_boost_RELEASE_NAMES}
HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
NAMES_PER_DIR
DOC "${_boost_docstring_release}"
)
endif()
#
# Find DEBUG libraries
#
unset(_boost_DEBUG_NAMES)
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
endforeach()
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
if(_boost_STATIC_RUNTIME_WORKAROUND)
set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
endforeach()
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
endif()
if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
_Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}")
endif()
# if Boost_LIBRARY_DIR_DEBUG is not defined,
# but Boost_LIBRARY_DIR_RELEASE is, look there first for DEBUG libs
if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR_RELEASE)
list(INSERT _boost_LIBRARY_SEARCH_DIRS_DEBUG 0 ${Boost_LIBRARY_DIR_RELEASE})
endif()
# Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_DEBUG}")
if(Boost_USE_DEBUG_LIBS)
_Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG DEBUG
NAMES ${_boost_DEBUG_NAMES}
HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
NAMES_PER_DIR
DOC "${_boost_docstring_debug}"
)
endif ()
if(Boost_REALPATH)
_Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}")
_Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" )
endif()
_Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
# Check if component requires some compiler features
_Boost_COMPILER_FEATURES(${COMPONENT} _Boost_${UPPERCOMPONENT}_COMPILER_FEATURES)
endforeach()
# Restore the original find library ordering
if( Boost_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# ------------------------------------------------------------------------
# End finding boost libraries
# ------------------------------------------------------------------------
set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
set(Boost_LIBRARY_DIRS)
if(Boost_LIBRARY_DIR_RELEASE)
list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_RELEASE})
endif()
if(Boost_LIBRARY_DIR_DEBUG)
list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_DEBUG})
endif()
if(Boost_LIBRARY_DIRS)
list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS)
endif()
# The above setting of Boost_FOUND was based only on the header files.
# Update it for the requested component libraries.
if(Boost_FOUND)
# The headers were found. Check for requested component libs.
set(_boost_CHECKED_COMPONENT FALSE)
set(_Boost_MISSING_COMPONENTS "")
foreach(COMPONENT ${Boost_FIND_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
set(_boost_CHECKED_COMPONENT TRUE)
if(NOT Boost_${UPPERCOMPONENT}_FOUND AND Boost_FIND_REQUIRED_${COMPONENT})
list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
endif()
endforeach()
if(_Boost_MISSING_COMPONENTS AND _Boost_EXTRA_FIND_COMPONENTS)
# Optional indirect dependencies are not counted as missing.
list(REMOVE_ITEM _Boost_MISSING_COMPONENTS ${_Boost_EXTRA_FIND_COMPONENTS})
endif()
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
endif()
if (_Boost_MISSING_COMPONENTS)
set(Boost_FOUND 0)
# We were unable to find some libraries, so generate a sensible
# error message that lists the libraries we were unable to find.
string(APPEND Boost_ERROR_REASON
"\nCould not find the following")
if(Boost_USE_STATIC_LIBS)
string(APPEND Boost_ERROR_REASON " static")
endif()
string(APPEND Boost_ERROR_REASON
" Boost libraries:\n")
foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
string(APPEND Boost_ERROR_REASON
" ${Boost_NAMESPACE}_${COMPONENT}${Boost_ERROR_REASON_${UPPERCOMPONENT}}\n")
endforeach()
list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
string(APPEND Boost_ERROR_REASON
"No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
else ()
string(APPEND Boost_ERROR_REASON
"Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
endif ()
endif ()
if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
# Compatibility Code for backwards compatibility with CMake
# 2.4's FindBoost module.
# Look for the boost library path.
# Note that the user may not have installed any libraries
# so it is quite possible the Boost_LIBRARY_DIRS may not exist.
set(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
endif()
if("${_boost_LIB_DIR}" MATCHES "/include$")
# Strip off the trailing "/include" in the path.
get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
endif()
if(EXISTS "${_boost_LIB_DIR}/lib")
string(APPEND _boost_LIB_DIR /lib)
elseif(EXISTS "${_boost_LIB_DIR}/stage/lib")
string(APPEND _boost_LIB_DIR "/stage/lib")
else()
set(_boost_LIB_DIR "")
endif()
if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR})
endif()
endif()
else()
# Boost headers were not found so no components were found.
foreach(COMPONENT ${Boost_FIND_COMPONENTS})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
set(Boost_${UPPERCOMPONENT}_FOUND 0)
endforeach()
endif()
# ------------------------------------------------------------------------
# Add imported targets
# ------------------------------------------------------------------------
if(Boost_FOUND)
# For header-only libraries
if(NOT TARGET Boost::boost)
add_library(Boost::boost INTERFACE IMPORTED)
if(Boost_INCLUDE_DIRS)
set_target_properties(Boost::boost PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
endif()
endif()
foreach(COMPONENT ${Boost_FIND_COMPONENTS})
if(_Boost_IMPORTED_TARGETS AND NOT TARGET Boost::${COMPONENT})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
if(Boost_${UPPERCOMPONENT}_FOUND)
if(Boost_USE_STATIC_LIBS)
add_library(Boost::${COMPONENT} STATIC IMPORTED)
else()
# Even if Boost_USE_STATIC_LIBS is OFF, we might have static
# libraries as a result.
add_library(Boost::${COMPONENT} UNKNOWN IMPORTED)
endif()
if(Boost_INCLUDE_DIRS)
set_target_properties(Boost::${COMPONENT} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
endif()
if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY}")
set_target_properties(Boost::${COMPONENT} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY}")
endif()
if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Boost::${COMPONENT} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
endif()
if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Boost::${COMPONENT} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
endif()
if(_Boost_${UPPERCOMPONENT}_DEPENDENCIES)
unset(_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES)
foreach(dep ${_Boost_${UPPERCOMPONENT}_DEPENDENCIES})
list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Boost::${dep})
endforeach()
if(COMPONENT STREQUAL "thread")
list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Threads::Threads)
endif()
set_target_properties(Boost::${COMPONENT} PROPERTIES
INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}")
endif()
if(_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES)
set_target_properties(Boost::${COMPONENT} PROPERTIES
INTERFACE_COMPILE_FEATURES "${_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES}")
endif()
endif()
endif()
endforeach()
endif()
# ------------------------------------------------------------------------
# Notification to end user about what was found
# ------------------------------------------------------------------------
set(Boost_LIBRARIES "")
if(Boost_FOUND)
if(NOT Boost_FIND_QUIETLY)
message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
if(Boost_FIND_COMPONENTS)
message(STATUS "Found the following Boost libraries:")
endif()
endif()
foreach( COMPONENT ${Boost_FIND_COMPONENTS} )
string( TOUPPER ${COMPONENT} UPPERCOMPONENT )
if( Boost_${UPPERCOMPONENT}_FOUND )
if(NOT Boost_FIND_QUIETLY)
message (STATUS " ${COMPONENT}")
endif()
list(APPEND Boost_LIBRARIES ${Boost_${UPPERCOMPONENT}_LIBRARY})
endif()
endforeach()
else()
if(Boost_FIND_REQUIRED)
message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
else()
if(NOT Boost_FIND_QUIETLY)
# we opt not to automatically output Boost_ERROR_REASON here as
# it could be quite lengthy and somewhat imposing in its requests
# Since Boost is not always a required dependency we'll leave this
# up to the end-user.
if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG)
message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}")
else()
message(STATUS "Could NOT find Boost")
endif()
endif()
endif()
endif()
# Configure display of cache entries in GUI.
foreach(v BOOSTROOT BOOST_ROOT ${_Boost_VARS_INC} ${_Boost_VARS_LIB})
get_property(_type CACHE ${v} PROPERTY TYPE)
if(_type)
set_property(CACHE ${v} PROPERTY ADVANCED 1)
if("x${_type}" STREQUAL "xUNINITIALIZED")
if("x${v}" STREQUAL "xBoost_ADDITIONAL_VERSIONS")
set_property(CACHE ${v} PROPERTY TYPE STRING)
else()
set_property(CACHE ${v} PROPERTY TYPE PATH)
endif()
endif()
endif()
endforeach()
# Record last used values of input variables so we can
# detect on the next run if the user changed them.
foreach(v
${_Boost_VARS_INC} ${_Boost_VARS_LIB}
${_Boost_VARS_DIR} ${_Boost_VARS_NAME}
)
if(DEFINED ${v})
set(_${v}_LAST "${${v}}" CACHE INTERNAL "Last used ${v} value.")
else()
unset(_${v}_LAST CACHE)
endif()
endforeach()
# Maintain a persistent list of components requested anywhere since
# the last flush.
set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}")
list(APPEND _Boost_COMPONENTS_SEARCHED ${Boost_FIND_COMPONENTS})
list(REMOVE_DUPLICATES _Boost_COMPONENTS_SEARCHED)
list(SORT _Boost_COMPONENTS_SEARCHED)
set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}"
CACHE INTERNAL "Components requested for this build tree.")
# Restore project's policies
cmake_policy(POP)
server-2.2.0-stable/src/CMakeModules/FindCEF.cmake 0000664 0000000 0000000 00000004011 13411752632 0021571 0 ustar 00root root 0000000 0000000 include(FindPackageHandleStandardArgs)
SET(CEF_ROOT_DIR "" CACHE PATH "Path to a CEF distributed build")
message(STATUS "Looking for Chromium Embedded Framework in ${CEF_ROOT_DIR}")
find_path(CEF_INCLUDE_DIR "include/cef_version.h"
HINTS ${CEF_ROOT_DIR})
if(APPLE)
find_library(CEF_LIBRARY
NAMES cef libcef cef.lib libcef.o "Chromium Embedded Framework"
NO_DEFAULT_PATH
PATHS ${CEF_ROOT_DIR} ${CEF_ROOT_DIR}/Release)
find_library(CEFWRAPPER_LIBRARY
NAMES cef_dll_wrapper libcef_dll_wrapper
NO_DEFAULT_PATH
PATHS ${CEF_ROOT_DIR}/build/libcef_dll/Release
${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Release
${CEF_ROOT_DIR}/build/libcef_dll
${CEF_ROOT_DIR}/build/libcef_dll_wrapper)
else()
find_library(CEF_LIBRARY
NAMES cef libcef cef.lib libcef.o "Chromium Embedded Framework"
PATHS ${CEF_ROOT_DIR} ${CEF_ROOT_DIR}/Release)
find_library(CEFWRAPPER_LIBRARY
NAMES cef_dll_wrapper libcef_dll_wrapper
PATHS ${CEF_ROOT_DIR}/build/libcef_dll/Release
${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Release
${CEF_ROOT_DIR}/build/libcef_dll
${CEF_ROOT_DIR}/build/libcef_dll_wrapper
${CEF_ROOT_DIR}/Release)
if(WIN32)
find_library(CEFWRAPPER_LIBRARY_DEBUG
NAMES cef_dll_wrapper libcef_dll_wrapper
PATHS ${CEF_ROOT_DIR}/build/libcef_dll/Debug ${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Debug)
endif()
endif()
if(NOT CEF_LIBRARY)
set(CEF_FOUND FALSE)
message(FATAL_ERROR "Could not find the CEF shared library" )
return()
endif()
if(NOT CEFWRAPPER_LIBRARY)
set(CEF_FOUND FALSE)
message(FATAL_ERROR "Could not find the CEF wrapper library" )
return()
endif()
if(WIN32)
set(CEF_LIBRARIES
${CEF_LIBRARY}
optimized ${CEFWRAPPER_LIBRARY})
if (CEFWRAPPER_LIBRARY_DEBUG)
list(APPEND CEF_LIBRARIES
debug ${CEFWRAPPER_LIBRARY_DEBUG})
endif()
else()
set(CEF_LIBRARIES
${CEF_LIBRARY}
${CEFWRAPPER_LIBRARY})
endif()
find_package_handle_standard_args(CEF DEFAULT_MSG CEF_LIBRARY
CEFWRAPPER_LIBRARY CEF_INCLUDE_DIR)
mark_as_advanced(CEF_LIBRARY CEF_WRAPPER_LIBRARY CEF_LIBRARIES
CEF_INCLUDE_DIR)
server-2.2.0-stable/src/CMakeModules/FindFFmpeg.cmake 0000664 0000000 0000000 00000013605 13411752632 0022351 0 ustar 00root root 0000000 0000000 # vim: ts=2 sw=2
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
#
# Once done this will define
# FFMPEG_FOUND - System has the all required components.
# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
#
# For each of the components it will additionally set.
# - AVCODEC
# - AVDEVICE
# - AVFORMAT
# - AVFILTER
# - AVUTIL
# - POSTPROC
# - SWSCALE
# the following variables will be defined
# _FOUND - System has
# _INCLUDE_DIRS - Include directory necessary for using the headers
# _LIBRARIES - Link these to use
# _DEFINITIONS - Compiler switches required for using
# _VERSION - The components version
#
# Copyright (c) 2006, Matthias Kretz,
# Copyright (c) 2008, Alexander Neundorf,
# Copyright (c) 2011, Michael Jansen,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(FindPackageHandleStandardArgs)
# The default components were taken from a survey over other FindFFMPEG.cmake files
if (NOT FFmpeg_FIND_COMPONENTS)
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL AVDEVICE AVFILTER POSTPROC SWSCALE SWRESAMPLE)
endif ()
#
### Macro: set_component_found
#
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
#
macro(set_component_found _component )
if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
# message(STATUS " - ${_component} found.")
set(${_component}_FOUND TRUE)
else ()
# message(STATUS " - ${_component} not found.")
endif ()
endmacro()
#
### Macro: find_component
#
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
# include directories.
#
macro(find_component _component _pkgconfig _library _header)
if (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(${_component} ${_pkgconfig})
endif ()
endif (NOT WIN32)
find_path(${_component}_INCLUDE_DIRS ${_header}
HINTS
${PC_LIB${_component}_INCLUDEDIR}
${PC_LIB${_component}_INCLUDE_DIRS}
PATH_SUFFIXES
ffmpeg
)
find_library(${_component}_LIBRARIES NAMES ${_library}
HINTS
${PC_LIB${_component}_LIBDIR}
${PC_LIB${_component}_LIBRARY_DIRS}
)
set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
set_component_found(${_component})
mark_as_advanced(
${_component}_LIBRARY_DIRS
${_component}_INCLUDE_DIRS
${_component}_LIBRARIES
${_component}_DEFINITIONS
${_component}_VERSION
)
endmacro()
# Check for cached results. If there are skip the costly part.
if (NOT FFMPEG_LIBRARIES)
# Check for all possible component.
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h)
# Check if the required components were found and add their stuff to the FFMPEG_* vars.
foreach (_component ${FFmpeg_FIND_COMPONENTS})
if (${_component}_FOUND)
# message(STATUS "Required component ${_component} present.")
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
list(APPEND FFMPEG_LIBRARY_DIRS ${${_component}_LIBRARY_DIRS})
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
else ()
# message(STATUS "Required component ${_component} missing.")
endif ()
endforeach ()
# Build the include path with duplicates removed.
if (FFMPEG_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
endif ()
# Build the lib path with duplicates removed.
if (FFMPEG_LIBRARY_DIRS)
list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS)
endif ()
# cache the vars.
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
set(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBRARY_DIRS} CACHE STRING "The FFmpeg lib directories." FORCE)
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
mark_as_advanced(
FFMPEG_INCLUDE_DIRS
FFMPEG_LIBRARY_DIRS
FFMPEG_LIBRARIES
FFMPEG_DEFINITIONS
)
endif ()
# Now set the noncached _FOUND vars for the components.
foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
set_component_found(${_component})
endforeach ()
# Compile the list of required vars
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
foreach (_component ${FFmpeg_FIND_COMPONENTS})
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
endforeach ()
# Give a nice error message if some of the required vars are missing.
find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
server-2.2.0-stable/src/CMakeModules/FindFreeImage.cmake 0000664 0000000 0000000 00000004177 13411752632 0023035 0 ustar 00root root 0000000 0000000 # Find FreeImage includes and library
#
# This module defines
# FreeImage_INCLUDE_DIRS
# FreeImage_LIBRARIES, the libraries to link against to use FreeImage.
# FreeImage_LIBRARY_DIRS, the location of the libraries
# FreeImage_FOUND, If false, do not try to use FreeImage
#
# Copyright © 2007, Matt Williams
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF (FreeImage_LIBRARIES AND FreeImage_INCLUDE_DIRS)
SET(FreeImage_FIND_QUIETLY TRUE) # Already in cache, be silent
ELSE(FreeImage_LIBRARIES AND FreeImage_INCLUDE_DIRS)
MESSAGE(STATUS "Looking for FreeImage")
ENDIF (FreeImage_LIBRARIES AND FreeImage_INCLUDE_DIRS)
SET(FreeImage_INCLUDE_SEARCH_DIRS
${FreeImage_LIBRARY_SEARCH_DIRS}
${CMAKE_LIBRARY_PATH}
/opt/freeimage/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(FreeImage_LIBRARY_SEARCH_DIRS
${FreeImage_LIBRARY_SEARCH_DIRS}
${CMAKE_LIBRARY_PATH}
/opt/freeimage/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
FIND_PATH(FreeImage_INCLUDE_DIRS FreeImage.h ${FreeImage_INCLUDE_SEARCH_DIRS})
FIND_LIBRARY(FreeImage_LIBRARIES freeimage PATHS ${FreeImage_LIBRARY_SEARCH_DIRS})
#Do some preparation
SEPARATE_ARGUMENTS(FreeImage_INCLUDE_DIRS)
SEPARATE_ARGUMENTS(FreeImage_LIBRARIES)
MARK_AS_ADVANCED(FreeImage_INCLUDE_DIRS FreeImage_LIBRARIES FreeImage_LIBRARY_DIRS)
IF (FreeImage_INCLUDE_DIRS AND FreeImage_LIBRARIES)
SET(FreeImage_FOUND TRUE)
ENDIF (FreeImage_INCLUDE_DIRS AND FreeImage_LIBRARIES)
IF (FreeImage_FOUND)
IF (NOT FreeImage_FIND_QUIETLY)
MESSAGE(STATUS " libraries : ${FreeImage_LIBRARIES} from ${FreeImage_LIBRARY_DIRS}")
MESSAGE(STATUS " includes : ${FreeImage_INCLUDE_DIRS}")
ENDIF (NOT FreeImage_FIND_QUIETLY)
ELSE (FreeImage_FOUND)
IF (FreeImage_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find FreeImage")
ENDIF (FreeImage_FIND_REQUIRED)
ENDIF (FreeImage_FOUND)
server-2.2.0-stable/src/CMakeModules/FindGLFW.cmake 0000664 0000000 0000000 00000017145 13411752632 0021747 0 ustar 00root root 0000000 0000000 #
# Copyright 2013 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
# Try to find GLFW library and include path.
# Once done this will define
#
# GLFW_FOUND
# GLFW_INCLUDE_DIR
# GLFW_LIBRARIES
#
find_path( GLFW_INCLUDE_DIR
NAMES
GLFW/glfw3.h
HINTS
"${GLFW_LOCATION}/include"
"$ENV{GLFW_LOCATION}/include"
PATHS
"$ENV{PROGRAMFILES}/GLFW/include"
"${OPENGL_INCLUDE_DIR}"
/usr/openwin/share/include
/usr/openwin/include
/usr/X11R6/include
/usr/include/X11
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglfw
/usr/local/include
/usr/include/GL
/usr/include
DOC
"The directory where GLFW/glfw3.h resides"
)
#
# XXX: Do we still need to search for GL/glfw.h?
#
find_path( GLFW_INCLUDE_DIR
NAMES
GL/glfw.h
HINTS
"${GLFW_LOCATION}/include"
"$ENV{GLFW_LOCATION}/include"
PATHS
"$ENV{PROGRAMFILES}/GLFW/include"
"${OPENGL_INCLUDE_DIR}"
/usr/openwin/share/include
/usr/openwin/include
/usr/X11R6/include
/usr/include/X11
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglfw
/usr/local/include
/usr/include/GL
/usr/include
DOC
"The directory where GL/glfw.h resides"
)
if (WIN32)
if(CYGWIN)
find_library( GLFW_glfw_LIBRARY
NAMES
glfw32
HINTS
"${GLFW_LOCATION}/lib"
"${GLFW_LOCATION}/lib/x64"
"$ENV{GLFW_LOCATION}/lib"
PATHS
"${OPENGL_LIBRARY_DIR}"
/usr/lib
/usr/lib/w32api
/usr/local/lib
/usr/X11R6/lib
DOC
"The GLFW library"
)
else()
find_library( GLFW_glfw_LIBRARY
NAMES
glfw32
glfw32s
glfw
glfw3
HINTS
"${GLFW_LOCATION}/lib"
"${GLFW_LOCATION}/lib/x64"
"${GLFW_LOCATION}/lib-msvc110"
"${GLFW_LOCATION}/lib-vc2012"
"$ENV{GLFW_LOCATION}/lib"
"$ENV{GLFW_LOCATION}/lib/x64"
"$ENV{GLFW_LOCATION}/lib-msvc110"
"$ENV{GLFW_LOCATION}/lib-vc2012"
PATHS
"$ENV{PROGRAMFILES}/GLFW/lib"
"${OPENGL_LIBRARY_DIR}"
DOC
"The GLFW library"
)
endif()
else ()
if (APPLE)
find_library( GLFW_glfw_LIBRARY glfw
NAMES
glfw
glfw3
HINTS
"${GLFW_LOCATION}/lib"
"${GLFW_LOCATION}/lib/cocoa"
"$ENV{GLFW_LOCATION}/lib"
"$ENV{GLFW_LOCATION}/lib/cocoa"
PATHS
/usr/local/lib
)
set(GLFW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
set(GLFW_corevideo_LIBRARY "-framework CoreVideo" CACHE STRING "CoreVideo framework for OSX")
set(GLFW_iokit_LIBRARY "-framework IOKit" CACHE STRING "IOKit framework for OSX")
else ()
# (*)NIX
find_package(Threads REQUIRED)
find_package(X11 REQUIRED)
if(NOT X11_Xrandr_FOUND)
message(FATAL_ERROR "Xrandr library not found - required for GLFW")
endif()
if(NOT X11_xf86vmode_FOUND)
message(FATAL_ERROR "xf86vmode library not found - required for GLFW")
endif()
if(NOT X11_Xcursor_FOUND)
message(FATAL_ERROR "Xcursor library not found - required for GLFW")
endif()
if(NOT X11_Xinerama_FOUND)
message(FATAL_ERROR "Xinerama library not found - required for GLFW")
endif()
if(NOT X11_Xi_FOUND)
message(FATAL_ERROR "Xi library not found - required for GLFW")
endif()
list(APPEND GLFW_x11_LIBRARY "${X11_Xrandr_LIB}" "${X11_Xxf86vm_LIB}" "${X11_Xcursor_LIB}" "${X11_Xinerama_LIB}" "${X11_Xi_LIB}" "${X11_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}" -lrt -ldl)
find_library( GLFW_glfw_LIBRARY
NAMES
glfw
glfw3
HINTS
"${GLFW_LOCATION}/lib"
"$ENV{GLFW_LOCATION}/lib"
"${GLFW_LOCATION}/lib/x11"
"$ENV{GLFW_LOCATION}/lib/x11"
PATHS
/usr/lib64
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/lib64
/usr/local/lib
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/openwin/lib
/usr/X11R6/lib
DOC
"The GLFW library"
)
endif (APPLE)
endif (WIN32)
set( GLFW_FOUND "NO" )
if(GLFW_INCLUDE_DIR)
if(GLFW_glfw_LIBRARY)
set( GLFW_LIBRARIES "${GLFW_glfw_LIBRARY}"
"${GLFW_x11_LIBRARY}"
"${GLFW_cocoa_LIBRARY}"
"${GLFW_iokit_LIBRARY}"
"${GLFW_corevideo_LIBRARY}" )
set( GLFW_FOUND "YES" )
set (GLFW_LIBRARY "${GLFW_LIBRARIES}")
set (GLFW_INCLUDE_PATH "${GLFW_INCLUDE_DIR}")
endif(GLFW_glfw_LIBRARY)
# Tease the GLFW_VERSION numbers from the lib headers
function(parseVersion FILENAME VARNAME)
set(PATTERN "^#define ${VARNAME}.*$")
file(STRINGS "${GLFW_INCLUDE_DIR}/${FILENAME}" TMP REGEX ${PATTERN})
string(REGEX MATCHALL "[0-9]+" TMP ${TMP})
set(${VARNAME} ${TMP} PARENT_SCOPE)
endfunction()
if(EXISTS "${GLFW_INCLUDE_DIR}/GL/glfw.h")
parseVersion(GL/glfw.h GLFW_VERSION_MAJOR)
parseVersion(GL/glfw.h GLFW_VERSION_MINOR)
parseVersion(GL/glfw.h GLFW_VERSION_REVISION)
elseif(EXISTS "${GLFW_INCLUDE_DIR}/GLFW/glfw3.h")
parseVersion(GLFW/glfw3.h GLFW_VERSION_MAJOR)
parseVersion(GLFW/glfw3.h GLFW_VERSION_MINOR)
parseVersion(GLFW/glfw3.h GLFW_VERSION_REVISION)
endif()
if("${GLFW_VERSION_MAJOR}" OR "${GLFW_VERSION_MINOR}" OR "${GLFW_VERSION_REVISION}")
set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}.${GLFW_VERSION_REVISION}")
set(GLFW_VERSION_STRING "${GLFW_VERSION}")
mark_as_advanced(GLFW_VERSION)
endif()
endif(GLFW_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLFW
REQUIRED_VARS
GLFW_INCLUDE_DIR
GLFW_LIBRARIES
VERSION_VAR
GLFW_VERSION
)
mark_as_advanced(
GLFW_INCLUDE_DIR
GLFW_LIBRARIES
GLFW_glfw_LIBRARY
GLFW_cocoa_LIBRARY
)
server-2.2.0-stable/src/CMakeModules/FindSFML.cmake 0000664 0000000 0000000 00000041344 13411752632 0021747 0 ustar 00root root 0000000 0000000 # This script locates the SFML library
# ------------------------------------
#
# Usage
# -----
#
# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
# example:
# find_package(SFML COMPONENTS graphics window system) # find the graphics, window and system modules
#
# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
# If nothing is specified, the version won't be checked (i.e. any version will be accepted).
# example:
# find_package(SFML COMPONENTS ...) # no specific version required
# find_package(SFML 2 COMPONENTS ...) # any 2.x version
# find_package(SFML 2.4 COMPONENTS ...) # version 2.4 or greater
#
# By default, the dynamic libraries of SFML will be found. To find the static ones instead,
# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
# Since you have to link yourself all the SFML dependencies when you link it statically, the following
# additional variables are defined: SFML_XXX_DEPENDENCIES and SFML_DEPENDENCIES (see their detailed
# description below).
# In case of static linking, the SFML_STATIC macro will also be defined by this script.
# example:
# set(SFML_STATIC_LIBRARIES TRUE)
# find_package(SFML 2 COMPONENTS network system)
#
# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
# are available for both release and debug modes.
#
# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
# to tell CMake where SFML is.
#
# Output
# ------
#
# This script defines the following variables:
# - For each specified module XXX (system, window, graphics, network, audio, main):
# - SFML_XXX_LIBRARY_DEBUG: the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
# - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
# - SFML_XXX_LIBRARY: the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found
# - SFML_XXX_DEPENDENCIES: the list of libraries the module depends on, in case of static linking
# - SFML_LIBRARIES: the list of all libraries corresponding to the required modules
# - SFML_FOUND: true if all the required modules are found
# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
# - SFML_DEPENDENCIES: the list of libraries SFML depends on, in case of static linking
#
# example:
# find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
# include_directories(${SFML_INCLUDE_DIR})
# add_executable(myapp ...)
# target_link_libraries(myapp ${SFML_LIBRARIES})
# define the SFML_STATIC macro if static build was chosen
if(SFML_STATIC_LIBRARIES)
add_definitions(-DSFML_STATIC)
endif()
# define the list of search paths for headers and libraries
set(FIND_SFML_PATHS
${SFML_ROOT}
$ENV{SFML_ROOT}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt)
# find the SFML include directory
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
PATH_SUFFIXES include
PATHS ${FIND_SFML_PATHS})
# check the version number
set(SFML_VERSION_OK TRUE)
if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
# extract the major and minor version numbers from SFML/Config.hpp
# we have to handle framework a little bit differently:
if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
else()
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
endif()
FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_PATCH ([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}")
if (NOT "${SFML_VERSION_PATCH}" MATCHES "^[0-9]+$")
set(SFML_VERSION_PATCH 0)
endif()
math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10000 + ${SFML_FIND_VERSION_MINOR} * 100 + ${SFML_FIND_VERSION_PATCH}")
# if we could extract them, compare with the requested version number
if (SFML_VERSION_MAJOR)
# transform version numbers to an integer
math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100 + ${SFML_VERSION_PATCH}")
# compare them
if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
set(SFML_VERSION_OK FALSE)
endif()
else()
# SFML version is < 2.0
if (SFML_REQUESTED_VERSION GREATER 10900)
set(SFML_VERSION_OK FALSE)
set(SFML_VERSION_MAJOR 1)
set(SFML_VERSION_MINOR x)
set(SFML_VERSION_PATCH x)
endif()
endif()
endif()
# find the requested modules
set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER})
# no suffix for sfml-main, it is always a static library
if(FIND_SFML_COMPONENT_LOWER STREQUAL "main")
# release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
else()
# static release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}-s
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# static debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-s-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# dynamic release library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE
NAMES ${FIND_SFML_COMPONENT_NAME}
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# dynamic debug library
find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG
NAMES ${FIND_SFML_COMPONENT_NAME}-d
PATH_SUFFIXES lib64 lib
PATHS ${FIND_SFML_PATHS})
# choose the entries that fit the requested link type
if(SFML_STATIC_LIBRARIES)
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE})
endif()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG})
endif()
else()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE})
endif()
if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG})
endif()
endif()
endif()
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
# library found
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
# if both are found, set SFML_XXX_LIBRARY to contain both
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
endif()
# if only one debug/release variant is found, set the other to be equal to the found one
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
# debug and not release
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
endif()
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
# release and not debug
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
endif()
else()
# library not found
set(SFML_FOUND FALSE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "")
set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY")
endif()
# mark as advanced
MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE
SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG)
# add to the global list of libraries
set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}")
endforeach()
# in case of static linking, we must also define the list of all the dependencies of SFML libraries
if(SFML_STATIC_LIBRARIES)
# detect the OS
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(FIND_SFML_OS_WINDOWS 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(FIND_SFML_OS_LINUX 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(FIND_SFML_OS_FREEBSD 1)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(FIND_SFML_OS_MACOSX 1)
endif()
# start with an empty list
set(SFML_DEPENDENCIES)
set(FIND_SFML_DEPENDENCIES_NOTFOUND)
# macro that searches for a 3rd-party library
macro(find_sfml_dependency output friendlyname)
# No lookup in environment variables (PATH on Windows), as they may contain wrong library versions
find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH)
if(${${output}} STREQUAL "${output}-NOTFOUND")
unset(output)
set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")
endif()
endmacro()
# sfml-system
list(FIND SFML_FIND_COMPONENTS "system" FIND_SFML_SYSTEM_COMPONENT)
if(NOT ${FIND_SFML_SYSTEM_COMPONENT} EQUAL -1)
# update the list -- these are only system libraries, no need to find them
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD OR FIND_SFML_OS_MACOSX)
set(SFML_SYSTEM_DEPENDENCIES "pthread")
endif()
if(FIND_SFML_OS_LINUX)
set(SFML_SYSTEM_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} "rt")
endif()
if(FIND_SFML_OS_WINDOWS)
set(SFML_SYSTEM_DEPENDENCIES "winmm")
endif()
set(SFML_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-network
list(FIND SFML_FIND_COMPONENTS "network" FIND_SFML_NETWORK_COMPONENT)
if(NOT ${FIND_SFML_NETWORK_COMPONENT} EQUAL -1)
# update the list -- these are only system libraries, no need to find them
if(FIND_SFML_OS_WINDOWS)
set(SFML_NETWORK_DEPENDENCIES "ws2_32")
endif()
set(SFML_DEPENDENCIES ${SFML_NETWORK_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-window
list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT)
if(NOT ${FIND_SFML_WINDOW_COMPONENT} EQUAL -1)
# find libraries
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
find_sfml_dependency(X11_LIBRARY "X11" X11)
find_sfml_dependency(XRANDR_LIBRARY "Xrandr" Xrandr)
endif()
if(FIND_SFML_OS_LINUX)
find_sfml_dependency(UDEV_LIBRARIES "UDev" udev libudev)
endif()
# update the list
if(FIND_SFML_OS_WINDOWS)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "opengl32" "winmm" "gdi32")
elseif(FIND_SFML_OS_LINUX)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${XRANDR_LIBRARY} ${UDEV_LIBRARIES})
elseif(FIND_SFML_OS_FREEBSD)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${XRANDR_LIBRARY} "usbhid")
elseif(FIND_SFML_OS_MACOSX)
set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "-framework OpenGL -framework Foundation -framework AppKit -framework IOKit -framework Carbon")
endif()
set(SFML_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-graphics
list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT)
if(NOT ${FIND_SFML_GRAPHICS_COMPONENT} EQUAL -1)
# find libraries
find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype)
find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg)
# update the list
set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${JPEG_LIBRARY})
set(SFML_DEPENDENCIES ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_DEPENDENCIES})
endif()
# sfml-audio
list(FIND SFML_FIND_COMPONENTS "audio" FIND_SFML_AUDIO_COMPONENT)
if(NOT ${FIND_SFML_AUDIO_COMPONENT} EQUAL -1)
# find libraries
find_sfml_dependency(OPENAL_LIBRARY "OpenAL" openal openal32)
find_sfml_dependency(OGG_LIBRARY "Ogg" ogg)
find_sfml_dependency(VORBIS_LIBRARY "Vorbis" vorbis)
find_sfml_dependency(VORBISFILE_LIBRARY "VorbisFile" vorbisfile)
find_sfml_dependency(VORBISENC_LIBRARY "VorbisEnc" vorbisenc)
find_sfml_dependency(FLAC_LIBRARY "FLAC" FLAC)
# update the list
set(SFML_AUDIO_DEPENDENCIES ${OPENAL_LIBRARY} ${FLAC_LIBRARY} ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_AUDIO_DEPENDENCIES})
endif()
endif()
# handle errors
if(NOT SFML_VERSION_OK)
# SFML version not ok
set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH})")
set(SFML_FOUND FALSE)
elseif(SFML_STATIC_LIBRARIES AND FIND_SFML_DEPENDENCIES_NOTFOUND)
set(FIND_SFML_ERROR "SFML found but some of its dependencies are missing (${FIND_SFML_DEPENDENCIES_NOTFOUND})")
set(SFML_FOUND FALSE)
elseif(NOT SFML_FOUND)
# include directory or library not found
set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})")
endif()
if (NOT SFML_FOUND)
if(SFML_FIND_REQUIRED)
# fatal error
message(FATAL_ERROR ${FIND_SFML_ERROR})
elseif(NOT SFML_FIND_QUIETLY)
# error but continue
message("${FIND_SFML_ERROR}")
endif()
endif()
# handle success
if(SFML_FOUND AND NOT SFML_FIND_QUIETLY)
MARK_AS_ADVANCED (SFML_INCLUDE_DIR)
message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH} in ${SFML_INCLUDE_DIR}")
endif()
server-2.2.0-stable/src/CMakeModules/FindSndFile.cmake 0000664 0000000 0000000 00000003223 13411752632 0022524 0 ustar 00root root 0000000 0000000 # Found on http://hg.kvats.net
#
# - Try to find libsndfile
#
# Once done this will define
#
# SNDFILE_FOUND - system has libsndfile
# SNDFILE_INCLUDE_DIRS - the libsndfile include directory
# SNDFILE_LIBRARIES - Link these to use libsndfile
#
# Copyright (C) 2006 Wengo
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)
# in cache already
set(SNDFILE_FOUND TRUE)
else (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)
find_path(SNDFILE_INCLUDE_DIR
NAMES
sndfile.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
find_library(SNDFILE_LIBRARY
NAMES
sndfile
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
set(SNDFILE_INCLUDE_DIRS
${SNDFILE_INCLUDE_DIR}
)
set(SNDFILE_LIBRARIES
${SNDFILE_LIBRARY}
)
if (SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
set(SNDFILE_FOUND TRUE)
endif (SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
if (SNDFILE_FOUND)
if (NOT SndFile_FIND_QUIETLY)
message(STATUS "Found libsndfile: ${SNDFILE_LIBRARIES}")
endif (NOT SndFile_FIND_QUIETLY)
else (SNDFILE_FOUND)
if (SndFile_FIND_REQUIRED)
message(FATAL_ERROR "Could not find libsndfile")
endif (SndFile_FIND_REQUIRED)
endif (SNDFILE_FOUND)
# show the SNDFILE_INCLUDE_DIRS and SNDFILE_LIBRARIES variables only in the advanced view
mark_as_advanced(SNDFILE_INCLUDE_DIRS SNDFILE_LIBRARIES SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY)
endif (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)
server-2.2.0-stable/src/CMakeModules/FindTBB.cmake 0000664 0000000 0000000 00000031057 13411752632 0021615 0 ustar 00root root 0000000 0000000 # - Find ThreadingBuildingBlocks include dirs and libraries
# Use this module by invoking find_package with the form:
# find_package(TBB
# [REQUIRED] # Fail with error if TBB is not found
# ) #
# Once done, this will define
#
# TBB_FOUND - system has TBB
# TBB_INCLUDE_DIRS - the TBB include directories
# TBB_LIBRARIES - TBB libraries to be lined, doesn't include malloc or
# malloc proxy
#
# TBB_VERSION_MAJOR - Major Product Version Number
# TBB_VERSION_MINOR - Minor Product Version Number
# TBB_INTERFACE_VERSION - Engineering Focused Version Number
# TBB_COMPATIBLE_INTERFACE_VERSION - The oldest major interface version
# still supported. This uses the engineering
# focused interface version numbers.
#
# TBB_MALLOC_FOUND - system has TBB malloc library
# TBB_MALLOC_INCLUDE_DIRS - the TBB malloc include directories
# TBB_MALLOC_LIBRARIES - The TBB malloc libraries to be lined
#
# TBB_MALLOC_PROXY_FOUND - system has TBB malloc proxy library
# TBB_MALLOC_PROXY_INCLUDE_DIRS = the TBB malloc proxy include directories
# TBB_MALLOC_PROXY_LIBRARIES - The TBB malloc proxy libraries to be lined
#
#
# This module reads hints about search locations from variables:
# ENV TBB_ARCH_PLATFORM - for eg. set it to "mic" for Xeon Phi builds
# ENV TBB_ROOT or just TBB_ROOT - root directory of tbb installation
# ENV TBB_BUILD_PREFIX - specifies the build prefix for user built tbb
# libraries. Should be specified with ENV TBB_ROOT
# and optionally...
# ENV TBB_BUILD_DIR - if build directory is different than ${TBB_ROOT}/build
#
#
# Modified by Robert Maynard from the original OGRE source
#
#-------------------------------------------------------------------
# This file is part of the CMake build system for OGRE
# (Object-oriented Graphics Rendering Engine)
# For the latest info, see http://www.ogre3d.org/
#
# The contents of this file are placed in the public domain. Feel
# free to make use of it in any way you like.
#-------------------------------------------------------------------
#
#=============================================================================
# Copyright 2010-2012 Kitware, Inc.
# Copyright 2012 Rolf Eike Beer
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#=============================================================================
# FindTBB helper functions and macros
#
#===============================================
# Do the final processing for the package find.
#===============================================
macro(findpkg_finish PREFIX)
# skip if already processed during this run
if (NOT ${PREFIX}_FOUND)
if (${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBRARY)
set(${PREFIX}_FOUND TRUE)
set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIR})
set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARY})
else ()
if (${PREFIX}_FIND_REQUIRED AND NOT ${PREFIX}_FIND_QUIETLY)
message(FATAL_ERROR "Required library ${PREFIX} not found.")
endif ()
endif ()
#mark the following variables as internal variables
mark_as_advanced(${PREFIX}_INCLUDE_DIR
${PREFIX}_LIBRARY
${PREFIX}_LIBRARY_DEBUG
${PREFIX}_LIBRARY_RELEASE)
endif ()
endmacro()
#===============================================
# Generate debug names from given release names
#===============================================
macro(get_debug_names PREFIX)
foreach(i ${${PREFIX}})
set(${PREFIX}_DEBUG ${${PREFIX}_DEBUG} ${i}d ${i}D ${i}_d ${i}_D ${i}_debug ${i})
endforeach()
endmacro()
#===============================================
# See if we have env vars to help us find tbb
#===============================================
macro(getenv_path VAR)
set(ENV_${VAR} $ENV{${VAR}})
# replace won't work if var is blank
if (ENV_${VAR})
string( REGEX REPLACE "\\\\" "/" ENV_${VAR} ${ENV_${VAR}} )
endif ()
endmacro()
#===============================================
# Couple a set of release AND debug libraries
#===============================================
macro(make_library_set PREFIX)
if (${PREFIX}_RELEASE AND ${PREFIX}_DEBUG)
set(${PREFIX} optimized ${${PREFIX}_RELEASE} debug ${${PREFIX}_DEBUG})
elseif (${PREFIX}_RELEASE)
set(${PREFIX} ${${PREFIX}_RELEASE})
elseif (${PREFIX}_DEBUG)
set(${PREFIX} ${${PREFIX}_DEBUG})
endif ()
endmacro()
#=============================================================================
# Now to actually find TBB
#
# Get path, convert backslashes as ${ENV_${var}}
getenv_path(TBB_ROOT)
# initialize search paths
set(TBB_PREFIX_PATH ${TBB_ROOT} ${ENV_TBB_ROOT})
set(TBB_INC_SEARCH_PATH "")
set(TBB_LIB_SEARCH_PATH "")
# If user built from sources
set(TBB_BUILD_PREFIX $ENV{TBB_BUILD_PREFIX})
if (TBB_BUILD_PREFIX AND ENV_TBB_ROOT)
getenv_path(TBB_BUILD_DIR)
if (NOT ENV_TBB_BUILD_DIR)
set(ENV_TBB_BUILD_DIR ${ENV_TBB_ROOT}/build)
endif ()
# include directory under ${ENV_TBB_ROOT}/include
list(APPEND TBB_LIB_SEARCH_PATH
${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_release
${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_debug)
endif ()
# For Windows, let's assume that the user might be using the precompiled
# TBB packages from the main website. These use a rather awkward directory
# structure (at least for automatically finding the right files) depending
# on platform and compiler, but we'll do our best to accommodate it.
# Not adding the same effort for the precompiled linux builds, though. Those
# have different versions for CC compiler versions and linux kernels which
# will never adequately match the user's setup, so there is no feasible way
# to detect the "best" version to use. The user will have to manually
# select the right files. (Chances are the distributions are shipping their
# custom version of tbb, anyway, so the problem is probably nonexistent.)
if (WIN32 AND MSVC)
set(COMPILER_PREFIX "vc7.1")
if (MSVC_VERSION EQUAL 1400)
set(COMPILER_PREFIX "vc8")
elseif(MSVC_VERSION EQUAL 1500)
set(COMPILER_PREFIX "vc9")
elseif(MSVC_VERSION EQUAL 1600)
set(COMPILER_PREFIX "vc10")
elseif(MSVC_VERSION EQUAL 1700)
set(COMPILER_PREFIX "vc11")
elseif(MSVC_VERSION EQUAL 1800)
set(COMPILER_PREFIX "vc12")
elseif(MSVC_VERSION EQUAL 1900)
set(COMPILER_PREFIX "vc14")
endif ()
# for each prefix path, add ia32/64\${COMPILER_PREFIX}\lib to the lib search path
foreach (dir IN LISTS TBB_PREFIX_PATH)
if (CMAKE_CL_64)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia64/${COMPILER_PREFIX}/lib)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia64/${COMPILER_PREFIX})
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${COMPILER_PREFIX}/lib)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${COMPILER_PREFIX})
else ()
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${COMPILER_PREFIX}/lib)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${COMPILER_PREFIX})
endif ()
endforeach ()
endif ()
# For OS X binary distribution, choose libc++ based libraries for Mavericks (10.9)
# and above and AppleClang
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND
NOT CMAKE_SYSTEM_VERSION VERSION_LESS 13.0)
set (USE_LIBCXX OFF)
cmake_policy(GET CMP0025 POLICY_VAR)
if (POLICY_VAR STREQUAL "NEW")
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set (USE_LIBCXX ON)
endif ()
else ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (USE_LIBCXX ON)
endif ()
endif ()
if (USE_LIBCXX)
foreach (dir IN LISTS TBB_PREFIX_PATH)
list (APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/libc++ ${dir}/libc++/lib)
endforeach ()
endif ()
endif ()
# check compiler ABI
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(COMPILER_PREFIX)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
list(APPEND COMPILER_PREFIX "gcc4.7")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
list(APPEND COMPILER_PREFIX "gcc4.4")
endif()
list(APPEND COMPILER_PREFIX "gcc4.1")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(COMPILER_PREFIX)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6)
list(APPEND COMPILER_PREFIX "gcc4.7")
endif()
list(APPEND COMPILER_PREFIX "gcc4.4")
else() # Assume compatibility with 4.4 for other compilers
list(APPEND COMPILER_PREFIX "gcc4.4")
endif ()
# if platform architecture is explicitly specified
set(TBB_ARCH_PLATFORM $ENV{TBB_ARCH_PLATFORM})
if (TBB_ARCH_PLATFORM)
foreach (dir IN LISTS TBB_PREFIX_PATH)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/${TBB_ARCH_PLATFORM}/lib)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/${TBB_ARCH_PLATFORM})
endforeach ()
endif ()
foreach (dir IN LISTS TBB_PREFIX_PATH)
foreach (prefix IN LISTS COMPILER_PREFIX)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${prefix})
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/lib)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${prefix}/lib)
else ()
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${prefix})
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/lib)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${prefix}/lib)
endif ()
endforeach()
endforeach ()
# add general search paths
foreach (dir IN LISTS TBB_PREFIX_PATH)
list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib ${dir}/Lib ${dir}/lib/tbb
${dir}/Libs)
list(APPEND TBB_INC_SEARCH_PATH ${dir}/include ${dir}/Include
${dir}/include/tbb)
endforeach ()
set(TBB_LIBRARY_NAMES tbb)
get_debug_names(TBB_LIBRARY_NAMES)
find_path(TBB_INCLUDE_DIR
NAMES tbb/tbb.h
PATHS ${TBB_INC_SEARCH_PATH})
find_library(TBB_LIBRARY_RELEASE
NAMES ${TBB_LIBRARY_NAMES}
PATHS ${TBB_LIB_SEARCH_PATH})
find_library(TBB_LIBRARY_DEBUG
NAMES ${TBB_LIBRARY_NAMES_DEBUG}
PATHS ${TBB_LIB_SEARCH_PATH})
make_library_set(TBB_LIBRARY)
findpkg_finish(TBB)
#if we haven't found TBB no point on going any further
if (NOT TBB_FOUND)
return()
endif ()
#=============================================================================
# Look for TBB's malloc package
set(TBB_MALLOC_LIBRARY_NAMES tbbmalloc)
get_debug_names(TBB_MALLOC_LIBRARY_NAMES)
find_path(TBB_MALLOC_INCLUDE_DIR
NAMES tbb/tbb.h
PATHS ${TBB_INC_SEARCH_PATH})
find_library(TBB_MALLOC_LIBRARY_RELEASE
NAMES ${TBB_MALLOC_LIBRARY_NAMES}
PATHS ${TBB_LIB_SEARCH_PATH})
find_library(TBB_MALLOC_LIBRARY_DEBUG
NAMES ${TBB_MALLOC_LIBRARY_NAMES_DEBUG}
PATHS ${TBB_LIB_SEARCH_PATH})
make_library_set(TBB_MALLOC_LIBRARY)
findpkg_finish(TBB_MALLOC)
#=============================================================================
# Look for TBB's malloc proxy package
set(TBB_MALLOC_PROXY_LIBRARY_NAMES tbbmalloc_proxy)
get_debug_names(TBB_MALLOC_PROXY_LIBRARY_NAMES)
find_path(TBB_MALLOC_PROXY_INCLUDE_DIR
NAMES tbb/tbbmalloc_proxy.h
PATHS ${TBB_INC_SEARCH_PATH})
find_library(TBB_MALLOC_PROXY_LIBRARY_RELEASE
NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES}
PATHS ${TBB_LIB_SEARCH_PATH})
find_library(TBB_MALLOC_PROXY_LIBRARY_DEBUG
NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES_DEBUG}
PATHS ${TBB_LIB_SEARCH_PATH})
make_library_set(TBB_MALLOC_PROXY_LIBRARY)
findpkg_finish(TBB_MALLOC_PROXY)
#=============================================================================
#parse all the version numbers from tbb
if(NOT TBB_VERSION)
#only read the start of the file
file(READ
"${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h"
TBB_VERSION_CONTENTS
LIMIT 2048)
string(REGEX REPLACE
".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
TBB_VERSION_MAJOR "${TBB_VERSION_CONTENTS}")
string(REGEX REPLACE
".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1"
TBB_VERSION_MINOR "${TBB_VERSION_CONTENTS}")
string(REGEX REPLACE
".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1"
TBB_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}")
string(REGEX REPLACE
".*#define TBB_COMPATIBLE_INTERFACE_VERSION ([0-9]+).*" "\\1"
TBB_COMPATIBLE_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}")
endif()
server-2.2.0-stable/src/CMakeModules/PlatformIntrospection.cmake 0000664 0000000 0000000 00000014747 13411752632 0024761 0 ustar 00root root 0000000 0000000 include(ProcessorCount)
# Returns a simple string describing the current architecture. Possible
# return values currently include: amd64, x86_64, x86.
MACRO (_DETERMINE_ARCH var)
IF (DEFINED CB_DOWNLOAD_DEPS_ARCH)
SET (_arch ${CB_DOWNLOAD_DEPS_ARCH})
ELSEIF (DEFINED ENV{target_arch})
# target_arch is used by environment.bat to represent the desired
# target architecture, so use that value first if set.
STRING (TOLOWER "$ENV{target_arch}" _arch)
ELSE (DEFINED CB_DOWNLOAD_DEPS_ARCH)
# We tweak MacOS, which for some reason claims to be i386
IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# QQQ MacOS 10.7 could be 32-bit; we should catch and abort
SET (_arch x86_64)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
EXECUTE_PROCESS (COMMAND isainfo -k
COMMAND tr -d '\n'
OUTPUT_VARIABLE _arch)
ELSEIF (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
# If user didn't specify the arch via target_arch or
# CB_DOWNLOAD_DEPS_ARCH, assume that the target is the same as
# the current host architecture and derive that from
# Windows-provided environment variables.
IF (DEFINED ENV{PROCESSOR_ARCHITEW6432})
STRING (TOLOWER "$ENV{PROCESSOR_ARCHITEW6432}" _arch)
ELSE ()
STRING (TOLOWER "$ENV{PROCESSOR_ARCHITECTURE}" _arch)
ENDIF ()
ELSE (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
STRING (TOLOWER ${CMAKE_SYSTEM_PROCESSOR} _arch)
ENDIF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET (CB_DOWNLOAD_DEPS_ARCH ${_arch} CACHE STRING
"Architecture for downloaded dependencies")
MARK_AS_ADVANCED (CB_DOWNLOAD_DEPS_ARCH)
ENDIF (DEFINED CB_DOWNLOAD_DEPS_ARCH)
SET (${var} ${_arch})
ENDMACRO (_DETERMINE_ARCH)
# Returns a lowercased version of a given lsb_release field.
MACRO (_LSB_RELEASE field retval)
EXECUTE_PROCESS (COMMAND lsb_release "--${field}"
OUTPUT_VARIABLE _output ERROR_VARIABLE _output RESULT_VARIABLE _result)
IF (_result)
MESSAGE (FATAL_ERROR "Cannot determine Linux revision! Output from "
"lsb_release --${field}: ${_output}")
ENDIF (_result)
STRING (REGEX REPLACE "^[^:]*:" "" _output "${_output}")
STRING (TOLOWER "${_output}" _output)
STRING (STRIP "${_output}" ${retval})
ENDMACRO (_LSB_RELEASE)
# Returns a simple string describing the current platform. Possible
# return values currently include: windows_msvc2015; windows_msvc (implies
# MSVC 2013); macosx; or any value from _DETERMINE_LINUX_DISTRO.
MACRO (_DETERMINE_PLATFORM var)
IF (DEFINED CB_DOWNLOAD_DEPS_PLATFORM)
SET (_plat ${CB_DOWNLOAD_DEPS_PLATFORM})
ELSE (DEFINED CB_DOWNLOAD_DEPS_PLATFORM)
SET (_plat ${CMAKE_SYSTEM_NAME})
IF (_plat STREQUAL "Windows")
if (${MSVC_VERSION} LESS 1900)
SET (_plat "windows_msvc")
elseif (${MSVC_VERSION} LESS 1910)
SET (_plat "windows_msvc2015")
elseif (${MSVC_VERSION} EQUAL 1910)
SET (_plat "windows_msvc2017")
ELSE()
MESSAGE(FATAL_ERROR "Unsupported MSVC version: ${MSVC_VERSION}")
ENDIF ()
ELSEIF (_plat STREQUAL "Darwin")
SET (_plat "macosx")
ELSEIF (_plat STREQUAL "Linux")
FIND_PROGRAM(LSB_RELEASE lsb_release)
MARK_AS_ADVANCED(LSB_RELEASE)
IF (LSB_RELEASE)
_DETERMINE_LINUX_DISTRO (_plat)
ELSE (LSB_RELEASE)
MESSAGE (WARNING "Can't determine Linux platform without lsb_release")
SET (_plat "unknown")
ENDIF (LSB_RELEASE)
ELSEIF (_plat STREQUAL "SunOS")
SET (_plat "sunos")
ELSEIF (_plat STREQUAL "FreeBSD")
SET (_plat "freebsd")
ELSE (_plat STREQUAL "Windows")
MESSAGE (WARNING "Sorry, don't recognize your system ${_plat}. ")
SET (_plat "unknown")
ENDIF (_plat STREQUAL "Windows")
SET (CB_DOWNLOAD_DEPS_PLATFORM ${_plat} CACHE STRING
"Platform for downloaded dependencies")
MARK_AS_ADVANCED (CB_DOWNLOAD_DEPS_PLATFORM)
ENDIF (DEFINED CB_DOWNLOAD_DEPS_PLATFORM)
SET (${var} ${_plat})
ENDMACRO (_DETERMINE_PLATFORM)
# Returns a simple string describing the current Linux distribution
# compatibility. Possible return values currently include:
# ubuntu14.04, ubuntu12.04, ubuntu10.04, centos5, centos6, debian7, debian8.
MACRO (_DETERMINE_LINUX_DISTRO _distro)
_LSB_RELEASE (id _id)
_LSB_RELEASE (release _rel)
IF (_id STREQUAL "linuxmint")
# Linux Mint is an Ubuntu derivative; estimate nearest Ubuntu equivalent
SET (_id "ubuntu")
IF (_rel VERSION_LESS 13)
SET (_rel 10.04)
ELSEIF (_rel VERSION_LESS 17)
SET (_rel 12.04)
ELSEIF (_rel VERSION_LESS 18)
SET (_rel 14.04)
ELSE ()
SET (_rel 16.04)
ENDIF ()
ELSEIF (_id STREQUAL "debian" OR _id STREQUAL "centos" )
# Just use the major version from the CentOS/Debian identifier - we don't
# need different builds for different minor versions.
STRING (REGEX MATCH "[0-9]+" _rel "${_rel}")
ELSEIF (_id STREQUAL "fedora" AND _rel VERSION_LESS 26)
SET (_id "centos")
SET (_rel "7")
ELSEIF (_id STREQUAL "opensuse project" OR _id STREQUAL "suse linux")
SET(_id "suse")
ENDIF (_id STREQUAL "linuxmint")
SET (${_distro} "${_id}${_rel}")
ENDMACRO (_DETERMINE_LINUX_DISTRO)
# Returns number of CPUs the system has. The value can be overwritten by the
# CB_CPU_COUNT environment variable. If neither of these work, return some
# (hopefully) reasonable default.
MACRO (_DETERMINE_CPU_COUNT _var)
SET(_count 0)
IF (DEFINED $ENV{CB_CPU_COUNT})
SET(_count $ENV{CB_CPU_COUNT})
ENDIF (DEFINED $ENV{CB_CPU_COUNT})
IF (_count EQUAL 0)
ProcessorCount(_count)
ENDIF (_count EQUAL 0)
IF (_count EQUAL 0)
MESSAGE(WARNING "Couldn't determine number of CPUs to use. Using default.")
SET(_count 4)
ENDIF (_count EQUAL 0)
SET(${_var} ${_count})
ENDMACRO (_DETERMINE_CPU_COUNT)
# Sets _platform to the name of the current platform if it is a supported
# platform, or a False value otherwise.
# "Supported" means that we produce and distribute builds to
# customers on that platform.
# QQQ This list should come from manifest/product-config.json ultimately.
# _platform is in the same format as _DETERMINE_PLATFORM().
MACRO (TEST_FOR_SUPPORTED_PLATFORM _supported_platform)
SET (${_supported_platform} 0)
# First get the current platform
_DETERMINE_PLATFORM(_platform)
# .. and check it against the list, returning it if found.
SET (_supported_platforms
"ubuntu14.04" "ubuntu16.04"
"windows_msvc2015")
LIST (FIND _supported_platforms ${_platform} _index)
IF (_index GREATER "-1")
SET(${_supported_platform} ${_platform})
ENDIF (_index GREATER "-1")
ENDMACRO (TEST_FOR_SUPPORTED_PLATFORM)
server-2.2.0-stable/src/CMakeModules/PrecompiledHeader.cmake 0000664 0000000 0000000 00000020676 13411752632 0023766 0 ustar 00root root 0000000 0000000 # Function for setting up precompiled headers. Usage:
#
# add_library/executable(target
# pchheader.c pchheader.cpp pchheader.h)
#
# add_precompiled_header(target pchheader.h
# [FORCEINCLUDE]
# [SOURCE_C pchheader.c]
# [SOURCE_CXX pchheader.cpp])
#
# Options:
#
# FORCEINCLUDE: Add compiler flags to automatically include the
# pchheader.h from every source file. Works with both GCC and
# MSVC. This is recommended.
#
# SOURCE_C/CXX: Specifies the .c/.cpp source file that includes
# pchheader.h for generating the pre-compiled header
# output. Defaults to pchheader.c. Only required for MSVC.
#
# Caveats:
#
# * Its not currently possible to use the same precompiled-header in
# more than a single target in the same directory (No way to set
# the source file properties differently for each target).
#
# * MSVC: A source file with the same name as the header must exist
# and be included in the target (E.g. header.cpp). Name of file
# can be changed using the SOURCE_CXX/SOURCE_C options.
#
# License:
#
# Copyright (C) 2009-2013 Lars Christensen
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the 'Software') 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.
include(CMakeParseArguments)
macro(combine_arguments _variable)
set(_result "")
foreach(_element ${${_variable}})
set(_result "${_result} \"${_element}\"")
endforeach()
string(STRIP "${_result}" _result)
set(${_variable} "${_result}")
endmacro()
function(export_all_flags _filename)
set(_include_directories "$")
set(_compile_definitions "$")
set(_compile_flags "$")
set(_compile_options "$")
set(_include_directories "$<$:-I$\n>")
set(_compile_definitions "$<$:-D$\n>")
set(_compile_flags "$<$:$\n>")
set(_compile_options "$<$:$\n>")
file(GENERATE OUTPUT "${_filename}" CONTENT "${_compile_definitions}${_include_directories}${_compile_flags}${_compile_options}\n")
endfunction()
function(add_precompiled_header _target _input)
cmake_parse_arguments(_PCH "FORCEINCLUDE" "SOURCE_CXX:SOURCE_C" "" ${ARGN})
get_filename_component(_input_we ${_input} NAME_WE)
if(NOT _PCH_SOURCE_CXX)
set(_PCH_SOURCE_CXX "${_input_we}.cpp")
endif()
if(NOT _PCH_SOURCE_C)
set(_PCH_SOURCE_C "${_input_we}.c")
endif()
if(MSVC)
set(_cxx_path "${CMAKE_CFG_INTDIR}/${_target}_cxx_pch")
set(_c_path "${CMAKE_CFG_INTDIR}/${_target}_c_pch")
make_directory("${_cxx_path}")
make_directory("${_c_path}")
set(_pch_cxx_header "${_cxx_path}/${_input}")
set(_pch_cxx_pch "${_cxx_path}/${_input_we}.pch")
set(_pch_c_header "${_c_path}/${_input}")
set(_pch_c_pch "${_c_path}/${_input_we}.pch")
get_target_property(sources ${_target} SOURCES)
foreach(_source ${sources})
set(_pch_compile_flags "")
if(_source MATCHES \\.\(cc|cxx|cpp|c\)$)
if(_source MATCHES \\.\(cpp|cxx|cc\)$)
set(_pch_header "${_input}")
set(_pch "${_pch_cxx_pch}")
else()
set(_pch_header "${_input}")
set(_pch "${_pch_c_pch}")
endif()
if(_source STREQUAL "${_PCH_SOURCE_CXX}")
set(_pch_compile_flags "${_pch_compile_flags} \"/Fp${_pch_cxx_pch}\" /Yc${_input}")
set(_pch_source_cxx_found TRUE)
elseif(_source STREQUAL "${_PCH_SOURCE_C}")
set(_pch_compile_flags "${_pch_compile_flags} \"/Fp${_pch_c_pch}\" /Yc${_input}")
set(_pch_source_c_found TRUE)
else()
if(_source MATCHES \\.\(cpp|cxx|cc\)$)
set(_pch_compile_flags "${_pch_compile_flags} \"/Fp${_pch_cxx_pch}\" /Yu${_input}")
set(_pch_source_cxx_needed TRUE)
else()
set(_pch_compile_flags "${_pch_compile_flags} \"/Fp${_pch_c_pch}\" /Yu${_input}")
set(_pch_source_c_needed TRUE)
endif()
if(_PCH_FORCEINCLUDE)
set(_pch_compile_flags "${_pch_compile_flags} /FI${_input}")
endif(_PCH_FORCEINCLUDE)
endif()
get_source_file_property(_object_depends "${_source}" OBJECT_DEPENDS)
if(NOT _object_depends)
set(_object_depends)
endif()
if(_PCH_FORCEINCLUDE)
if(_source MATCHES \\.\(cc|cxx|cpp\)$)
list(APPEND _object_depends "${_pch_header}")
else()
list(APPEND _object_depends "${_pch_header}")
endif()
endif()
set_source_files_properties(${_source} PROPERTIES
COMPILE_FLAGS "${_pch_compile_flags}"
OBJECT_DEPENDS "${_object_depends}")
endif()
endforeach()
if(_pch_source_cxx_needed AND NOT _pch_source_cxx_found)
message(FATAL_ERROR "A source file ${_PCH_SOURCE_CXX} for ${_input} is required for MSVC builds. Can be set with the SOURCE_CXX option.")
endif()
if(_pch_source_c_needed AND NOT _pch_source_c_found)
message(FATAL_ERROR "A source file ${_PCH_SOURCE_C} for ${_input} is required for MSVC builds. Can be set with the SOURCE_C option.")
endif()
endif(MSVC)
if(CMAKE_COMPILER_IS_GNUCXX)
get_filename_component(_name ${_input} NAME)
set(_pch_header "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
set(_pch_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/${_target}_pch")
set(_pchfile "${_pch_binary_dir}/${_input}")
set(_outdir "${CMAKE_CURRENT_BINARY_DIR}/${_target}_pch/${_name}.gch")
make_directory(${_outdir})
set(_output_cxx "${_outdir}/.c++")
set(_output_c "${_outdir}/.c")
set(_pch_flags_file "${_pch_binary_dir}/compile_flags.rsp")
export_all_flags("${_pch_flags_file}")
set(_compiler_FLAGS "@${_pch_flags_file}")
add_custom_command(
OUTPUT "${_pchfile}"
COMMAND "${CMAKE_COMMAND}" -E copy "${_pch_header}" "${_pchfile}"
DEPENDS "${_pch_header}"
COMMENT "Updating ${_name}")
add_custom_command(
OUTPUT "${_output_cxx}"
COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" "${_pchfile}"
DEPENDS "${_pchfile}" "${_pch_flags_file}"
COMMENT "Precompiling ${_name} for ${_target} (C++)")
add_custom_command(
OUTPUT "${_output_c}"
COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" "${_pchfile}"
DEPENDS "${_pchfile}" "${_pch_flags_file}"
COMMENT "Precompiling ${_name} for ${_target} (C)")
get_property(_sources TARGET ${_target} PROPERTY SOURCES)
foreach(_source ${_sources})
set(_pch_compile_flags "")
if(_source MATCHES \\.\(cc|cxx|cpp|c\)$)
get_source_file_property(_pch_compile_flags "${_source}" COMPILE_FLAGS)
if(NOT _pch_compile_flags)
set(_pch_compile_flags)
endif()
separate_arguments(_pch_compile_flags)
list(APPEND _pch_compile_flags -Winvalid-pch)
if(_PCH_FORCEINCLUDE)
list(APPEND _pch_compile_flags -include "${_pchfile}")
else(_PCH_FORCEINCLUDE)
list(APPEND _pch_compile_flags "-I${_pch_binary_dir}")
endif(_PCH_FORCEINCLUDE)
get_source_file_property(_object_depends "${_source}" OBJECT_DEPENDS)
if(NOT _object_depends)
set(_object_depends)
endif()
list(APPEND _object_depends "${_pchfile}")
if(_source MATCHES \\.\(cc|cxx|cpp\)$)
list(APPEND _object_depends "${_output_cxx}")
else()
list(APPEND _object_depends "${_output_c}")
endif()
combine_arguments(_pch_compile_flags)
message("${_source}" ${_pch_compile_flags})
set_source_files_properties(${_source} PROPERTIES
COMPILE_FLAGS "${_pch_compile_flags}"
OBJECT_DEPENDS "${_object_depends}")
endif()
endforeach()
endif(CMAKE_COMPILER_IS_GNUCXX)
endfunction()
server-2.2.0-stable/src/accelerator/ 0000775 0000000 0000000 00000000000 13411752632 0017350 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/src/accelerator/CMakeLists.txt 0000664 0000000 0000000 00000002174 13411752632 0022114 0 ustar 00root root 0000000 0000000 cmake_minimum_required (VERSION 2.6)
project (accelerator)
set(SOURCES
ogl/image/image_kernel.cpp
ogl/image/image_mixer.cpp
ogl/image/image_shader.cpp
ogl/util/buffer.cpp
ogl/util/device.cpp
ogl/util/shader.cpp
ogl/util/texture.cpp
accelerator.cpp
StdAfx.cpp
)
set(HEADERS
ogl/image/blending_glsl.h
ogl/image/image_kernel.h
ogl/image/image_mixer.h
ogl/image/image_shader.h
ogl/util/buffer.h
ogl/util/device.h
ogl/util/shader.h
ogl/util/texture.h
accelerator.h
StdAfx.h
)
add_library(accelerator ${SOURCES} ${HEADERS} ${OS_SPECIFIC_SOURCES})
add_precompiled_header(accelerator StdAfx.h FORCEINCLUDE)
include_directories(..)
include_directories(${BOOST_INCLUDE_PATH})
include_directories(${TBB_INCLUDE_PATH})
include_directories(${GLEW_INCLUDE_PATH})
include_directories(${FFMPEG_INCLUDE_PATH})
include_directories(${SFML_INCLUDE_PATH})
source_group(sources ./.*)
source_group(sources\\cpu\\image cpu/image/.*)
source_group(sources\\cpu\\util cpu/util/.*)
source_group(sources\\ogl\\image ogl/image/.*)
source_group(sources\\ogl\\util ogl/util/.*)
target_link_libraries(accelerator common core ffmpeg)
server-2.2.0-stable/src/accelerator/StdAfx.cpp 0000664 0000000 0000000 00000001476 13411752632 0021255 0 ustar 00root root 0000000 0000000 /*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#include "StdAfx.h"
server-2.2.0-stable/src/accelerator/StdAfx.h 0000664 0000000 0000000 00000002634 13411752632 0020717 0 ustar 00root root 0000000 0000000 #pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
server-2.2.0-stable/src/accelerator/accelerator.cpp 0000664 0000000 0000000 00000002055 13411752632 0022342 0 ustar 00root root 0000000 0000000 #include "accelerator.h"
#include "ogl/image/image_mixer.h"
#include "ogl/util/device.h"
#include
#include
#include
#include
namespace caspar { namespace accelerator {
struct accelerator::impl
{
const std::wstring path_;
std::mutex mutex_;
std::shared_ptr ogl_device_;
impl(const std::wstring& path)
: path_(path)
{
}
std::unique_ptr create_image_mixer(int channel_id)
{
if (!ogl_device_) {
ogl_device_.reset(new ogl::device());
}
return std::make_unique(spl::make_shared_ptr(ogl_device_), channel_id);
}
};
accelerator::accelerator(const std::wstring& path)
: impl_(std::make_unique(path))
{
}
accelerator::~accelerator() {}
std::unique_ptr accelerator::create_image_mixer(int channel_id)
{
return impl_->create_image_mixer(channel_id);
}
}} // namespace caspar::accelerator
server-2.2.0-stable/src/accelerator/accelerator.h 0000664 0000000 0000000 00000000711 13411752632 0022004 0 ustar 00root root 0000000 0000000 #pragma once
#include
#include
namespace caspar { namespace accelerator {
class accelerator
{
public:
accelerator(const std::wstring& path);
accelerator(accelerator&) = delete;
~accelerator();
accelerator& operator=(accelerator&) = delete;
std::unique_ptr create_image_mixer(int channel_id);
private:
struct impl;
std::unique_ptr impl_;
};
}} // namespace caspar::accelerator server-2.2.0-stable/src/accelerator/ogl/ 0000775 0000000 0000000 00000000000 13411752632 0020131 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/src/accelerator/ogl/image/ 0000775 0000000 0000000 00000000000 13411752632 0021213 5 ustar 00root root 0000000 0000000 server-2.2.0-stable/src/accelerator/ogl/image/blending_glsl.h 0000664 0000000 0000000 00000030160 13411752632 0024167 0 ustar 00root root 0000000 0000000 /*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#pragma once
static std::string get_adjustement_glsl()
{
return R"shader(
/*
** Contrast, saturation, brightness
** Code of this function is from TGM's shader pack
** http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=21057
*/
vec3 ContrastSaturationBrightness(vec4 color, float brt, float sat, float con)
{
const float AvgLumR = 0.5;
const float AvgLumG = 0.5;
const float AvgLumB = 0.5;
vec3 LumCoeff = is_hd
? vec3(0.0722, 0.7152, 0.2126)
: vec3(0.114, 0.587, 0.299);
if (color.a > 0.0)
color.rgb /= color.a;
vec3 AvgLumin = vec3(AvgLumR, AvgLumG, AvgLumB);
vec3 brtColor = color.rgb * brt;
vec3 intensity = vec3(dot(brtColor, LumCoeff));
vec3 satColor = mix(intensity, brtColor, sat);
vec3 conColor = mix(AvgLumin, satColor, con);
conColor.rgb *= color.a;
return conColor;
}
/*
** Gamma correction
** Details: http://blog.mouaif.org/2009/01/22/photoshop-gamma-correction-shader/
*/
#define GammaCorrection(color, gamma) pow(color, vec3(1.0 / gamma))
/*
** Levels control (input (+gamma), output)
** Details: http://blog.mouaif.org/2009/01/28/levels-control-shader/
*/
#define LevelsControlInputRange(color, minInput, maxInput) min(max(color - vec3(minInput), vec3(0.0)) / (vec3(maxInput) - vec3(minInput)), vec3(1.0))
#define LevelsControlInput(color, minInput, gamma, maxInput) GammaCorrection(LevelsControlInputRange(color, minInput, maxInput), gamma)
#define LevelsControlOutputRange(color, minOutput, maxOutput) mix(vec3(minOutput), vec3(maxOutput), color)
#define LevelsControl(color, minInput, gamma, maxInput, minOutput, maxOutput) LevelsControlOutputRange(LevelsControlInput(color, minInput, gamma, maxInput), minOutput, maxOutput)
)shader";
}
static std::string get_blend_glsl()
{
static std::string glsl = R"shader(
/*
** Photoshop & misc math
** Blending modes, RGB/HSL/Contrast/Desaturate, levels control
**
** Romain Dura | Romz
** Blog: http://blog.mouaif.org
** Post: http://blog.mouaif.org/?p=94
*/
/*
** Desaturation
*/
vec4 Desaturate(vec3 color, float Desaturation)
{
vec3 grayXfer = vec3(0.3, 0.59, 0.11);
vec3 gray = vec3(dot(grayXfer, color));
return vec4(mix(color, gray, Desaturation), 1.0);
}
/*
** Hue, saturation, luminance
*/
vec3 RGBToHSL(vec3 color)
{
vec3 hsl;
float fmin = min(min(color.r, color.g), color.b);
float fmax = max(max(color.r, color.g), color.b);
float delta = fmax - fmin;
hsl.z = (fmax + fmin) / 2.0;
if (delta == 0.0)
{
hsl.x = 0.0;
hsl.y = 0.0;
}
else
{
if (hsl.z < 0.5)
hsl.y = delta / (fmax + fmin);
else
hsl.y = delta / (2.0 - fmax - fmin);
float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;
float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;
float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;
if (color.r == fmax )
hsl.x = deltaB - deltaG;
else if (color.g == fmax)
hsl.x = (1.0 / 3.0) + deltaR - deltaB;
else if (color.b == fmax)
hsl.x = (2.0 / 3.0) + deltaG - deltaR;
if (hsl.x < 0.0)
hsl.x += 1.0;
else if (hsl.x > 1.0)
hsl.x -= 1.0;
}
return hsl;
}
float HueToRGB(float f1, float f2, float hue)
{
if (hue < 0.0)
hue += 1.0;
else if (hue > 1.0)
hue -= 1.0;
float res;
if ((6.0 * hue) < 1.0)
res = f1 + (f2 - f1) * 6.0 * hue;
else if ((2.0 * hue) < 1.0)
res = f2;
else if ((3.0 * hue) < 2.0)
res = f1 + (f2 - f1) * ((2.0 / 3.0) - hue) * 6.0;
else
res = f1;
return res;
}
vec3 HSLToRGB(vec3 hsl)
{
vec3 rgb;
if (hsl.y == 0.0)
rgb = vec3(hsl.z);
else
{
float f2;
if (hsl.z < 0.5)
f2 = hsl.z * (1.0 + hsl.y);
else
f2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);
float f1 = 2.0 * hsl.z - f2;
rgb.r = HueToRGB(f1, f2, hsl.x + (1.0/3.0));
rgb.g = HueToRGB(f1, f2, hsl.x);
rgb.b= HueToRGB(f1, f2, hsl.x - (1.0/3.0));
}
return rgb;
}
/*
** Float blending modes
** Adapted from here: http://www.nathanm.com/photoshop-blending-math/
** But I modified the HardMix (wrong condition), Overlay, SoftLight, ColorDodge, ColorBurn, VividLight, PinLight (inverted layers) ones to have correct results
*/
#define BlendLinearDodgef BlendAddf
#define BlendLinearBurnf BlendSubstractf
#define BlendAddf(base, blend) min(base + blend, 1.0)
#define BlendSubstractf(base, blend) max(base + blend - 1.0, 0.0)
#define BlendLightenf(base, blend) max(blend, base)
#define BlendDarkenf(base, blend) min(blend, base)
#define BlendLinearLightf(base, blend) (blend < 0.5 ? BlendLinearBurnf(base, (2.0 * blend)) : BlendLinearDodgef(base, (2.0 * (blend - 0.5))))
#define BlendScreenf(base, blend) (1.0 - ((1.0 - base) * (1.0 - blend)))
#define BlendOverlayf(base, blend) (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))
#define BlendSoftLightf(base, blend) ((blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend)))
#define BlendColorDodgef(base, blend) ((blend == 1.0) ? blend : min(base / (1.0 - blend), 1.0))
#define BlendColorBurnf(base, blend) ((blend == 0.0) ? blend : max((1.0 - ((1.0 - base) / blend)), 0.0))
#define BlendVividLightf(base, blend) ((blend < 0.5) ? BlendColorBurnf(base, (2.0 * blend)) : BlendColorDodgef(base, (2.0 * (blend - 0.5))))
#define BlendPinLightf(base, blend) ((blend < 0.5) ? BlendDarkenf(base, (2.0 * blend)) : BlendLightenf(base, (2.0 *(blend - 0.5))))
#define BlendHardMixf(base, blend) ((BlendVividLightf(base, blend) < 0.5) ? 0.0 : 1.0)
#define BlendReflectf(base, blend) ((blend == 1.0) ? blend : min(base * base / (1.0 - blend), 1.0))
/*
** Vector3 blending modes
*/
#define Blend(base, blend, funcf) vec3(funcf(base.r, blend.r), funcf(base.g, blend.g), funcf(base.b, blend.b))
#define BlendNormal(base, blend) (blend)
#define BlendLighten BlendLightenf
#define BlendDarken BlendDarkenf
#define BlendMultiply(base, blend) (base * blend)
#define BlendAverage(base, blend) ((base + blend) / 2.0)
#define BlendAdd(base, blend) min(base + blend, vec3(1.0))
#define BlendSubstract(base, blend) max(base + blend - vec3(1.0), vec3(0.0))
#define BlendDifference(base, blend) abs(base - blend)
#define BlendNegation(base, blend) (vec3(1.0) - abs(vec3(1.0) - base - blend))
#define BlendExclusion(base, blend) (base + blend - 2.0 * base * blend)
#define BlendScreen(base, blend) Blend(base, blend, BlendScreenf)
#define BlendOverlay(base, blend) Blend(base, blend, BlendOverlayf)
#define BlendSoftLight(base, blend) Blend(base, blend, BlendSoftLightf)
#define BlendHardLight(base, blend) BlendOverlay(blend, base)
#define BlendColorDodge(base, blend) Blend(base, blend, BlendColorDodgef)
#define BlendColorBurn(base, blend) Blend(base, blend, BlendColorBurnf)
#define BlendLinearDodge BlendAdd
#define BlendLinearBurn BlendSubstract
#define BlendLinearLight(base, blend) Blend(base, blend, BlendLinearLightf)
#define BlendVividLight(base, blend) Blend(base, blend, BlendVividLightf)
#define BlendPinLight(base, blend) Blend(base, blend, BlendPinLightf)
#define BlendHardMix(base, blend) Blend(base, blend, BlendHardMixf)
#define BlendReflect(base, blend) Blend(base, blend, BlendReflectf)
#define BlendGlow(base, blend) BlendReflect(blend, base)
#define BlendPhoenix(base, blend) (min(base, blend) - max(base, blend) + vec3(1.0))
#define BlendOpacity(base, blend, F, O) (F(base, blend) * O + blend * (1.0 - O))
vec3 BlendHue(vec3 base, vec3 blend)
{
vec3 baseHSL = RGBToHSL(base);
return HSLToRGB(vec3(RGBToHSL(blend).r, baseHSL.g, baseHSL.b));
}
vec3 BlendSaturation(vec3 base, vec3 blend)
{
vec3 baseHSL = RGBToHSL(base);
return HSLToRGB(vec3(baseHSL.r, RGBToHSL(blend).g, baseHSL.b));
}
vec3 BlendColor(vec3 base, vec3 blend)
{
vec3 blendHSL = RGBToHSL(blend);
return HSLToRGB(vec3(blendHSL.r, blendHSL.g, RGBToHSL(base).b));
}
vec3 BlendLuminosity(vec3 base, vec3 blend)
{
vec3 baseHSL = RGBToHSL(base);
return HSLToRGB(vec3(baseHSL.r, baseHSL.g, RGBToHSL(blend).b));
}
)shader";
return glsl;
}
static std::string get_chroma_glsl()
{
static std::string glsl = R"shader(
// Chroma keying
// Author: Tim Eves
//
// This implements the Chroma key algorithm described in the paper:
// 'Software Chroma Keying in an Imersive Virtual Environment'
// by F. van den Bergh & V. Lalioti
// but as a pixel shader algorithm.
//
vec4 grey_xfer = is_hd
? vec4(0.2126, 0.7152, 0.0722, 0)
: vec4(0.299, 0.587, 0.114, 0);
// This allows us to implement the paper's alphaMap curve in software
// rather than a largeish array
float alpha_map(float d)
{
return 1.0 - smoothstep(1.0, chroma_softness, d);
}
// http://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
// From the same page
vec3 hsv2rgb(vec3 c)
{
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float AngleDiff(float angle1, float angle2)
{
return 0.5 - abs(abs(angle1 - angle2) - 0.5);
}
float AngleDiffDirectional(float angle1, float angle2)
{
float diff = angle1 - angle2;
return diff < -0.5
? diff + 1.0
: (diff > 0.5 ? diff - 1.0 : diff);
}
float Distance(float actual, float target)
{
return min(0.0, target - actual);
}
float ColorDistance(vec3 hsv)
{
float hueDiff = AngleDiff(hsv.x, chroma_target_hue) * 2;
float saturationDiff = Distance(hsv.y, chroma_min_saturation);
float brightnessDiff = Distance(hsv.z, chroma_min_brightness);
float saturationBrightnessScore = max(brightnessDiff, saturationDiff);
float hueScore = hueDiff - chroma_hue_width;
return -hueScore * saturationBrightnessScore;
}
vec3 supress_spill(vec3 c)
{
float hue = c.x;
float diff = AngleDiffDirectional(hue, chroma_target_hue);
float distance = abs(diff) / chroma_spill_suppress;
if (distance < 1)
{
c.x = diff < 0
? chroma_target_hue - chroma_spill_suppress
: chroma_target_hue + chroma_spill_suppress;
c.y *= min(1.0, distance + chroma_spill_suppress_saturation);
}
return c;
}
// Key on any color
vec4 ChromaOnCustomColor(vec4 c)
{
vec3 hsv = rgb2hsv(c.rgb);
float distance = ColorDistance(hsv);
float d = distance * -2.0 + 1.0;
vec4 suppressed = vec4(hsv2rgb(supress_spill(hsv)), 1.0);
float alpha = alpha_map(d);
suppressed *= alpha;
return chroma_show_mask ? vec4(suppressed.a, suppressed.a, suppressed.a, 1) : suppressed;
}
)shader";
return glsl;
}
server-2.2.0-stable/src/accelerator/ogl/image/image_kernel.cpp 0000664 0000000 0000000 00000037713 13411752632 0024354 0 ustar 00root root 0000000 0000000 /*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#include "image_kernel.h"
#include "blending_glsl.h"
#include "image_shader.h"
#include "../util/device.h"
#include "../util/shader.h"
#include "../util/texture.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace caspar { namespace accelerator { namespace ogl {
// http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect
bool get_line_intersection(double p0_x,
double p0_y,
double p1_x,
double p1_y,
double p2_x,
double p2_y,
double p3_x,
double p3_y,
double& result_x,
double& result_y)
{
double s1_x = p1_x - p0_x;
double s1_y = p1_y - p0_y;
double s2_x = p3_x - p2_x;
double s2_y = p3_y - p2_y;
double s = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);
double t = (s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);
if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {
// Collision detected
result_x = p0_x + (t * s1_x);
result_y = p0_y + (t * s1_y);
return true;
}
return false; // No collision
}
double hypotenuse(double x1, double y1, double x2, double y2)
{
auto x = x2 - x1;
auto y = y2 - y1;
return std::sqrt(x * x + y * y);
}
double calc_q(double close_diagonal, double distant_diagonal)
{
return (close_diagonal + distant_diagonal) / distant_diagonal;
}
bool is_above_screen(double y) { return y < 0.0; }
bool is_below_screen(double y) { return y > 1.0; }
bool is_left_of_screen(double x) { return x < 0.0; }
bool is_right_of_screen(double x) { return x > 1.0; }
bool is_outside_screen(const std::vector& coords)
{
auto x_coords =
coords | boost::adaptors::transformed([](const core::frame_geometry::coord& c) { return c.vertex_x; });
auto y_coords =
coords | boost::adaptors::transformed([](const core::frame_geometry::coord& c) { return c.vertex_y; });
return boost::algorithm::all_of(x_coords, &is_left_of_screen) ||
boost::algorithm::all_of(x_coords, &is_right_of_screen) ||
boost::algorithm::all_of(y_coords, &is_above_screen) || boost::algorithm::all_of(y_coords, &is_below_screen);
}
struct image_kernel::impl
{
spl::shared_ptr ogl_;
spl::shared_ptr shader_;
GLuint vao_;
GLuint vbo_;
impl(const spl::shared_ptr& ogl)
: ogl_(ogl)
, shader_(ogl_->dispatch_sync([&] { return get_image_shader(ogl); }))
{
ogl_->dispatch_sync([&] {
GL(glGenVertexArrays(1, &vao_));
GL(glGenBuffers(1, &vbo_));
});
}
~impl()
{
ogl_->dispatch_sync([&] {
GL(glDeleteVertexArrays(1, &vao_));
GL(glDeleteBuffers(1, &vbo_));
});
}
void draw(draw_params params)
{
static const double epsilon = 0.001;
CASPAR_ASSERT(params.pix_desc.planes.size() == params.textures.size());
if (params.textures.empty() || !params.background) {
return;
}
if (params.transform.opacity < epsilon) {
return;
}
auto coords = params.geometry.data();
if (coords.empty()) {
return;
}
// Calculate transforms
auto f_p = params.transform.fill_translation;
auto f_s = params.transform.fill_scale;
bool is_default_geometry = boost::equal(coords, core::frame_geometry::get_default().data());
auto aspect = params.aspect_ratio;
auto angle = params.transform.angle;
auto anchor = params.transform.anchor;
auto crop = params.transform.crop;
auto pers = params.transform.perspective;
pers.ur[0] -= 1.0;
pers.lr[0] -= 1.0;
pers.lr[1] -= 1.0;
pers.ll[1] -= 1.0;
std::vector> pers_corners = {pers.ul, pers.ur, pers.lr, pers.ll};
auto do_crop = [&](core::frame_geometry::coord& coord) {
if (!is_default_geometry) {
// TODO implement support for non-default geometry.
return;
}
coord.vertex_x = std::max(coord.vertex_x, crop.ul[0]);
coord.vertex_x = std::min(coord.vertex_x, crop.lr[0]);
coord.vertex_y = std::max(coord.vertex_y, crop.ul[1]);
coord.vertex_y = std::min(coord.vertex_y, crop.lr[1]);
coord.texture_x = std::max(coord.texture_x, crop.ul[0]);
coord.texture_x = std::min(coord.texture_x, crop.lr[0]);
coord.texture_y = std::max(coord.texture_y, crop.ul[1]);
coord.texture_y = std::min(coord.texture_y, crop.lr[1]);
};
auto do_perspective = [=](core::frame_geometry::coord& coord, const std::array& pers_corner) {
if (!is_default_geometry) {
// TODO implement support for non-default geometry.
return;
}
coord.vertex_x += pers_corner[0];
coord.vertex_y += pers_corner[1];
};
auto rotate = [&](core::frame_geometry::coord& coord) {
auto orig_x = (coord.vertex_x - anchor[0]) * f_s[0];
auto orig_y = (coord.vertex_y - anchor[1]) * f_s[1] / aspect;
coord.vertex_x = orig_x * std::cos(angle) - orig_y * std::sin(angle);
coord.vertex_y = orig_x * std::sin(angle) + orig_y * std::cos(angle);
coord.vertex_y *= aspect;
};
auto move = [&](core::frame_geometry::coord& coord) {
coord.vertex_x += f_p[0];
coord.vertex_y += f_p[1];
};
int corner = 0;
for (auto& coord : coords) {
do_crop(coord);
do_perspective(coord, pers_corners.at(corner));
rotate(coord);
move(coord);
if (++corner == 4) {
corner = 0;
}
}
// Skip drawing if all the coordinates will be outside the screen.
if (is_outside_screen(coords)) {
return;
}
// Bind textures
for (int n = 0; n < params.textures.size(); ++n) {
params.textures[n]->bind(n);
}
if (params.local_key) {
params.local_key->bind(static_cast(texture_id::local_key));
}
if (params.layer_key) {
params.layer_key->bind(static_cast(texture_id::layer_key));
}
// Setup shader
shader_->use();
shader_->set("plane[0]", texture_id::plane0);
shader_->set("plane[1]", texture_id::plane1);
shader_->set("plane[2]", texture_id::plane2);
shader_->set("plane[3]", texture_id::plane3);
shader_->set("local_key", texture_id::local_key);
shader_->set("layer_key", texture_id::layer_key);
shader_->set("is_hd", params.pix_desc.planes.at(0).height > 700 ? 1 : 0);
shader_->set("has_local_key", static_cast(params.local_key));
shader_->set("has_layer_key", static_cast(params.layer_key));
shader_->set("pixel_format", params.pix_desc.format);
shader_->set("opacity", params.transform.is_key ? 1.0 : params.transform.opacity);
if (params.transform.chroma.enable) {
shader_->set("chroma", true);
shader_->set("chroma_show_mask", params.transform.chroma.show_mask);
shader_->set("chroma_target_hue", params.transform.chroma.target_hue / 360.0);
shader_->set("chroma_hue_width", params.transform.chroma.hue_width);
shader_->set("chroma_min_saturation", params.transform.chroma.min_saturation);
shader_->set("chroma_min_brightness", params.transform.chroma.min_brightness);
shader_->set("chroma_softness", 1.0 + params.transform.chroma.softness);
shader_->set("chroma_spill_suppress", params.transform.chroma.spill_suppress / 360.0);
shader_->set("chroma_spill_suppress_saturation", params.transform.chroma.spill_suppress_saturation);
} else {
shader_->set("chroma", false);
}
// Setup blend_func
if (params.transform.is_key) {
params.blend_mode = core::blend_mode::normal;
}
params.background->bind(static_cast(texture_id::background));
shader_->set("background", texture_id::background);
shader_->set("blend_mode", params.blend_mode);
shader_->set("keyer", params.keyer);
// Setup image-adjustements
if (params.transform.levels.min_input > epsilon || params.transform.levels.max_input < 1.0 - epsilon ||
params.transform.levels.min_output > epsilon || params.transform.levels.max_output < 1.0 - epsilon ||
std::abs(params.transform.levels.gamma - 1.0) > epsilon) {
shader_->set("levels", true);
shader_->set("min_input", params.transform.levels.min_input);
shader_->set("max_input", params.transform.levels.max_input);
shader_->set("min_output", params.transform.levels.min_output);
shader_->set("max_output", params.transform.levels.max_output);
shader_->set("gamma", params.transform.levels.gamma);
} else {
shader_->set("levels", false);
}
if (std::abs(params.transform.brightness - 1.0) > epsilon ||
std::abs(params.transform.saturation - 1.0) > epsilon ||
std::abs(params.transform.contrast - 1.0) > epsilon) {
shader_->set("csb", true);
shader_->set("brt", params.transform.brightness);
shader_->set("sat", params.transform.saturation);
shader_->set("con", params.transform.contrast);
} else {
shader_->set("csb", false);
}
// Setup drawing area
GL(glViewport(0, 0, params.background->width(), params.background->height()));
glDisable(GL_DEPTH_TEST);
auto m_p = params.transform.clip_translation;
auto m_s = params.transform.clip_scale;
bool scissor = m_p[0] > std::numeric_limits::epsilon() ||
m_p[1] > std::numeric_limits::epsilon() ||
m_s[0] < (1.0 - std::numeric_limits::epsilon()) ||
m_s[1] < (1.0 - std::numeric_limits::epsilon());
if (scissor) {
double w = static_cast(params.background->width());
double h = static_cast(params.background->height());
GL(glEnable(GL_SCISSOR_TEST));
GL(glScissor(static_cast(m_p[0] * w),
static_cast(m_p[1] * h),
std::max(0, static_cast(m_s[0] * w)),
std::max(0, static_cast(m_s[1] * h))));
}
// Set render target
params.background->attach();
// Perspective correction
double diagonal_intersection_x;
double diagonal_intersection_y;
if (get_line_intersection(pers.ul[0] + crop.ul[0],
pers.ul[1] + crop.ul[1],
pers.lr[0] + crop.lr[0],
pers.lr[1] + crop.lr[1],
pers.ur[0] + crop.lr[0],
pers.ur[1] + crop.ul[1],
pers.ll[0] + crop.ul[0],
pers.ll[1] + crop.lr[1],
diagonal_intersection_x,
diagonal_intersection_y) &&
is_default_geometry) {
// http://www.reedbeta.com/blog/2012/05/26/quadrilateral-interpolation-part-1/
auto d0 = hypotenuse(
pers.ll[0] + crop.ul[0], pers.ll[1] + crop.lr[1], diagonal_intersection_x, diagonal_intersection_y);
auto d1 = hypotenuse(
pers.lr[0] + crop.lr[0], pers.lr[1] + crop.lr[1], diagonal_intersection_x, diagonal_intersection_y);
auto d2 = hypotenuse(
pers.ur[0] + crop.lr[0], pers.ur[1] + crop.ul[1], diagonal_intersection_x, diagonal_intersection_y);
auto d3 = hypotenuse(
pers.ul[0] + crop.ul[0], pers.ul[1] + crop.ul[1], diagonal_intersection_x, diagonal_intersection_y);
auto ulq = calc_q(d3, d1);
auto urq = calc_q(d2, d0);
auto lrq = calc_q(d1, d3);
auto llq = calc_q(d0, d2);
std::vector q_values = {ulq, urq, lrq, llq};
corner = 0;
for (auto& coord : coords) {
coord.texture_q = q_values[corner];
coord.texture_x *= q_values[corner];
coord.texture_y *= q_values[corner];
if (++corner == 4)
corner = 0;
}
}
// Draw
switch (params.geometry.type()) {
case core::frame_geometry::geometry_type::quad: {
GL(glBindVertexArray(vao_));
GL(glBindBuffer(GL_ARRAY_BUFFER, vbo_));
std::vector coords_triangles{
coords[0], coords[1], coords[2], coords[0], coords[2], coords[3]};
GL(glBufferData(GL_ARRAY_BUFFER,
static_cast(sizeof(core::frame_geometry::coord)) * coords_triangles.size(),
coords_triangles.data(),
GL_STATIC_DRAW));
auto stride = static_cast(sizeof(core::frame_geometry::coord));
auto vtx_loc = shader_->get_attrib_location("Position");
auto tex_loc = shader_->get_attrib_location("TexCoordIn");
GL(glEnableVertexAttribArray(vtx_loc));
GL(glEnableVertexAttribArray(tex_loc));
GL(glVertexAttribPointer(vtx_loc, 2, GL_DOUBLE, GL_FALSE, stride, nullptr));
GL(glVertexAttribPointer(tex_loc, 4, GL_DOUBLE, GL_FALSE, stride, (GLvoid*)(2 * sizeof(GLdouble))));
GL(glDrawArrays(GL_TRIANGLES, 0, static_cast(coords_triangles.size())));
GL(glTextureBarrier());
GL(glDisableVertexAttribArray(vtx_loc));
GL(glDisableVertexAttribArray(tex_loc));
GL(glBindVertexArray(0));
GL(glBindBuffer(GL_ARRAY_BUFFER, 0));
break;
}
default:
break;
}
// Cleanup
GL(glDisable(GL_SCISSOR_TEST));
GL(glDisable(GL_BLEND));
}
};
image_kernel::image_kernel(const spl::shared_ptr& ogl)
: impl_(new impl(ogl))
{
}
image_kernel::~image_kernel() {}
void image_kernel::draw(const draw_params& params) { impl_->draw(params); }
}}} // namespace caspar::accelerator::ogl
server-2.2.0-stable/src/accelerator/ogl/image/image_kernel.h 0000664 0000000 0000000 00000004262 13411752632 0024012 0 ustar 00root root 0000000 0000000 /*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#pragma once
#include
#include
#include
#include
#include
namespace caspar { namespace accelerator { namespace ogl {
enum class keyer
{
linear = 0,
additive,
};
struct draw_params final
{
core::pixel_format_desc pix_desc = core::pixel_format::invalid;
std::vector> textures;
core::image_transform transform;
core::frame_geometry geometry = core::frame_geometry::get_default();
core::blend_mode blend_mode = core::blend_mode::normal;
ogl::keyer keyer = ogl::keyer::linear;
std::shared_ptr background;
std::shared_ptr local_key;
std::shared_ptr layer_key;
double aspect_ratio = 1.0;
};
class image_kernel final
{
image_kernel(const image_kernel&);
image_kernel& operator=(const image_kernel&);
public:
image_kernel(const spl::shared_ptr& ogl);
~image_kernel();
void draw(const draw_params& params);
private:
struct impl;
spl::unique_ptr impl_;
};
}}} // namespace caspar::accelerator::ogl
server-2.2.0-stable/src/accelerator/ogl/image/image_mixer.cpp 0000664 0000000 0000000 00000030511 13411752632 0024205 0 ustar 00root root 0000000 0000000 /*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#include "image_mixer.h"
#include "image_kernel.h"
#include "../util/buffer.h"
#include "../util/device.h"
#include "../util/texture.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace caspar { namespace accelerator { namespace ogl {
typedef std::shared_future> future_texture;
struct item
{
core::pixel_format_desc pix_desc = core::pixel_format::invalid;
std::vector textures;
core::image_transform transform;
core::frame_geometry geometry = core::frame_geometry::get_default();
};
struct layer
{
std::vector sublayers;
std::vector- items;
core::blend_mode blend_mode;
layer(core::blend_mode blend_mode)
: blend_mode(blend_mode)
{
}
};
class image_renderer
{
spl::shared_ptr ogl_;
image_kernel kernel_;
public:
image_renderer(const spl::shared_ptr& ogl)
: ogl_(ogl)
, kernel_(ogl_)
{
}
std::future> operator()(std::vector layers,
const core::video_format_desc& format_desc)
{
if (layers.empty()) { // Bypass GPU with empty frame.
static const std::vector buffer(4096 * 4096 * 4, 0);
return make_ready_future(array(buffer.data(), format_desc.size, true));
}
return flatten(ogl_->dispatch_async([=]() mutable -> std::shared_future> {
auto target_texture = ogl_->create_texture(format_desc.width, format_desc.height, 4);
draw(target_texture, std::move(layers), format_desc);
return ogl_->copy_async(target_texture);
}));
}
private:
void draw(std::shared_ptr& target_texture,
std::vector layers,
const core::video_format_desc& format_desc)
{
std::shared_ptr layer_key_texture;
for (auto& layer : layers) {
draw(target_texture, layer.sublayers, format_desc);
draw(target_texture, std::move(layer), layer_key_texture, format_desc);
}
}
void draw(std::shared_ptr& target_texture,
layer layer,
std::shared_ptr& layer_key_texture,
const core::video_format_desc& format_desc)
{
if (layer.items.empty())
return;
std::shared_ptr local_key_texture;
std::shared_ptr local_mix_texture;
if (layer.blend_mode != core::blend_mode::normal) {
auto layer_texture = ogl_->create_texture(target_texture->width(), target_texture->height(), 4);
for (auto& item : layer.items)
draw(layer_texture,
std::move(item),
layer_key_texture,
local_key_texture,
local_mix_texture,
format_desc);
draw(layer_texture, std::move(local_mix_texture), core::blend_mode::normal);
draw(target_texture, std::move(layer_texture), layer.blend_mode);
} else // fast path
{
for (auto& item : layer.items)
draw(target_texture,
std::move(item),
layer_key_texture,
local_key_texture,
local_mix_texture,
format_desc);
draw(target_texture, std::move(local_mix_texture), core::blend_mode::normal);
}
layer_key_texture = std::move(local_key_texture);
}
void draw(std::shared_ptr& target_texture,
item item,
std::shared_ptr& layer_key_texture,
std::shared_ptr& local_key_texture,
std::shared_ptr& local_mix_texture,
const core::video_format_desc& format_desc)
{
draw_params draw_params;
draw_params.pix_desc = std::move(item.pix_desc);
draw_params.transform = std::move(item.transform);
draw_params.geometry = item.geometry;
draw_params.aspect_ratio =
static_cast(format_desc.square_width) / static_cast(format_desc.square_height);
for (auto& future_texture : item.textures) {
draw_params.textures.push_back(spl::make_shared_ptr(future_texture.get()));
}
if (item.transform.is_key) {
local_key_texture = local_key_texture
? local_key_texture
: ogl_->create_texture(target_texture->width(), target_texture->height(), 1);
draw_params.background = local_key_texture;
draw_params.local_key = nullptr;
draw_params.layer_key = nullptr;
kernel_.draw(std::move(draw_params));
} else if (item.transform.is_mix) {
local_mix_texture = local_mix_texture
? local_mix_texture
: ogl_->create_texture(target_texture->width(), target_texture->height(), 4);
draw_params.background = local_mix_texture;
draw_params.local_key = std::move(local_key_texture);
draw_params.layer_key = layer_key_texture;
draw_params.keyer = keyer::additive;
kernel_.draw(std::move(draw_params));
} else {
draw(target_texture, std::move(local_mix_texture), core::blend_mode::normal);
draw_params.background = target_texture;
draw_params.local_key = std::move(local_key_texture);
draw_params.layer_key = layer_key_texture;
kernel_.draw(std::move(draw_params));
}
}
void draw(std::shared_ptr& target_texture,
std::shared_ptr&& source_buffer,
core::blend_mode blend_mode = core::blend_mode::normal)
{
if (!source_buffer)
return;
draw_params draw_params;
draw_params.pix_desc.format = core::pixel_format::bgra;
draw_params.pix_desc.planes = {
core::pixel_format_desc::plane(source_buffer->width(), source_buffer->height(), 4)};
draw_params.textures = {spl::make_shared_ptr(source_buffer)};
draw_params.transform = core::image_transform();
draw_params.blend_mode = blend_mode;
draw_params.background = target_texture;
draw_params.geometry = core::frame_geometry::get_default();
kernel_.draw(std::move(draw_params));
}
};
struct image_mixer::impl
: public core::frame_factory
, public std::enable_shared_from_this
{
spl::shared_ptr ogl_;
image_renderer renderer_;
std::vector transform_stack_;
std::vector layers_; // layer/stream/items
std::vector layer_stack_;
public:
impl(const spl::shared_ptr& ogl, int channel_id)
: ogl_(ogl)
, renderer_(ogl)
, transform_stack_(1)
{
CASPAR_LOG(info) << L"Initialized OpenGL Accelerated GPU Image Mixer for channel " << channel_id;
}
void push(const core::frame_transform& transform)
{
auto previous_layer_depth = transform_stack_.back().layer_depth;
transform_stack_.push_back(transform_stack_.back() * transform.image_transform);
auto new_layer_depth = transform_stack_.back().layer_depth;
if (previous_layer_depth < new_layer_depth) {
layer new_layer(transform_stack_.back().blend_mode);
if (layer_stack_.empty()) {
layers_.push_back(std::move(new_layer));
layer_stack_.push_back(&layers_.back());
} else {
layer_stack_.back()->sublayers.push_back(std::move(new_layer));
layer_stack_.push_back(&layer_stack_.back()->sublayers.back());
}
}
}
void visit(const core::const_frame& frame)
{
if (frame.pixel_format_desc().format == core::pixel_format::invalid)
return;
if (frame.pixel_format_desc().planes.empty())
return;
item item;
item.pix_desc = frame.pixel_format_desc();
item.transform = transform_stack_.back();
item.geometry = frame.geometry();
auto textures_ptr = boost::any_cast>>(frame.opaque());
if (textures_ptr) {
item.textures = *textures_ptr;
} else {
for (int n = 0; n < static_cast(item.pix_desc.planes.size()); ++n) {
item.textures.emplace_back(ogl_->copy_async(frame.image_data(n),
item.pix_desc.planes[n].width,
item.pix_desc.planes[n].height,
item.pix_desc.planes[n].stride));
}
}
layer_stack_.back()->items.push_back(item);
}
void pop()
{
transform_stack_.pop_back();
layer_stack_.resize(transform_stack_.back().layer_depth);
}
std::future> render(const core::video_format_desc& format_desc)
{
return renderer_(std::move(layers_), format_desc);
}
core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override
{
std::vector> image_data;
for (auto& plane : desc.planes) {
image_data.push_back(ogl_->create_array(plane.size));
}
std::weak_ptr weak_self = shared_from_this();
return core::mutable_frame(
tag,
std::move(image_data),
array{},
desc,
[weak_self, desc](std::vector> image_data) -> boost::any {
auto self = weak_self.lock();
if (!self) {
return boost::any{};
}
std::vector textures;
for (int n = 0; n < static_cast(desc.planes.size()); ++n) {
textures.emplace_back(self->ogl_->copy_async(
image_data[n], desc.planes[n].width, desc.planes[n].height, desc.planes[n].stride));
}
return std::make_shared(std::move(textures));
});
}
};
image_mixer::image_mixer(const spl::shared_ptr& ogl, int channel_id)
: impl_(std::make_unique(ogl, channel_id))
{
}
image_mixer::~image_mixer() {}
void image_mixer::push(const core::frame_transform& transform) { impl_->push(transform); }
void image_mixer::visit(const core::const_frame& frame) { impl_->visit(frame); }
void image_mixer::pop() { impl_->pop(); }
std::future> image_mixer::operator()(const core::video_format_desc& format_desc)
{
return impl_->render(format_desc);
}
core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc)
{
return impl_->create_frame(tag, desc);
}
}}} // namespace caspar::accelerator::ogl
server-2.2.0-stable/src/accelerator/ogl/image/image_mixer.h 0000664 0000000 0000000 00000003620 13411752632 0023653 0 ustar 00root root 0000000 0000000 /*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace caspar { namespace accelerator { namespace ogl {
class image_mixer final : public core::image_mixer
{
public:
image_mixer(const spl::shared_ptr& ogl, int channel_id);
image_mixer(const image_mixer&) = delete;
~image_mixer();
image_mixer& operator=(const image_mixer&) = delete;
std::future> operator()(const core::video_format_desc& format_desc) override;
core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override;
// core::image_mixer
void push(const core::frame_transform& frame) override;
void visit(const core::const_frame& frame) override;
void pop() override;
private:
struct impl;
std::shared_ptr impl_;
};
}}} // namespace caspar::accelerator::ogl server-2.2.0-stable/src/accelerator/ogl/image/image_shader.cpp 0000664 0000000 0000000 00000021304 13411752632 0024327 0 ustar 00root root 0000000 0000000 /*
* Copyright (c) 2011 Sveriges Television AB
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CasparCG 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CasparCG. If not, see .
*
* Author: Robert Nagy, ronag89@gmail.com
*/
#include "image_shader.h"
#include "../util/device.h"
#include "../util/shader.h"
#include "blending_glsl.h"
#include
#include
#include
namespace caspar { namespace accelerator { namespace ogl {
std::weak_ptr g_shader;
std::mutex g_shader_mutex;
std::string get_blend_color_func()
{
return
get_adjustement_glsl()
+
get_blend_glsl()
+
R"shader(
vec3 get_blend_color(vec3 back, vec3 fore)
{
switch(blend_mode)
{
case 0: return BlendNormal(back, fore);
case 1: return BlendLighten(back, fore);
case 2: return BlendDarken(back, fore);
case 3: return BlendMultiply(back, fore);
case 4: return BlendAverage(back, fore);
case 5: return BlendAdd(back, fore);
case 6: return BlendSubstract(back, fore);
case 7: return BlendDifference(back, fore);
case 8: return BlendNegation(back, fore);
case 9: return BlendExclusion(back, fore);
case 10: return BlendScreen(back, fore);
case 11: return BlendOverlay(back, fore);
// case 12: return BlendSoftLight(back, fore);
case 13: return BlendHardLight(back, fore);
case 14: return BlendColorDodge(back, fore);
case 15: return BlendColorBurn(back, fore);
case 16: return BlendLinearDodge(back, fore);
case 17: return BlendLinearBurn(back, fore);
case 18: return BlendLinearLight(back, fore);
case 19: return BlendVividLight(back, fore);
case 20: return BlendPinLight(back, fore);
case 21: return BlendHardMix(back, fore);
case 22: return BlendReflect(back, fore);
case 23: return BlendGlow(back, fore);
case 24: return BlendPhoenix(back, fore);
case 25: return BlendHue(back, fore);
case 26: return BlendSaturation(back, fore);
case 27: return BlendColor(back, fore);
case 28: return BlendLuminosity(back, fore);
}
return BlendNormal(back, fore);
}
vec4 blend(vec4 fore)
{
vec4 back = texture(background, TexCoord2.st).bgra;
if(blend_mode != 0)
fore.rgb = get_blend_color(back.rgb/(back.a+0.0000001), fore.rgb/(fore.a+0.0000001))*fore.a;
switch(keyer)
{
case 1: return fore + back; // additive
default: return fore + (1.0-fore.a)*back; // linear
}
}
)shader";
}
std::string get_chroma_func()
{
return
get_chroma_glsl()
+
R"shader(
vec4 chroma_key(vec4 c)
{
return ChromaOnCustomColor(c.bgra).bgra;
}
)shader";
}
std::string get_vertex()
{
return R"shader(
#version 450
in vec4 TexCoordIn;
in vec2 Position;
out vec4 TexCoord;
out vec4 TexCoord2;
void main()
{
TexCoord = TexCoordIn;
vec4 pos = vec4(Position, 0, 1);
TexCoord2 = vec4(pos.xy, 0.0, 0.0);
pos.x = pos.x*2.0 - 1.0;
pos.y = pos.y*2.0 - 1.0;
gl_Position = pos;
}
)shader";
}
std::string get_fragment()
{
return R"shader(
#version 450
in vec4 TexCoord;
in vec4 TexCoord2;
out vec4 fragColor;
uniform sampler2D background;
uniform sampler2D plane[4];
uniform sampler2D local_key;
uniform sampler2D layer_key;
uniform bool is_hd;
uniform bool has_local_key;
uniform bool has_layer_key;
uniform int blend_mode;
uniform int keyer;
uniform int pixel_format;
uniform float opacity;
uniform bool levels;
uniform float min_input;
uniform float max_input;
uniform float gamma;
uniform float min_output;
uniform float max_output;
uniform bool csb;
uniform float brt;
uniform float sat;
uniform float con;
uniform bool chroma;
uniform bool chroma_show_mask;
uniform float chroma_target_hue;
uniform float chroma_hue_width;
uniform float chroma_min_saturation;
uniform float chroma_min_brightness;
uniform float chroma_softness;
uniform float chroma_spill_suppress;
uniform float chroma_spill_suppress_saturation;
)shader"
+
get_blend_color_func()
+
get_chroma_func()
+
R"shader(
vec4 ycbcra_to_rgba_sd(float Y, float Cb, float Cr, float A)
{
vec4 rgba;
rgba.b = (1.164*(Y*255 - 16) + 1.596*(Cr*255 - 128))/255;
rgba.g = (1.164*(Y*255 - 16) - 0.813*(Cr*255 - 128) - 0.391*(Cb*255 - 128))/255;
rgba.r = (1.164*(Y*255 - 16) + 2.018*(Cb*255 - 128))/255;
rgba.a = A;
return rgba;
}
vec4 ycbcra_to_rgba_hd(float Y, float Cb, float Cr, float A)
{
vec4 rgba;
rgba.b = (1.164*(Y*255 - 16) + 1.793*(Cr*255 - 128))/255;
rgba.g = (1.164*(Y*255 - 16) - 0.534*(Cr*255 - 128) - 0.213*(Cb*255 - 128))/255;
rgba.r = (1.164*(Y*255 - 16) + 2.115*(Cb*255 - 128))/255;
rgba.a = A;
return rgba;
}
vec4 ycbcra_to_rgba(float y, float cb, float cr, float a)
{
if(is_hd)
return ycbcra_to_rgba_hd(y, cb, cr, a);
else
return ycbcra_to_rgba_sd(y, cb, cr, a);
}
vec4 get_sample(sampler2D sampler, vec2 coords)
{
return texture2D(sampler, coords);
}
vec4 get_rgba_color()
{
switch(pixel_format)
{
case 0: //gray
return vec4(get_sample(plane[0], TexCoord.st / TexCoord.q).rrr, 1.0);
case 1: //bgra,
return get_sample(plane[0], TexCoord.st / TexCoord.q).bgra;
case 2: //rgba,
return get_sample(plane[0], TexCoord.st / TexCoord.q).rgba;
case 3: //argb,
return get_sample(plane[0], TexCoord.st / TexCoord.q).argb;
case 4: //abgr,
return get_sample(plane[0], TexCoord.st / TexCoord.q).gbar;
case 5: //ycbcr,
{
float y = get_sample(plane[0], TexCoord.st / TexCoord.q).r;
float cb = get_sample(plane[1], TexCoord.st / TexCoord.q).r;
float cr = get_sample(plane[2], TexCoord.st / TexCoord.q).r;
return ycbcra_to_rgba(y, cb, cr, 1.0);
}
case 6: //ycbcra
{
float y = get_sample(plane[0], TexCoord.st / TexCoord.q).r;
float cb = get_sample(plane[1], TexCoord.st / TexCoord.q).r;
float cr = get_sample(plane[2], TexCoord.st / TexCoord.q).r;
float a = get_sample(plane[3], TexCoord.st / TexCoord.q).r;
return ycbcra_to_rgba(y, cb, cr, a);
}
case 7: //luma
{
vec3 y3 = get_sample(plane[0], TexCoord.st / TexCoord.q).rrr;
return vec4((y3-0.065)/0.859, 1.0);
}
case 8: //bgr,
return vec4(get_sample(plane[0], TexCoord.st / TexCoord.q).bgr, 1.0);
case 9: //rgb,
return vec4(get_sample(plane[0], TexCoord.st / TexCoord.q).rgb, 1.0);
}
return vec4(0.0, 0.0, 0.0, 0.0);
}
void main()
{
vec4 color = get_rgba_color();
if (chroma)
color = chroma_key(color);
if(levels)
color.rgb = LevelsControl(color.rgb, min_input, gamma, max_input, min_output, max_output);
if(csb)
color.rgb = ContrastSaturationBrightness(color, brt, sat, con);
if(has_local_key)
color *= texture(local_key, TexCoord2.st).r;
if(has_layer_key)
color *= texture(layer_key, TexCoord2.st).r;
color *= opacity;
if (blend_mode >= 0)
color = blend(color);
fragColor = color.bgra;
}
)shader";
}
std::shared_ptr get_image_shader(const spl::shared_ptr& ogl)
{
std::lock_guard lock(g_shader_mutex);
auto existing_shader = g_shader.lock();
if (existing_shader) {
return existing_shader;
}
// The deleter is alive until the weak pointer is destroyed, so we have
// to weakly reference ogl, to not keep it alive until atexit
std::weak_ptr