Commit 745c5a6d authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Adding lots of customizations.

parent 96dd5e28
......@@ -29,6 +29,21 @@ function (PVExternalProject_Add name)
# check if we have a BUILD_COMMAND or CONFIGURE_COMMAND.
get_property(has_build_command TARGET pv-${name}
PROPERTY _EP_BUILD_COMMAND SET)
if(NOT has_build_command)
# if no BUILD_COMMAND was specified, then the default build cmd is going to
# be used, but then too we want to environment to be setup correctly. So we
# obtain the default build command.
_ep_get_build_command(pv-${name} BUILD cmd)
if("${cmd}" MATCHES "^\\$\\(MAKE\\)")
# GNU make recognizes the string "$(MAKE)" as recursive make, so
# ensure that it appears directly in the makefile.
string(REGEX REPLACE "^\\$\\(MAKE\\)" "${CMAKE_MAKE_PROGRAM}" cmd "${cmd}")
endif()
set_property(TARGET pv-${name} PROPERTY _EP_BUILD_COMMAND "${cmd}")
set (has_build_command 1)
endif()
get_property(has_configure_command TARGET pv-${name}
PROPERTY _EP_CONFIGURE_COMMAND SET)
......@@ -72,7 +87,8 @@ function (PVExternalProject_Add name)
_ep_replace_location_tags(${name} step_command)
configure_file(${CMAKE_CURRENT_LIST_DIR}/pep_configure.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/pv-${name}-configure.cmake
@ONLY)
@ONLY
)
endif()
if (has_build_command)
......
include(ExternalProject)
include(PVExternalProject)
include(CMakeParseArguments)
function(add_project name)
include("${name}")
cmake_parse_arguments(arg "REQUIRED;DEFAULT_OFF" "" "DEPENDS" ${ARGN})
string(TOUPPER ${name} UNAME)
if (arg_REQUIRED)
set(ENABLE_${UNAME} ON)
else()
if (NOT arg_DEFAULT_OFF)
option(ENABLE_${UNAME} "Enable sub-project '${name}'" ON)
else()
option(ENABLE_${UNAME} "Enable sub-project '${name}'" OFF)
endif()
mark_as_advanced(ENABLE_${UNAME})
endif()
if (ENABLE_${UNAME})
# verify each of the required dependencies is enabled.
foreach (required_dependency IN LISTS arg_DEPENDS)
string (TOUPPER ${required_dependency} UREQUIRED_DEPENDENCY)
if (NOT ENABLE_${UREQUIRED_DEPENDENCY})
message(WARNING
"${name} needs ${required_dependency} which is OFF, however."
"Ignoring ENABLE_${UNAME}.")
set (ENABLE_${UNAME} OFF)
break()
endif()
endforeach()
endif()
if (ENABLE_${UNAME})
include("${name}")
else ()
# add dummy target to dependencies work even with subproject is disabled.
add_custom_target(${name})
SET (NO_${UNAME} TRUE)
endif()
endfunction()
function(add_external_project name)
set (cmake_params)
foreach (flag CMAKE_BUILD_TYPE
CMAKE_C_COMPILER
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_COMPILER
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if (${${flag}})
set (cmake_params ${cmake_params} -D${flag}:STRING=${${flag}})
endif()
endforeach()
PVExternalProject_Add(${name} ${ARGN}
PREFIX ${name}
DOWNLOAD_DIR ${download_location}
INSTALL_DIR ${install_location}
PROCESS_ENVIRONMENT
LDFLAGS "${ldflags}"
CPPFLAGS "${cppflags}"
CXXFLAGS "${cxxflags}"
CFLAGS "${cflags}"
LD_LIBRARY_PATH "${ld_library_path}"
CMAKE_PREFIX_PATH "${prefix_path}"
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${prefix_path}
-DCMAKE_PREFIX_PATH:PATH=${prefix_path}
-DCMAKE_C_FLAGS:STRING=${cflags}
-DCMAKE_CXX_FLAGS:STRING=${cppflags}
-DCMAKE_SHARED_LINKER_FLAGS:STRING=${ldflags}
${cmake_params}
)
endfunction()
ExternalProject_Add(boost
PREFIX boost
add_external_project(boost
DEPENDS zlib
URL "http://www.vtk.org/files/support/boost-1.45.0-cmake.tar.gz"
URL_MD5 1e506d26d8a74fa46050ab0ce19101cd
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CMAKE_ARGS
-DCMAKE_PREFIX_PATH:PATH=${internal_install_root}
-DCMAKE_INSTALL_PREFIX:PATH=${internal_install_root}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DBUILD_VERSIONED:BOOL=OFF
-DENABLE_STATIC:BOOL=OFF
-DINSTALL_VERSIONED:BOOL=OFF
-DPNG_TESTS:BOOL=OFF
-DWINMANGLE_LIBNAMES:BOOL=ON
-DWITH_BZIP2:BOOL=OFF
-DWITH_DOXYGEN:BOOL=OFF
-DWITH_EXPAT:BOOL=OFF
-DWITH_ICU:BOOL=OFF
-DWITH_MPI:BOOL=OFF
-DWITH_PYTHON:BOOL=OFF
-DWITH_XSLTPROC:BOLL=OFF
)
ExternalProject_Add(
add_external_project(
cgns
PREFIX cgns
DEPENDS zlib hdf5
URL "http://paraview.org/files/misc/cgnslib_2.5-5.tar.gz"
URL_MD5 ae2a2e79b99d41c63e5ed5f661f70fd9
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${internal_install_root}
--prefix=<INSTALL_DIR>
--enable-shared=all
--with-hdf5=${internal_install_root}
--with-szip=${internal_install_root}/lib/libsz.so
--with-hdf5=<INSTALL_DIR>
--with-szip=<INSTALL_DIR>/lib/libsz.so
--with-zlib
--with-fortran=no
--enable-64bit
......
ExternalProject_Add(
add_external_project(
ffmpeg
PREFIX ffmpeg
DEPENDS zlib
URL "http://ffmpeg.org/releases/ffmpeg-0.6.5.tar.gz"
URL_MD5 451054dae3b3d33a86c2c48bd12d56e7
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${internal_install_root}
--prefix=<INSTALL_DIR>
--disable-avdevice
--disable-bzlib
--disable-decoders
......@@ -17,7 +15,7 @@ ExternalProject_Add(
--disable-network
--disable-static
--enable-shared
--extra-cflags=${cppflags}
--extra-ldflags=${ldflags}
# --extra-cflags=${cppflags}
# --extra-ldflags=${ldflags}
BUILD_IN_SOURCE 1
)
ExternalProject_Add(
add_external_project(
fontconfig
PREFIX fontconfig
DEPENDS freetype
DEPENDS freetype libxml2
URL "http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.8.0.tar.gz"
URL_MD5 77e15a92006ddc2adbb06f840d591c0e
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${internal_install_root}
--prefix=<INSTALL_DIR>
--disable-docs
--enable-libxml2
--enable-static=no
LDFLAGS=${ldflags}
CPPFLAGS=${cppflags}
CFLAGS=${cppflags}
PROCESS_ENVIRONMENT
LIBXML2_CFLAGS -I<INSTALL_DIR>/include/libxml2
LIBXML2_LIBS -lxml2
)
ExternalProject_Add(
add_external_project(
freetype
PREFIX freetype
DEPENDS zlib
URL http://download.savannah.gnu.org/releases/freetype/freetype-2.4.8.tar.gz
URL_MD5 5d82aaa9a4abc0ebbd592783208d9c76
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${internal_install_root}
--prefix=<INSTALL_DIR>
--enable-static=no
--with-sysroot=${internal_install_root}
LDFLAGS=${ldflags}
CPPFLAGS=${cppflags}
CFLAGS=${cppflags}
--with-sysroot=<INSTALL_DIR>
)
ExternalProject_Add(
add_external_project(
hdf5
PREFIX hdf5
DEPENDS zlib szip
URL "http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.8.tar.gz"
URL_MD5 1196e668f5592bfb50d1de162eb16cff
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CMAKE_ARGS
-DCMAKE_PREFIX_PATH:PATH=${internal_install_root}
-DCMAKE_INSTALL_PREFIX:PATH=${internal_install_root}
-DBUILD_SHARED_LIBS:BOOL=TRUE
-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=TRUE
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=TRUE
-DHDF5_ENABLE_SZIP_ENCODING:BOOL=TRUE
-DSZIP_LIBRARY:FILEPATH=${internal_install_root}/lib/libsz.so
-DSZIP_INCLUDE_DIR:FILEPATH=${internal_install_root}/include
-DSZIP_LIBRARY:FILEPATH=<INSTALL_DIR>/lib/libsz.so
-DSZIP_INCLUDE_DIR:FILEPATH=<INSTALL_DIR>/include
)
ExternalProject_Add(
add_external_project(
libxml2
PREFIX libxml2
URL "ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz"
URL_MD5 8127a65e8c3b08856093099b52599c86
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${internal_install_root}
--prefix=<INSTALL_DIR>
--enable-shared
--enable-static=no
LDFLAGS=${ldflags}
CPPFLAGS=${cppflags}
CFLAGS=${cppflags}
BUILD_IN_SOURCE 1
)
add_external_project(
manta
DEPENDS libxml2 zlib
URL "http://paraview.org/files/misc/manta-r2439.tar.gz"
URL_MD5 fbf4107fe2f6d7e8a5ae3dda71805bdc
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DMANTA_ENABLE_X11:BOOL=OFF
-DSCENE_0:BOOL=OFF
-DSCENE_AREA_LIGHT:BOOL=OFF
-DSCENE_BEACH:BOOL=OFF
-DSCENE_COMPLEXITYTEST:BOOL=OFF
-DSCENE_CUBE_WORLD:BOOL=OFF
-DSCENE_EXTERNAL_OBJECT:BOOL=OFF
-DSCENE_FENCE:BOOL=OFF
-DSCENE_GALILEO:BOOL=OFF
-DSCENE_GRIDISOVOL:BOOL=OFF
-DSCENE_HDRI:BOOL=OFF
-DSCENE_MACBETH:BOOL=OFF
-DSCENE_OCTISOVOL:BOOL=OFF
-DSCENE_PRIMTEST:BOOL=OFF
-DSCENE_SOFT_SHADOW:BOOL=OFF
-DSCENE_TEAPOT_ROOM:BOOL=OFF
-DSCENE_TRIANGLESCENEVIEWER:BOOL=OFF
-DSCENE_TYLENOL:BOOL=OFF
-DSCENE_VALUE_COLORMAP:BOOL=OFF
-DSCENE_VORPAL:BOOL=OFF
)
ExternalProject_Add(numpy
PREFIX numpy
add_external_project(numpy
DEPENDS python
URL "http://fixme/numpy-1.6.1.tar.gz"
URL_MD5 2bce18c08fc4fce461656f0f4dd9103e
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CONFIGURE_COMMAND ""
CONFIGURE_COMMAND "pwd"
INSTALL_COMMAND "pwd"
BUILD_IN_SOURCE 1
BUILD_COMMAND
${CMAKE_COMMAND}
-DPREFIX:PATH=${internal_install_root}
-DSOURCE_DIR:PATH=<SOURCE_DIR>
-P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/numpy.install
INSTALL_COMMAND ""
BUILD_COMMAND
<INSTALL_DIR>/bin/python setup.py install --prefix=<INSTALL_DIR>
)
ExternalProject_Add(paraview
PREFIX paraview
DEPENDS zlib png python freetype hdf5 silo cgns ffmpeg libxml2 qt numpy boost
set (build_qt_gui)
if (${ENABLE_QT} AND NOT ${PV_COMMAND_LINE_TOOLS_ONLY})
set (build_qt_gui TRUE)
endif()
add_external_project(paraview
DEPENDS zlib png python freetype hdf5 silo cgns ffmpeg libxml2 qt numpy boost manta
GIT_REPOSITORY git://paraview.org/ParaView.git
GIT_TAG master
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=${internal_install_root}
-DCMAKE_PREFIX_PATH:PATH=${internal_install_root}
-DPARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator:BOOL=ON
-DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=ON
-DPARAVIEW_ENABLE_PYTHON:BOOL=ON
-DPARAVIEW_BUILD_PLUGIN_Manta:BOOL=${ENABLE_MANTA}
-DPARAVIEW_BUILD_QT_GUI:BOOL=${build_qt_gui}
-DPARAVIEW_ENABLE_PYTHON:BOOL=${ENABLE_PYTHON}
-DPARAVIEW_USE_VISITBRIDGE:BOOL=ON
-DVISIT_BUILD_READER_CGNS:BOOL=ON
-DVISIT_BUILD_READER_Silo:BOOL=ON
-DVTK_USE_BOOST:BOOL=ON
-DVTK_USE_FFMPEG_ENCODER:BOOL=ON
-DVTK_USE_SYSTEM_FREETYPE:BOOL=ON
-DVTK_USE_SYSTEM_HDF5:BOOL=ON
-DVTK_USE_SYSTEM_LIBXML2:BOOL=ON
-DVTK_USE_SYSTEM_PNG:BOOL=ON
-DVTK_USE_SYSTEM_ZLIB:BOOL=ON
# we are doing this since VTK_USE_SYSTEM_HDF5 doesn't seem set the include
# paths for HDF5 correctly.
-DCMAKE_CXX_FLAGS:STRING=${cppflags}
-DCMAKE_C_FLAGS:STRING=${cppflags}
-DVISIT_BUILD_READER_CGNS:BOOL=${ENABLE_CGNS}
-DVISIT_BUILD_READER_Silo:BOOL=${ENABLE_SILO}
-DVTK_USE_BOOST:BOOL=${ENABLE_BOOST}
-DVTK_USE_FFMPEG_ENCODER:BOOL=${ENABLE_FFMPEG}
-DVTK_USE_QT:BOOL=${ENABLE_QT}
-DVTK_USE_SYSTEM_FREETYPE:BOOL=${ENABLE_FREETYPE}
-DVTK_USE_SYSTEM_HDF5:BOOL=${ENABLE_HDF5}
-DVTK_USE_SYSTEM_LIBXML2:BOOL=${ENABLE_LIBXML2}
-DVTK_USE_SYSTEM_PNG:BOOL=${ENABLE_PNG}
-DVTK_USE_SYSTEM_ZLIB:BOOL=${ENABLE_ZLIB}
INSTALL_COMMAND ""
)
ExternalProject_Add(
add_external_project(
png
DEPENDS zlib
PREFIX png
URL "ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.4.8.tar.gz"
URL_MD5 49c6e05be5fa88ed815945d7ca7d4aa9
# Can't use 1.5 since Qt 4.6.* is making use of deprecated API.
# URL "ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.7.tar.gz"
# URL_MD5 944b56a84b65d94054cc73d7ff965de8
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${internal_install_root}
-DPNG_TESTS:BOOL=OFF
-DCMAKE_PREFIX_PATH:PATH=${internal_install_root}
)
ExternalProject_Add(
add_external_project(
python
DEPENDS zlib png
PREFIX python
URL "http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz"
URL_MD5 "0ddfe265f1b3d0a8c2459f5bf66894c7"
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${internal_install_root}
--prefix=<INSTALL_DIR>
--enable-unicode
--enable-shared
LDFLAGS=${ldflags}
CPPFLAGS=${cppflags}
CFLAGS=${cppflags}
)
ExternalProject_Add(
add_external_project(
qt
PREFIX qt
DEPENDS zlib png freetype fontconfig
URL "ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.4.tar.gz"
URL_MD5 8ac880cc07a130c39607b65efd5e1421
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CONFIGURE_COMMAND <SOURCE_DIR>/configure
-prefix ${internal_install_root}
-prefix <INSTALL_DIR>
-no-audio-backend
-no-dbus
-nomake demos
......@@ -22,8 +20,8 @@ ExternalProject_Add(
-system-zlib
-webkit
-xmlpatterns
-I ${internal_install_root}/include
-I ${internal_install_root}/include/freetype2
-I ${internal_install_root}/include/fontconfig
-L ${internal_install_root}/lib
-I <INSTALL_DIR>/include
-I <INSTALL_DIR>/include/freetype2
-I <INSTALL_DIR>/include/fontconfig
-L <INSTALL_DIR>/lib
)
ExternalProject_Add(
add_external_project(
silo
PREFIX silo
DEPENDS zlib hdf5
URL "http://paraview.org/files/misc/silo-4.8-bsd.tar.gz"
URL_MD5 03e27c977f34dc6e9a5f3864153c24fe
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=${internal_install_root}
--prefix=<INSTALL_DIR>
--enable-shared=yes
--enable-static=no
--enable-fortran=no
--enable-browser=no
--enable-silex=no
--with-szlib=${internal_install_root}
--with-hdf5=${internal_install_root}/include,${internal_install_root}/lib
LDFLAGS=${ldflags}
CPPFLAGS=${cppflags}
CFLAGS=${cppflags}
--with-szlib=<INSTALL_DIR>
--with-hdf5=<INSTALL_DIR>/include,<INSTALL_DIR>/lib
)
ExternalProject_Add(
add_external_project(
szip
PREFIX szip
URL "http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz"
URL_MD5 902f831bcefb69c6b635374424acbead
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--enable-encoding
--prefix=${internal_install_root}
LDFLAGS=${ldflags}
CPPFLAGS=${cppflags}
CFLAGS=${cppflags}
--prefix=<INSTALL_DIR>
)
# zlib supports cmake. the only problem is that we need to remove the zconf.h
# file.
ExternalProject_Add(
add_external_project(
zlib
PREFIX zlib
URL "http://zlib.net/zlib-1.2.5.tar.gz"
URL_MD5 c735eab2d659a96e5a594c9e8541ad63
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads
# remove the zconf.h as a patch step.
PATCH_COMMAND cmake -E remove -f <SOURCE_DIR>/zconf.h
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${internal_install_root}
-DCMAKE_PREFIX_PATH=${internal_install_root}
PATCH_COMMAND ${CMAKE_COMMAND} -E remove -f <SOURCE_DIR>/zconf.h
)
......@@ -4,25 +4,45 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
include (ParaViewModules)
set (internal_install_root "${CMAKE_CURRENT_BINARY_DIR}/install")
set (ldflags "$ENV{LDFLAGS} -L${internal_install_root}/lib")
set (cppflags "$ENV{CPPFLAGS} -I${internal_install_root}/include")
set (install_location "${CMAKE_CURRENT_BINARY_DIR}/install")
set (download_location "${CMAKE_CURRENT_BINARY_DIR}/downloads")
set (ldflags "$ENV{LDFLAGS} -L${install_location}/lib")
set (cppflags "$ENV{CPPFLAGS} -I${install_location}/include")
set (cxxflags "$ENV{CXXFLAGS} -I${install_location}/include")
set (cflags "$ENV{CFLAGS} -I${install_location}/include")
set (ld_library_path "${install_location}/lib:$ENV{LD_LIBRARY_PATH}")
set (prefix_path "${install_location}")
string (STRIP "${ldflags}" ldflags)
string (STRIP "${cppflags}" cppflags)
string (STRIP "${cxxflags}" cxxflags)
string (STRIP "${cflags}" cflags)
# Top-level options. These must be limited to a commonly used subset with
# default values being used for building ParaView binaries.
option(PV_COMMAND_LINE_TOOLS_ONLY
"Turn this on to build command lines tools alone." OFF)
# If one wants to build command line tools w/o python or Qt, they should simply
# turn off the sub-project's ENABLE_* flags.
add_project(zlib)
add_project(png)
add_project(python)
add_project(freetype)
add_project(szip)
add_project(hdf5)
add_project(silo)
add_project(cgns)
add_project(silo DEPENDS hdf5)
add_project(cgns DEPENDS hdf5)
add_project(ffmpeg)
add_project(libxml2)
add_project(fontconfig)
add_project(fontconfig DEPENDS libxml2)
add_project(qt)
add_project(numpy)
add_project(python)
add_project(numpy DEPENDS python)
add_project(boost)
add_project(manta)
# REMEMBER to tell VTK/ParaView to use VTK_SYSTEM_* for the
# libraries we've built here.
add_project(paraview)
add_project(paraview REQUIRED)
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