Commit 8f6357ab authored by David C. Lonie's avatar David C. Lonie

Fix matplotlib compilation on win32.

Change-Id: I6d2f897335c62e89dfa31236690fc4909d62bb79
parent c9eb3297
set (_install_location "<INSTALL_DIR>")
configure_file("${SuperBuild_PROJECTS_DIR}/patches/matplotlib.setup.cfg.in"
"${CMAKE_BINARY_DIR}/matplotlib.setup.cfg")
add_external_project(matplotlib
DEPENDS python numpy png freetype
PATCH_COMMAND
${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_BINARY_DIR}/matplotlib.setup.cfg"
"<SOURCE_DIR>/setup.cfg"
${CMAKE_COMMAND}
"-DPATCHES_DIR:PATH=${SuperBuild_PROJECTS_DIR}/patches/"
"-DPATCH_OUTPUT_DIR:PATH=${CMAKE_BINARY_DIR}"
"-DSOURCE_DIR:PATH=<SOURCE_DIR>"
"-DINSTALL_DIR:PATH=<INSTALL_DIR>"
-P "${CMAKE_CURRENT_LIST_DIR}/matplotlib.patch.cmake"
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND
${CMAKE_COMMAND} -DPYTHON_EXECUTABLE:PATH=${pv_python_executable}
-DMATPLOTLIB_SOURCE_DIR:PATH=<SOURCE_DIR>
......
# SOURCE_DIR matplotlib source directory
# PATCHES_DIR superbuild patches directory
# INSTALL_DIR superbuild install prefix
# PATCH_OUTPUT_DIR where to configure patched files into (CMAKE_BINARY_DIR)
# Matplotlib expects these libraries to be named differently on windows...
if(WIN32)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${INSTALL_DIR}/lib/zlib.lib"
"${INSTALL_DIR}/lib/z.lib"
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${INSTALL_DIR}/lib/libpng14.lib"
"${INSTALL_DIR}/lib/png.lib"
)
endif()
configure_file("${PATCHES_DIR}/matplotlib.setup.cfg.in"
"${PATCH_OUTPUT_DIR}/matplotlib.setup.cfg")
execute_process(COMMAND
${CMAKE_COMMAND} -E copy_if_different
"${PATCH_OUTPUT_DIR}/matplotlib.setup.cfg"
"${SOURCE_DIR}/setup.cfg"
)
......@@ -6,7 +6,7 @@
[directories]
# Uncomment to override the default basedir in setupext.py.
# This can be a single directory or a space-delimited list of directories.
basedirlist = @CMAKE_BINARY_DIR@/install
basedirlist = @INSTALL_DIR@
[status]
# To suppress display of the dependencies and their versions
......
......@@ -79,6 +79,12 @@ if (matplotlib_ENABLED)
DESTINATION "bin/Lib/site-packages"
USE_SOURCE_PERMISSIONS
COMPONENT ParaView)
# matplotlib needs these libraries, which are copied with a new name
# during its patch step...
install(FILES "${install_location}/lib/z.lib" "${install_location}/lib/png.lib"
DESTINATION "bin/Lib/"
USE_SOURCE_PERMISSIONS
COMPONENT ParaView)
endif()
if (qt_ENABLED AND NOT USE_SYSTEM_qt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment