build: improve X11 detection on OS X

/usr/X11R6 doesn't exist on OS X per default (anymore). Therefore add
PATHS to all X11 detection modules pointing to the Xquarz installation
directory in /opt/X11.
For FindX11 it was also necessary to ensure that the frameworks are
searched as last (after PATHS) otherwise it could happen that X11 headers
of a framework (e.g. Tk.framework) were used.
rdtk: build samples only if WITH_SAMPLE is enabled
Mac: set policy to silent cmake >= 3.0 warnings

Set the following policies to "OLD" if cmake version is greater than
2.8.12:

CMP0026 - Disallow use of the LOCATION target property
CMP0045 - Error on non-existent target in get_target_property
build: cmake 3.1 compatibility

* fix problem with REMOVE_DUPLICATES on undefined lists
* since 3.1 file(GLOB FILEPATHS RELATIVE .. returns single / instead of // as
  previously - necessary adoptions for regex and matches done. Should
	work with all cmake versions.

Tested with 3.1.0-rc3
rdtk/shadow: install libraries versioned
Merge pull request #2276 from bmiklautz/build_fixes

Build fixes