OSX/cmake: more work on T40887 and a tentative fix
- test fail due libiomp5 is not available @ testing time
- must solve this by adding requred flags/includes to tests
- atm release builds are possible with this hack
Install_deps: minor cleanup.

Patch D633 by simonrepp (Simon Repp), thx.
Fix T40986: crash on using the viewer node inside of group nodes.

Viewers were activated both inside the active group as well as the top
level tree (the latter being a quick fix for getting a fallback viewer).
This caused a race condition on the shared viewer image.

Now the active viewer is defined at node conversion time in the converter
so that only one can be active at a time without each node having to
follow complicated rules for exclusion.
Fix T40983 Particle Texture use of generated coordinates is wrong.

Particle texture eval was not taking the actual texture space for orco/
generated textures into account at all.
Fix T40785: "Select Grouped" Pass Index mode is redundant.
Revert "Object Select Similar tool now has a Pass Index option."

This reverts commit 7a6919a74eb08caaf21030c17fe7c2723394a3d6.
OSX/CMAKE: extend my former workaround for failing tests with clang-omp to all build types
- this workaround makes sure the breaking -fopenmp is not exposed to testcompiles which use C_FLAGS respective CXX_Flags
- -fopenmp is always added to the CMAKE_C(XX)_FLAGS_<BUILD_TYPE> now
- another way to solve this would be to move the Configure OpenMP part after all line 2366,
but i don’t know if this would be apreciated
OSX/CMAKE: Way better fix for T40887, checks where failing with clang-omp
- found a way to feed just extra flags to the testcompiles
Correct IS_EMPTY macro

also prevent reading from BM_ELEM_API_FLAG_ get/setters
Math Lib: add function to get signed angle about an axis
Freestyle: fix for crash in the constructor of freestyle.types.StrokeVertexIterator.
Add bone_groups.new() and bone_groups.remove() methods to RNA.

To do so, matching BKE 'API' was also refactored a bit:
* Get Pose data instead of Object, as parameter;
* Removed some sanity checks not needed at such a low level (callers are supposed to do that);
* You can now remove an arbitrary bone group, not only the active one.

Based on patch by pkrime (Paolo Acampora), with own edits.

Reviewers: #python, pkrime, aligorith

Reviewed By: aligorith

Differential Revision: https://developer.blender.org/D522
Fix T40980: Exporting animation in MPEG Matroska using ffv1 and FLAC codecs fails
Fix T40164: Linking a Group of linked Groups don't take Dupli Visibility
correctly.

Problem was that object layers are defined by duplis as the top-level
duplicator layers. This happens //during// the duplilist construction,
which breaks group layer checks for subsequent instances and hides them.
Now the duplilist generators leave Object DNA untouched, the
modification of layers for drawing, rendering, etc. happens afterward
in the duplilist_apply/restore functions, as a kind of second pass.
Fix T40939: Border render and SSS doesn't work correct in rendered viewport

There were some missing updates in the viewport render job which lead to
wrong SSS mapping on the final resolution.

There was also wrong scaling applying when border render is used.

And last but not least(?) strands render was using first level of the
resolution leading to really thick strands in the final viewport.
Cleanup: get rid of magic numbers.
Cleanup: silent C++11 warning (implicit double to float conversion) in Collada code.
Implement Start Resolution for preview render in BI

So now viewport render resolution division works exactly the same as in Cycles.
Fix T41003: Object Info's Random socket produces erratic results when
material is applied to multiple Dupli instances of an object.

One of the random_id initialization lines for cycles objects slipped
into the basic update part in this commit:
rBb98ff5cb5b2c14c33b16e3b129e1e08810e90a6c

This would constantly re-shuffle the random_id ...
Fix T40991, mirrored armatures not restored properly when cancelling.

Issue here is that we force mirroring even if original armature is not
mirrored.

We could be smart and store only unselected mirrored bones here (since
those will get restored from transdata), however not all properties were
getting stored and restored; rolling bones still suffered from the bug
for instance.

To fix this we need to restore all properties that armature mirroring
overrides. Transdata obviously does not offer a lot of space here, so I
used TransInfo->customdata to store an array of initial parameters of
the mirrored bones.
Fix T40997, artifacts when unhiding part of the mesh in dyntopo.

Tagging a face as hidden should not be done only when hiding.