Commit d1ab1deb authored by David C. Lonie's avatar David C. Lonie Committed by Code Review

Merge topic 'fix_freetype_on_windows' into master

8f6357ab Fix matplotlib compilation on win32.
c9eb3297 Merge remote-tracking branch 'origin/master' into fix_freetype_on_windows
5f0fd5cb Adding support to build freetype on Windows.
parents 0ee6db63 8f6357ab
......@@ -125,6 +125,14 @@ if (WIN32)
find_program(NMAKE_PATH nmake)
mark_as_advanced(DEVENV_PATH NMAKE_PATH)
endif()
# Freetype uses its own build system on win32...
find_program(FTJAM_EXECUTABLE jam)
mark_as_advanced(FTJAM_EXECUTABLE)
if (freetype_ENABLED)
if (NOT FTJAM_EXECUTABLE)
message(FATAL_ERROR "FreeType's 'jam' build tool not found! Download it from http://sourceforge.net/projects/freetype/files/ftjam/2.5.2/ and set FTJAM_EXECUTABLE appropriately.")
endif()
endif()
endif()
#-----------------------------------------------------------------------------
include (ParaViewModules)
......@@ -145,6 +153,7 @@ set (CM_PROJECTS_ALL)
# Some of these allow using system libraries too.
include(boost)
include(cgns)
include(freetype)
include(hdf5)
include(libxml2)
include(manta)
......@@ -159,11 +168,6 @@ include(szip)
include(visitbridge)
include(zlib)
if (UNIX OR APPLE)
# since currently, freetype is not supported in windows. It will be soon.
include(freetype)
endif()
if (UNIX AND NOT APPLE)
include(ffmpeg)
include(fontconfig)
......
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
......
set(ENV{JAM_TOOLSET} VISUALC)
execute_process(COMMAND ${FTJAM_EXECUTABLE}
WORKING_DIRECTORY ${WORKING_DIRECTORY})
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"${SOURCE_DIR}/objs/freetype.lib"
"${INSTALL_DIR}/lib/freetype.lib"
)
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${SOURCE_DIR}/include"
"${INSTALL_DIR}/include/freetype2"
)
add_external_project(
freetype
DEPENDS zlib
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND
${CMAKE_COMMAND}
-DFTJAM_EXECUTABLE:PATH=${FTJAM_EXECUTABLE}
-DWORKING_DIRECTORY:PATH=<SOURCE_DIR>
-P ${SuperBuild_PROJECTS_DIR}/win32/freetype-build.cmake
INSTALL_COMMAND
${CMAKE_COMMAND}
-DSOURCE_DIR:PATH=<SOURCE_DIR>
-DINSTALL_DIR:PATH=<INSTALL_DIR>
-P ${SuperBuild_PROJECTS_DIR}/win32/freetype-install.cmake
)
......@@ -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