...
 
Commits (5)
* -whitespace
......@@ -5,8 +5,12 @@
# This allows you to turn on and off the auto
# update of the (project name)Version.hpp file
if (FALSE) # XXX(kitware): force settings
SET(VERSION_CONTROL_AUTOUPDATE OFF CACHE BOOL "Automaticaly Update The Version")
MARK_AS_ADVANCED(VERSION_CONTROL_AUTOUPDATE)
else ()
set(VERSION_CONTROL_AUTOUPDATE OFF)
endif ()
# We need to make sure we have the header file
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/CMake/VersionSuite)
......
if (FALSE) # XXX(kitware): use VTK's CMake policies
cmake_minimum_required(VERSION 2.8.5)
endif ()
project(Xdmf)
......@@ -8,16 +10,20 @@ if(WIN32)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
endif()
if (FALSE) # XXX(kitware): force settings
set(XDMF_LIBNAME "Xdmf" CACHE STRING "Name for this xdmf library to avoid collision")
endif ()
set(XDMF_MAJOR_VERSION 3)
set(XDMF_MINOR_VERSION 0)
set(XDMF_PATCH_VERSION 0)
set(XDMF_VERSION "${XDMF_MAJOR_VERSION}.${XDMF_MINOR_VERSION}.${XDMF_PATCH_VERSION}")
if (FALSE) # XXX(kitware): VTK's module system handles output directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
endif ()
if(BUILD_SHARED_LIBS)
set(BUILD_SHARED 1)
......@@ -25,12 +31,16 @@ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/XdmfConfig.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/XdmfConfig.hpp)
if (FALSE) # XXX(kitware): force settings
# Enable CMake testing
option(XDMF_BUILD_TESTING "Build Tests" OFF)
if(XDMF_BUILD_TESTING)
enable_testing()
include(CTest)
endif()
else ()
set(XDMF_BUILD_TESTING OFF)
endif ()
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
......@@ -45,25 +55,40 @@ endif()
include(XdmfFunctions)
# Should we build with documentation
if (FALSE) # XXX(kitware): force settings
option(XDMF_BUILD_DOCUMENTATION OFF)
else ()
set(XDMF_BUILD_DOCUMENTATION OFF)
endif ()
if(XDMF_BUILD_DOCUMENTATION)
add_subdirectory(doc)
endif()
if (FALSE) # XXX(kitware): force settings
# Wrapper Setup
option(XDMF_WRAP_PYTHON OFF)
option(XDMF_WRAP_JAVA OFF)
else ()
set(XDMF_WRAP_PYTHON OFF)
set(XDMF_WRAP_JAVA OFF)
endif ()
if (FALSE) # XXX(kitware): VTK's module system handles dependencies
#check for TIFF
find_package(TIFF)
if (TIFF_FOUND)
add_definitions(-DXDMF_BUILD_TIFF)
include_directories(${TIFF_INCLUDE_DIR})
endif (TIFF_FOUND)
endif ()
if (FALSE) # XXX(kitware): force settings
# Test for DSM
option(XDMF_BUILD_DSM OFF)
mark_as_advanced(XDMF_BUILD_DSM)
else ()
set(XDMF_BUILD_ON OFF)
endif ()
if(XDMF_BUILD_DSM)
find_package(MPI REQUIRED)
if(MPI_FOUND)
......@@ -260,8 +285,12 @@ include(GNUInstallDirs)
add_subdirectory(core)
include_directories(${XdmfCore_INCLUDE_DIRS} ${XdmfDSM_INCLUDE_DIRS})
if (FALSE) # XXX(kitware): force settings
option(XDMF_BUILD_CORE_ONLY OFF)
mark_as_advanced(XDMF_BUILD_CORE_ONLY)
else ()
set(XDMF_BUILD_CORE_ONLY OFF)
endif ()
if(NOT XDMF_BUILD_CORE_ONLY)
set(XdmfSources
XdmfAggregate
......@@ -291,6 +320,7 @@ if(NOT XDMF_BUILD_CORE_ONLY)
XdmfTopologyType
XdmfUnstructuredGrid)
if (FALSE)
add_library(${XDMF_LIBNAME} ${XdmfSources})
SET_TARGET_PROPERTIES(
${XDMF_LIBNAME} PROPERTIES
......@@ -302,6 +332,24 @@ if(NOT XDMF_BUILD_CORE_ONLY)
else(XDMF_BUILD_DSM)
target_link_libraries(${XDMF_LIBNAME} XdmfCore)
endif(XDMF_BUILD_DSM)
else ()
set(sources)
set(headers)
foreach (xdmf_source IN LISTS XdmfSources)
list(APPEND sources
"${xdmf_source}.cpp")
list(APPEND headers
"${xdmf_source}.hpp")
endforeach ()
vtk_module_add_module(VTK::xdmf3
SOURCES ${sources}
HEADERS ${headers}
HEADERS_SUBDIR "vtkxdmf3")
target_link_libraries(xdmf3
PUBLIC
vtkxdmfcore)
endif ()
if(WIN32)
if (BUILD_SHARED_LIBS)
......@@ -334,11 +382,16 @@ if(NOT XDMF_BUILD_CORE_ONLY)
add_subdirectory(tests)
endif()
if (FALSE) # XXX(kitware): force settings
option(XDMF_BUILD_UTILS OFF)
else ()
set(XDMF_BUILD_UTILS OFF)
endif ()
if(XDMF_BUILD_UTILS)
add_subdirectory(utils)
endif()
if (FALSE) # XXX(kitware): VTK's module system handles installation
file(GLOB XdmfHeaders
"*.hpp"
"*.tpp"
......@@ -350,6 +403,7 @@ if(NOT XDMF_BUILD_CORE_ONLY)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif ()
endif()
if(WIN32 AND NOT CYGWIN)
......@@ -358,6 +412,8 @@ else()
set(DEF_INSTALL_CMAKE_DIR
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
endif()
if (FALSE) # XXX(kitware): VTK's module system handles installation
xdmf_create_config_file(${PROJECT_NAME})
install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
DESTINATION ${DEF_INSTALL_CMAKE_DIR})
endif ()
# xdmf3 fork for VTK
This branch contains changes required to embed xdmf3 into VTK. This
includes changes made primarily to the build system to allow it to be embedded
into another source tree as well as a header to facilitate mangling of the
symbols to avoid conflicts with other copies of the library within a single
process.
* Ignore whitespace errors for VTK's commit checks.
* Integrate the CMake build with VTK's module system.
......@@ -189,6 +189,7 @@ XdmfGridControllerRead(XDMFGRIDCONTROLLER * controller)
}
catch (...)
{
return NULL;
}
}
......
......@@ -17,9 +17,12 @@ if(BUILD_SHARED_LIBS)
set(BUILD_SHARED 1)
endif()
if (FALSE) # XXX(kitware): use target-based include directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif ()
if (FALSE) # XXX(kitware): VTK's module system handles dependencies
find_package(Boost REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
......@@ -46,6 +49,10 @@ find_package(LibXml2 REQUIRED)
if(LIBXML2_FOUND)
include_directories(${LIBXML2_INCLUDE_DIR})
endif()
else ()
vtk_module_find_package(
PACKAGE Boost)
endif ()
# Perform compile-time checks and generate XdmfCoreConfig.hpp
......@@ -103,6 +110,7 @@ else ()
set(FOUND_TIFF_LOCATION "")
endif()
if (FALSE) # XXX(kitware): VTK's module system handles dependencies
set(XdmfCoreSources
core/XdmfArray
core/XdmfArrayReference
......@@ -129,7 +137,9 @@ set(XdmfCoreSources
core/XdmfVisitor
core/XdmfWriter
PARENT_SCOPE)
endif ()
if (FALSE) # XXX(kitware): use VTK's module system.
add_library(XdmfCore ${XdmfCoreSources})
SET_TARGET_PROPERTIES(
XdmfCore PROPERTIES
......@@ -146,11 +156,35 @@ if (TIFF_FOUND)
PRIVATE
${TIFF_LIBRARIES})
endif ()
else ()
set(sources)
foreach (xdmf_core_source IN LISTS XdmfCoreSources)
list(APPEND sources
"${xdmf_core_source}.cpp")
endforeach ()
add_library(vtkxdmfcore ${sources})
target_include_directories(vtkxdmfcore
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../CMake/VersionSuite>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
"$<INSTALL_INTERFACE:${_vtk_build_HEADERS_DESTINATION}/vtkxdfm3/core>")
target_link_libraries(vtkxdmfcore
PUBLIC
VTK::libxml2
Boost::boost
PRIVATE
VTK::hdf5)
_vtk_module_apply_properties(vtkxdmfcore)
_vtk_module_install(vtkxdmfcore)
endif ()
if(WIN32)
#add_definitions(-D_HDF5USEDLL_ -D_HDF5USEHLDLL_)
if (BUILD_SHARED_LIBS)
set_target_properties(XdmfCore PROPERTIES
# XXX(kitware): mangle the library name.
set_target_properties(vtkxdmfcore PROPERTIES
DEFINE_SYMBOL XdmfCore_EXPORTS)
endif()
endif()
......@@ -176,12 +210,21 @@ file(GLOB LokiHeaders loki/*.h)
set(XdmfCoreHeaders
${XdmfCoreHeaders}
${CMAKE_CURRENT_BINARY_DIR}/XdmfCoreConfig.hpp)
if (FALSE)
install(FILES ${XdmfCoreHeaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES ${LokiHeaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/loki)
install(TARGETS XdmfCore
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
else ()
vtk_module_install_headers(
FILES ${XdmfCoreHeaders}
SUBDIR "vtkxdmf3/core")
vtk_module_install_headers(
FILES ${LokiHeaders}
SUBDIR "vtkxdmf3/core/loki")
endif ()
if (Boost_FOUND)
set(FOUND_BOOST_INCLUDES ${Boost_INCLUDE_DIRS})
......
......@@ -21,8 +21,7 @@
/* */
/*****************************************************************************/
#include <H5public.h>
#include <hdf5.h>
#include <vtk_hdf5.h>
#include <numeric>
#include <sstream>
#include "string.h"
......
......@@ -21,8 +21,7 @@
/* */
/*****************************************************************************/
#include <H5public.h>
#include <hdf5.h>
#include <vtk_hdf5.h>
#include <sstream>
#include <cstdio>
#include <cmath>
......
......@@ -37,11 +37,12 @@ class XdmfVisitor;
// Includes
#include <loki/Visitor.h>
#include <libxml/xmlexports.h>
#include <libxml/tree.h>
#include <libxml/uri.h>
#include <libxml/xpointer.h>
#include <libxml/xmlreader.h>
#include "vtk_libxml2.h"
#include VTKLIBXML2_HEADER(xmlexports.h)
#include VTKLIBXML2_HEADER(tree.h)
#include VTKLIBXML2_HEADER(uri.h)
#include VTKLIBXML2_HEADER(xpointer.h)
#include VTKLIBXML2_HEADER(xmlreader.h)
#include <map>
#include <set>
#include <string>
......
......@@ -21,7 +21,7 @@
/* */
/*****************************************************************************/
#include <hdf5.h>
#include <vtk_hdf5.h>
#include <sstream>
#include "XdmfArray.hpp"
#include "XdmfArrayType.hpp"
......
......@@ -21,7 +21,8 @@
/* */
/*****************************************************************************/
#include <libxml/uri.h>
#include "vtk_libxml2.h"
#include VTKLIBXML2_HEADER(uri.h)
#include <limits.h>
#include <stdlib.h>
#include "XdmfSystemUtils.hpp"
......
......@@ -56,8 +56,7 @@
#include <XdmfError.hpp>
#include <mpi.h>
#include <H5public.h>
#include <hdf5.h>
#include <vtk_hdf5.h>
#include <sstream>
#include <map>
......
......@@ -21,8 +21,7 @@
/* */
/*****************************************************************************/
#include <H5public.h>
#include <hdf5.h>
#include <vtk_hdf5.h>
#include "XdmfArray.hpp"
#include "XdmfArrayType.hpp"
#include "XdmfHDF5ControllerDSM.hpp"
......
......@@ -21,7 +21,7 @@
/* */
/*****************************************************************************/
#include <hdf5.h>
#include <vtk_hdf5.h>
#include <XdmfArray.hpp>
#include <XdmfDSMCommMPI.hpp>
#include <XdmfDSMBuffer.hpp>
......