Squashed 'third_party/matplotlib-cpp/' content from commit f994996
Change-Id: I2124d6ed85284acca42fc0e90f489f422e6e440a
git-subtree-dir: third_party/matplotlib-cpp
git-subtree-split: f994996e0724f30612154a26cbdc660ad9c51907
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
new file mode 100644
index 0000000..ba14b86
--- /dev/null
+++ b/contrib/CMakeLists.txt
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 3.1)
+project (MatplotlibCPP_Test)
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+include_directories(${PYTHONHOME}/include)
+link_directories(${PYTHONHOME}/libs)
+
+add_definitions(-DMATPLOTLIBCPP_PYTHON_HEADER=Python.h)
+
+# message(STATUS "*** dump start cmake variables ***")
+# get_cmake_property(_variableNames VARIABLES)
+# foreach(_variableName ${_variableNames})
+ # message(STATUS "${_variableName}=${${_variableName}}")
+# endforeach()
+# message(STATUS "*** dump end ***")
+
+add_executable(minimal ${CMAKE_CURRENT_SOURCE_DIR}/../examples/minimal.cpp)
+add_executable(basic ${CMAKE_CURRENT_SOURCE_DIR}/../examples/basic.cpp)
+add_executable(modern ${CMAKE_CURRENT_SOURCE_DIR}/../examples/modern.cpp)
diff --git a/contrib/README.md b/contrib/README.md
new file mode 100644
index 0000000..efc0a50
--- /dev/null
+++ b/contrib/README.md
@@ -0,0 +1,19 @@
+# contrib/
+
+This folder contains contributions that may be useful to users of this library, but
+have a too specialized audience to become part of the main tree.
+
+In particular, things in here will have a higher rate of bit-rot, since
+contributors are not required to and may be unable to check whether their
+changes break any of them.
+
+## Windows support
+
+### Configuring and Building Samples
+
+```cmd
+> cd contrib
+> WinBuild.cmd
+```
+
+The `WinBuild.cmd` will set up temporal ENV variables and build binaries in (matplotlib root)/examples with the Release configuration.
diff --git a/contrib/WinBuild.cmd b/contrib/WinBuild.cmd
new file mode 100644
index 0000000..4e3b450
--- /dev/null
+++ b/contrib/WinBuild.cmd
@@ -0,0 +1,46 @@
+@echo off
+@setlocal EnableDelayedExpansion
+
+if NOT DEFINED MSVC_VERSION set MSVC_VERSION=14
+if NOT DEFINED CMAKE_CONFIG set CMAKE_CONFIG=Release
+if NOT DEFINED PYTHONHOME set PYTHONHOME=C:/Users/%username%/Anaconda3
+
+if "%MSVC_VERSION%"=="14" (
+ if "%processor_architecture%" == "AMD64" (
+ set CMAKE_GENERATOR=Visual Studio 14 2015 Win64
+ ) else (
+ set CMAKE_GENERATOR=Visual Studio 14 2015
+ )
+) else if "%MSVC_VERSION%"=="12" (
+ if "%processor_architecture%" == "AMD64" (
+ set CMAKE_GENERATOR=Visual Studio 12 2013 Win64
+
+ ) else (
+ set CMAKE_GENERATOR=Visual Studio 12 2013
+ )
+)
+
+set batch_file=!VS%MSVC_VERSION%0COMNTOOLS!..\..\VC\vcvarsall.bat
+call "%batch_file%" %processor_architecture%
+
+pushd ..
+pushd examples
+if NOT EXIST build mkdir build
+pushd build
+
+cmake -G"!CMAKE_GENERATOR!" ^
+ -DPYTHONHOME:STRING=%PYTHONHOME%^
+ -DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG% ^
+ %~dp0
+cmake --build . --config %CMAKE_CONFIG%
+
+pushd %CMAKE_CONFIG%
+if not EXIST platforms mkdir platforms
+if EXIST %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ^
+cp %PYTHONHOME%/Library/plugins/platforms/qwindows.dll ./platforms/
+popd
+REM move ./%CMAKE_CONFIG% ../
+popd
+popd
+popd
+@endlocal