Commit 79d83ecc authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Working on an updated infrastructure for superbuilds.

parent d06a5721
......@@ -2,40 +2,167 @@ include(PVExternalProject)
include(CMakeParseArguments)
#------------------------------------------------------------------------------
# Function to provide an option only if a set of other variables are ON.
# Example invocation:
#
# dependent_option(USE_FOO "Use Foo" ON "USE_BAR;USE_ZOT" OFF)
#
# If both USE_BAR and USE_ZOT are true, this provides an option called
# USE_FOO that defaults to ON. Otherwise, it sets USE_FOO to OFF. If
# the status of USE_BAR or USE_ZOT ever changes, any value for the
# USE_FOO option is saved so that when the option is re-enabled it
# retains its old value.
#
function(dependent_option option doc default depends force)
if (${option}_ISSET MATCHES "^${option}_ISSET$")
set(${option}_AVAILABLE 1)
foreach (d ${depends})
if (NOT ${d})
set(${option}_AVAILABLE 0)
# Macro to be used to register versions for any module. This makes it easier to
# consolidate versions for all modules in a single file, if needed.
macro(add_revision name)
set(${name}_revision "${ARGN}")
endmacro()
#------------------------------------------------------------------------------
macro(add_external_project _name)
project_check_name(${_name})
set(cm-project ${_name})
set(${cm-project}_DECLARED 1)
if (build-projects)
set (arguments)
set (optional_depends)
set (accumulate FALSE)
foreach(arg ${ARGN})
if ("${arg}" MATCHES "^DEPENDS_OPTIONAL$")
set (accumulate TRUE)
elseif ("${arg}" MATCHES "${_ep_keywords_ExternalProject_Add}")
set (accumulate FALSE)
elseif (accumulate)
list(APPEND optional_depends "${arg}")
endif()
if (NOT accumulate)
list(APPEND arguments "${arg}")
endif()
endforeach()
foreach (op_dep ${optional_depends})
if (${op_dep}_ENABLED)
list (APPEND arguments DEPENDS ${op_dep})
endif()
endforeach()
set(${cm-project}_ARGUMENTS "${arguments}")
if (${option}_AVAILABLE)
option(${option} "${doc}" "${default}")
set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
else ()
if(NOT ${option} MATCHES "^${option}$")
set(${option} "${${option}}" CACHE INTERNAL "${doc}")
endif ()
set (${option} ${force})
unset(arguments)
unset(optional_depends)
unset(accumulate)
else()
set(${cm-project}_DEPENDS "")
set(${cm-project}_ARGUMENTS "")
set(${cm-project}_NEEDED_BY "")
set(${cm-project}_CAN_USE_SYSTEM 0)
set (doing "")
foreach(arg ${ARGN})
if ("${arg}" MATCHES "^DEPENDS$")
set (doing "DEPENDS")
elseif ("${arg}" MATCHES "^DEPENDS_OPTIONAL$")
set (doing "DEPENDS_OPTIONAL")
elseif ("${arg}" MATCHES "${_ep_keywords_ExternalProject_Add}")
set (doing "")
elseif (doing STREQUAL "DEPENDS")
list(APPEND ${cm-project}_DEPENDS "${arg}")
elseif ((doing STREQUAL "DEPENDS_OPTIONAL") AND ENABLE_${arg})
list(APPEND ${cm-project}_DEPENDS "${arg}")
endif()
endforeach()
option(ENABLE_${cm-project} "Request to build project ${cm-project}" OFF)
set_property(CACHE ENABLE_${cm-project} PROPERTY TYPE BOOL)
list(APPEND CM_PROJECTS_ALL "${cm-project}")
if (USE_SYSTEM_${cm-project})
set(${cm-project}_DEPENDS "")
endif()
endif()
endmacro()
#------------------------------------------------------------------------------
# similar to add_external_project, except provides the user with an option to
# use-system installation of the project.
macro(add_external_project_or_use_system _name)
if (build-projects)
add_external_project(${_name} ${ARGN})
else()
set(${option} "${${option}_ISSET}")
endif()
endfunction()
add_external_project(${_name} ${ARGN})
set(${_name}_CAN_USE_SYSTEM 1)
# add an option an hide it by default. We'll expose it to the user if needed.
option(USE_SYSTEM_${_name} "Use system ${_name}" OFF)
set_property(CACHE USE_SYSTEM_${_name} PROPERTY TYPE INTERNAL)
endif()
endmacro()
#------------------------------------------------------------------------------
macro(process_dependencies)
set (CM_PROJECTS_ENABLED "")
foreach(cm-project IN LISTS CM_PROJECTS_ALL)
set(${cm-project}_ENABLED FALSE)
if (ENABLE_${cm-project})
list(APPEND CM_PROJECTS_ENABLED ${cm-project})
endif()
endforeach()
list(SORT CM_PROJECTS_ENABLED) # Deterministic order.
# Order list to satisfy dependencies. We don't include the use-system
# libraries in the depedency walk.
include(TopologicalSort)
topological_sort(CM_PROJECTS_ENABLED "" _DEPENDS)
# build information about what project needs what.
foreach (cm-project IN LISTS CM_PROJECTS_ENABLED)
enable_project(${cm-project} "")
foreach (dependency IN LISTS ${cm-project}_DEPENDS)
enable_project(${dependency} "${cm-project}")
endforeach()
endforeach()
foreach (cm-project IN LISTS CM_PROJECTS_ENABLED)
if (ENABLE_${cm-project})
message(STATUS "Enabling ${cm-project} as requested.")
set_property(CACHE ENABLE_${cm-project} PROPERTY TYPE BOOL)
else()
list(SORT ${cm-project}_NEEDED_BY)
list(REMOVE_DUPLICATES ${cm-project}_NEEDED_BY)
message(STATUS "Enabling ${cm-project} since needed by: ${${cm-project}_NEEDED_BY}")
set_property(CACHE ENABLE_${cm-project} PROPERTY TYPE INTERNAL)
endif()
endforeach()
message(STATUS "PROJECTS_ENABLED ${CM_PROJECTS_ENABLED}")
set (build-projects 1)
foreach (cm-project IN LISTS CM_PROJECTS_ENABLED)
if (${cm-project}_CAN_USE_SYSTEM)
# for every enabled project that can use system, expose the option to the
# user.
set_property(CACHE USE_SYSTEM_${cm-project} PROPERTY TYPE BOOL)
if (USE_SYSTEM_${cm-project})
add_dummy_external_project(${cm-project})
include(${cm-project}.use.system OPTIONAL RESULT_VARIABLE rv)
if (rv STREQUAL "NOTFOUND")
message(AUTHOR_WARNING "${cm-project}.use.system not found!!!")
endif()
else()
include(${cm-project})
add_external_project_internal(${cm-project} ${${cm-project}_ARGUMENTS})
endif()
else()
include(${cm-project})
add_external_project_internal(${cm-project} ${${cm-project}_ARGUMENTS})
endif()
endforeach()
unset (build-projects)
endmacro()
#------------------------------------------------------------------------------
macro(enable_project name needed-by)
set (${name}_ENABLED TRUE CACHE INTERNAL "" FORCE)
list (APPEND ${name}_NEEDED_BY "${needed-by}")
endmacro()
#------------------------------------------------------------------------------
# internal macro to validate project names.
macro(project_check_name _name)
if( NOT "${_name}" MATCHES "^[a-zA-Z][a-zA-Z0-9]*$")
message(FATAL_ERROR "Invalid project name: ${_name}")
endif()
endmacro()
#******************************************************************************
#------------------------------------------------------------------------------
# add dummy target to dependencies work even with subproject is disabled.
# this code may need to change if ExternalProject.cmake changes.
......@@ -49,6 +176,18 @@ function(__create_required_targets name)
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${name}-done)
endfunction()
function(add_dummy_external_project name)
ExternalProject_Add(${name}
DOWNLOAD_COMMAND ""
SOURCE_DIR ""
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
endfunction()
#------------------------------------------------------------------------------
# Add a project to this "superbuild". For every enabled project, this function
# tries to import a cmake file named ${name}.cmake which should contain the
......@@ -72,7 +211,6 @@ function(add_project name)
else()
option(ENABLE_${UNAME} "Enable sub-project '${name}'" OFF)
endif()
mark_as_advanced(ENABLE_${UNAME})
endif()
if (ENABLE_${UNAME})
......@@ -100,7 +238,19 @@ function(add_project name)
endif()
endfunction()
function(add_external_project name)
macro(get_project_depends _name _prefix)
if (NOT ${_prefix}_${_name}_done)
set(${_prefix}_${_name}_done 1)
foreach (dep ${${_name}_DEPENDS})
if (NOT ${_prefix}_${dep}_done)
list(APPEND ${_prefix}_DEPENDS ${dep})
get_project_depends(${dep} ${_prefix})
endif()
endforeach()
endif()
endmacro()
function(add_external_project_internal name)
set (cmake_params)
foreach (flag CMAKE_BUILD_TYPE
CMAKE_C_FLAGS_DEBUG
......@@ -116,6 +266,18 @@ function(add_external_project name)
endif()
endforeach()
#get extra-cmake args from every dependent project, if any.
set(arg_DEPENDS)
get_project_depends(${name} arg)
foreach(dependency IN LISTS arg_DEPENDS)
get_property(args TARGET ${dependency} PROPERTY CMAKE_ARGS)
list(APPEND cmake_params ${args})
endforeach()
if (name STREQUAL "paraview")
message("${ARGN}")
endif()
PVExternalProject_Add(${name} ${ARGN}
PREFIX ${name}
DOWNLOAD_DIR ${download_location}
......@@ -141,11 +303,19 @@ function(add_external_project name)
)
endfunction()
function(add_revision name)
set(${name}_revision "${ARGN}" CACHE INTERNAL
"Revision for ${name}")
endfunction()
function(add_system_project name)
__create_required_targets(${name})
endfunction()
macro(add_extra_cmake_args)
if (build-projects)
if (NOT cm-project)
message(AUTHOR_WARNING "add_extra_cmake_args called an incorrect stage.")
return()
endif()
set_property(TARGET ${cm-project} APPEND PROPERTY CMAKE_ARGS ${ARGN})
else()
# nothing to do.
endif()
endmacro()
# Perform a reverse topological sort on the given LIST.
#
# topological_sort(my_list "MY_" "_EDGES")
#
# LIST is the name of a variable containing a list of elements to be
# sorted in reverse topological order. Each element in the list has a
# set of outgoing edges (for example, those other list elements that
# it depends on). In the resulting reverse topological ordering
# (written back into the variable named LIST), an element will come
# later in the list than any of the elements that can be reached by
# following its outgoing edges and the outgoing edges of any vertices
# they target, recursively. Thus, if the edges represent dependencies
# on build targets, for example, the reverse topological ordering is
# the order in which one would build those targets.
#
# For each element E in this list, the edges for E are contained in
# the variable named ${PREFIX}${E}${SUFFIX}. If no such variable
# exists, then it is assumed that there are no edges. For example, if
# my_list contains a, b, and c, one could provide a dependency graph
# using the following variables:
#
# MY_A_EDGES b
# MY_B_EDGES
# MY_C_EDGES a b
#
# With the involcation of topological_sort shown above and these
# variables, the resulting reverse topological ordering will be b, a,
# c.
##############################################################################
# Modified from Boost Utilities
#
# Copyright 2010 Kitware, Inc.
##############################################################################
# Copyright 2007 Douglas Gregor <doug.gregor@gmail.com>
# Copyright 2007 Troy Straszheim
#
# Distributed under the Boost Software License, Version 1.0.
##############################################################################
# Boost Software License - Version 1.0 - August 17th, 2003
#
# Permission is hereby granted, free of charge, to any person or organization
# obtaining a copy of the software and accompanying documentation covered by
# this license (the "Software") to use, reproduce, display, distribute,
# execute, and transmit the Software, and to prepare derivative works of the
# Software, and to permit third-parties to whom the Software is furnished to
# do so, all subject to the following:
#
# The copyright notices in the Software and this entire statement, including
# the above license grant, this restriction and the following disclaimer,
# must be included in all copies of the Software, in whole or in part, and
# all derivative works of the Software, unless such copies or derivative
# works are solely in the form of machine-executable object code generated by
# a source language processor.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
##############################################################################
function(topological_sort LIST PREFIX SUFFIX)
# Clear the stack and output variable
set(VERTICES "${${LIST}}")
set(STACK)
set(${LIST})
# Loop over all of the vertices, starting the topological sort from
# each one.
foreach(VERTEX ${VERTICES})
# If we haven't already processed this vertex, start a depth-first
# search from where.
if (NOT FOUND_${VERTEX})
# Push this vertex onto the stack with all of its outgoing edges
string(REPLACE ";" " " NEW_ELEMENT
"${VERTEX};${${PREFIX}${VERTEX}${SUFFIX}}")
list(APPEND STACK ${NEW_ELEMENT})
# We've now seen this vertex
set(FOUND_${VERTEX} TRUE)
# While the depth-first search stack is not empty
list(LENGTH STACK STACK_LENGTH)
while(STACK_LENGTH GREATER 0)
# Remove the vertex and its remaining out-edges from the top
# of the stack
list(GET STACK -1 OUT_EDGES)
list(REMOVE_AT STACK -1)
# Get the source vertex and the list of out-edges
separate_arguments(OUT_EDGES)
list(GET OUT_EDGES 0 SOURCE)
list(REMOVE_AT OUT_EDGES 0)
# While there are still out-edges remaining
list(LENGTH OUT_EDGES OUT_DEGREE)
while (OUT_DEGREE GREATER 0)
# Pull off the first outgoing edge
list(GET OUT_EDGES 0 TARGET)
list(REMOVE_AT OUT_EDGES 0)
if (NOT FOUND_${TARGET})
# We have not seen the target before, so we will traverse
# its outgoing edges before coming back to our
# source. This is the key to the depth-first traversal.
# We've now seen this vertex
set(FOUND_${TARGET} TRUE)
# Push the remaining edges for the current vertex onto the
# stack
string(REPLACE ";" " " NEW_ELEMENT
"${SOURCE};${OUT_EDGES}")
list(APPEND STACK ${NEW_ELEMENT})
# Setup the new source and outgoing edges
set(SOURCE ${TARGET})
set(OUT_EDGES
${${PREFIX}${SOURCE}${SUFFIX}})
endif(NOT FOUND_${TARGET})
list(LENGTH OUT_EDGES OUT_DEGREE)
endwhile (OUT_DEGREE GREATER 0)
# We have finished all of the outgoing edges for
# SOURCE; add it to the resulting list.
list(APPEND ${LIST} ${SOURCE})
# Check the length of the stack
list(LENGTH STACK STACK_LENGTH)
endwhile(STACK_LENGTH GREATER 0)
endif (NOT FOUND_${VERTEX})
endforeach(VERTEX)
set(${LIST} ${${LIST}} PARENT_SCOPE)
endfunction(topological_sort)
# we support using system mpi.
dependent_option(USE_SYSTEM_MPI
"Turn ON to use installed MPI intead of building from source." OFF
"ENABLE_MPICH2" OFF)
#dependent_option(USE_SYSTEM_MPI
# "Turn ON to use installed MPI intead of building from source." OFF
# "ENABLE_MPICH2" OFF)
if (USE_SYSTEM_MPI)
find_package(MPI)
# Important variables are (where lang == C|CXX)
# MPI_<lang>_FOUND
# MPI_<lang>_COMPILER
# MPI_<lang>_COMPILE_FLAGS
# MPI_<lang>_INCLUDE_PATH
# MPI_<lang>_LINK_FLAGS
# MPI_<lang>_LIBRARIES
# MPIEXEC
# MPIEXEC_NUMPROC_FLAG
# MPIEXEC_PREFLAGS
# MPIEXEC_POSTFLAGS
# this must be called since we're not using add_external_project().
add_system_project(mpich2)
else ()
add_external_project(
mpich2
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--enable-shared
--disable-static
--disable-f77
--disable-fc
# PVExternalProject_Add sets up an parallel build, by default.
# that doesn't work for the verion of MPICH2 we're using.
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_IN_SOURCE 1
)
endif()
#if (USE_SYSTEM_MPI)
# find_package(MPI)
# # Important variables are (where lang == C|CXX)
# # MPI_<lang>_FOUND
# # MPI_<lang>_COMPILER
# # MPI_<lang>_COMPILE_FLAGS
# # MPI_<lang>_INCLUDE_PATH
# # MPI_<lang>_LINK_FLAGS
# # MPI_<lang>_LIBRARIES
# # MPIEXEC
# # MPIEXEC_NUMPROC_FLAG
# # MPIEXEC_PREFLAGS
# # MPIEXEC_POSTFLAGS
#
# # this must be called since we're not using add_external_project().
# add_system_project(mpich2)
#else ()
add_external_project_or_use_system(mpich2
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--enable-shared
--disable-static
--disable-f77
--disable-fc
# PVExternalProject_Add sets up an parallel build, by default.
# that doesn't work for the version of MPICH2 we're using.
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
BUILD_IN_SOURCE 1
)
find_package(MPI)
if (MPI_C_FOUND)
add_extra_cmake_args(
-DMPIEXEC:FILEPATH=${MPIEXEC}
-DMPIEXEC_MAX_NUMPROCS:STRING=${MPIEXEC_MAX_NUMPROCS}
-DMPIEXEC_NUMPROC_FLAG:STRING=${MPIEXEC_NUMPROC_FLAG}
-DMPIEXEC_POSTFLAGS:STRING=${MPIEXEC_POSTFLAGS}
-DMPIEXEC_PREFLAGS:STRING=${MPIEXEC_PREFLAGS}
-DMPI_CXX_COMPILER:FILEPATH=${MPI_CXX_COMPILER}
-DMPI_CXX_COMPILE_FLAGS:STRING=${MPI_CXX_COMPILE_FLAGS}
-DMPI_CXX_INCLUDE_PATH:STRING=${MPI_CXX_INCLUDE_PATH}
-DMPI_CXX_LIBRARIES:STRING=${PV_MPI_CXX_LIBRARIES}
-DMPI_CXX_LINK_FLAGS:STRING=${MPI_CXX_LINK_FLAGS}
-DMPI_C_COMPILER:FILEPATH=${MPI_C_COMPILER}
-DMPI_C_COMPILE_FLAGS:STRING=${MPI_C_COMPILE_FLAGS}
-DMPI_C_INCLUDE_PATH:STRING=${MPI_C_INCLUDE_PATH}
-DMPI_C_LIBRARIES:STRING=${PV_MPI_C_LIBRARIES}
-DMPI_C_LINK_FLAGS:STRING=${MPI_C_LINK_FLAGS}
-DMPI_EXTRA_LIBRARY:STRING=${PV_MPI_EXTRA_LIBRARY}
-DMPI_LIBRARY:FILEPATH=${PV_MPI_LIBRARY})
endif()
set (extra_cmake_args)
set (build_qt_gui)
if (${ENABLE_QT} AND NOT ${PV_COMMAND_LINE_TOOLS_ONLY})
set (build_qt_gui TRUE)
else()
set (build_qt_gui FALSE)
endif()
if (ENABLE_PYTHON AND USE_SYSTEM_PYTHON)
# if using system Python, tell ParaView to use the user-specified Python.
list(APPEND extra_cmake_args
-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}
-DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
-DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
)
endif()
if (ENABLE_MANTA)
if (manta_ENABLED)
list (APPEND extra_cmake_args
-DMANTA_BUILD:PATH=${ParaViewSuperBuild_BINARY_DIR}/manta/src/manta-build)
endif()
if (ENABLE_MPICH2 AND USE_SYSTEM_MPI)
set (MPIFIRSTPASS ON)
foreach(lib ${MPI_C_LIBRARIES} )
if (${MPIFIRSTPASS})
set(PV_MPI_C_LIBRARIES ${lib})
set (MPIFIRSTPASS OFF)
else ()
set (PV_MPI_C_LIBRARIES ${PV_MPI_C_LIBRARIES}+${lib})
endif()
endforeach(lib)
set (MPIFIRSTPASS ON)
foreach(lib ${MPI_CXX_LIBRARIES} )
if (${MPIFIRSTPASS})
set(PV_MPI_CXX_LIBRARIES ${lib})
set (MPIFIRSTPASS OFF)
else ()
set (PV_MPI_CXX_LIBRARIES ${PV_MPI_CXX_LIBRARIES}+${lib})
endif()
endforeach(lib)
set (MPIFIRSTPASS ON)
foreach(lib ${MPI_LIBRARY} )
if (${MPIFIRSTPASS})
set(PV_MPI_LIBRARY ${lib})
set (MPIFIRSTPASS OFF)
else ()
set (PV_MPI_LIBRARY ${PV_MPI_LIBRARY}+${lib})
endif()
endforeach(lib)
set (MPIFIRSTPASS ON)
foreach(lib ${MPI_EXTRA_LIBRARY} )
if (${MPIFIRSTPASS})
set(PV_MPI_EXTRA_LIBRARY ${lib})
set (MPIFIRSTPASS OFF)
else ()
set (PV_MPI_EXTRA_LIBRARY ${PV_MPI_EXTRA_LIBRARY}+${lib})
endif()
endforeach(lib)
# if using system MPI, tell ParaView to use the user-specified MPI
list (APPEND extra_cmake_args
-DMPIEXEC:FILEPATH=${MPIEXEC}
-DMPIEXEC_MAX_NUMPROCS:STRING=${MPIEXEC_MAX_NUMPROCS}
-DMPIEXEC_NUMPROC_FLAG:STRING=${MPIEXEC_NUMPROC_FLAG}
-DMPIEXEC_POSTFLAGS:STRING=${MPIEXEC_POSTFLAGS}
-DMPIEXEC_PREFLAGS:STRING=${MPIEXEC_PREFLAGS}
-DMPI_CXX_COMPILER:FILEPATH=${MPI_CXX_COMPILER}
-DMPI_CXX_COMPILE_FLAGS:STRING=${MPI_CXX_COMPILE_FLAGS}
-DMPI_CXX_INCLUDE_PATH:STRING=${MPI_CXX_INCLUDE_PATH}
-DMPI_CXX_LIBRARIES:STRING=${PV_MPI_CXX_LIBRARIES}
-DMPI_CXX_LINK_FLAGS:STRING=${MPI_CXX_LINK_FLAGS}
-DMPI_C_COMPILER:FILEPATH=${MPI_C_COMPILER}
-DMPI_C_COMPILE_FLAGS:STRING=${MPI_C_COMPILE_FLAGS}
-DMPI_C_INCLUDE_PATH:STRING=${MPI_C_INCLUDE_PATH}
-DMPI_C_LIBRARIES:STRING=${PV_MPI_C_LIBRARIES}
-DMPI_C_LINK_FLAGS:STRING=${MPI_C_LINK_FLAGS}
-DMPI_EXTRA_LIBRARY:STRING=${PV_MPI_EXTRA_LIBRARY}
-DMPI_LIBRARY:FILEPATH=${PV_MPI_LIBRARY})
endif ()
if (ENABLE_HDF5)
list (APPEND extra_cmake_args
-DHDF5_C_LIBRARY:PATH=<INSTALL_DIR>/lib/libhdf5.so+<INSTALL_DIR>/lib/libhdf5_hl.so
-DHDF5_hdf5_LIBRARY=<INSTALL_DIR>/lib/libhdf5.so
-DHDF5_hdf5_hl_LIBRARY=<INSTALL_DIR>/lib/libhdf5_hl.so)
endif()
if (ENABLE_QT AND USE_SYSTEM_QT)
list (APPEND extra_cmake_args
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
endif()
add_external_project(paraview
DEPENDS zlib png hdf5 silo cgns ffmpeg libxml2 boost python numpy
mpich2 manta qt
DEPENDS_OPTIONAL
zlib png hdf5 silo cgns ffmpeg libxml2 boost python numpy
mpich2 manta qt
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
-DPARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator:BOOL=ON
-DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting: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_MPI:BOOL=${ENABLE_MPICH2}
-DPARAVIEW_BUILD_PLUGIN_Manta:BOOL=${manta_ENABLED}
-DPARAVIEW_BUILD_QT_GUI:BOOL=${qt_ENABLED}
-DPARAVIEW_ENABLE_PYTHON:BOOL=${python_ENABLED}
-DPARAVIEW_USE_MPI:BOOL=${mpich2_ENABLED}
-DPARAVIEW_USE_VISITBRIDGE:BOOL=ON
-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}
-DVISIT_BUILD_READER_CGNS:BOOL=${cngs_ENABLED}
-DVISIT_BUILD_READER_Silo:BOOL=${silo_ENABLED}
-DVTK_USE_BOOST:BOOL=${boost_ENABLED}
-DVTK_USE_FFMPEG_ENCODER:BOOL=${ffmpeg_ENABLED}
# -DVTK_USE_SYSTEM_FREETYPE:BOOL=${ENABLE_FREETYPE}
-DVTK_USE_SYSTEM_HDF5:BOOL=${hdf5_ENABLED}
# -DVTK_USE_SYSTEM_LIBXML2:BOOL=${ENABLE_LIBXML2}
# -DVTK_USE_SYSTEM_PNG:BOOL=${ENABLE_PNG}
# -DVTK_USE_SYSTEM_ZLIB:BOOL=${ENABLE_ZLIB}
${extra_cmake_args}
......
add_external_project(png
DEPENDS zlib
......
# we support using system python.
dependent_option(USE_SYSTEM_PYTHON
"Turn ON to use installed Python intead of building from source." OFF
"ENABLE_PYTHON" OFF)
if (USE_SYSTEM_PYTHON)
find_package(PythonLibs)
find_package(PythonInterp)
# This will add PYTHON_LIBRARY, PYTHON_EXECUTABLE, PYTHON_INCLUDE_DIR
# variables. User can set/override these to change the Python being used.
# this must be called since we're not using add_external_project().
add_system_project(python)
set (pv_python_executable "${PYTHON_EXECUTABLE}" CACHE INTERNAL "" FORCE)
else ()
add_external_project(
python
DEPENDS zlib png
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--enable-unicode
--enable-shared
)
set (pv_python_executable "${install_location}/bin/python" CACHE INTERNAL "" FORCE)
endif()
add_external_project_or_use_system(python
DEPENDS zlib png
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--enable-unicode
--enable-shared
)
set (pv_python_executable "${install_location}/bin/python" CACHE INTERNAL "" FORCE)
find_package(PythonLibs)
find_package(PythonInterp)
set (pv_python_executable "${PYTHON_EXECUTABLE}" CACHE INTERNAL "" FORCE)
# This will add PYTHON_LIBRARY, PYTHON_EXECUTABLE, PYTHON_INCLUDE_DIR
# variables. User can set/override these to change the Python being used.
add_extra_cmake_args(
-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}
-DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
-DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
)
set (pv_python_executable "${PYTHON_EXECUTABLE}" CACHE INTERNAL "" FORCE)
# we support using system qt.
dependent_option(USE_SYSTEM_QT
"Turn ON to use installed Qt instead of building from source" OFF
"ENABLE_QT" OFF)
if (USE_SYSTEM_QT)
find_package(Qt4)
add_system_project(qt)
else ()
add_project(freetype REQUIRED)
add_project(fontconfig DEPENDS libxml2)
add_external_project(
add_external_project_or_use_system(
qt
DEPENDS zlib png freetype fontconfig
CONFIGURE_COMMAND <SOURCE_DIR>/configure
......@@ -37,8 +25,4 @@ else ()
-L <INSTALL_DIR>/lib
PROCESS_ENVIRONMENT
LD_LIBRARY_PATH "<BINARY_DIR>/lib"
)
endif()
# if qt build fails due to missing QtCLucene, then simply restart make with
# LD_LIBRARY_PATH set to include the <BINARY_DIR>/lib.
)
find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
$ENV{QTDIR}/bin
DOC "The qmake executable for the Qt installation to use")
add_extra_cmake_args(
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})