Commit 62fe1244 authored by Brian Panneton's avatar Brian Panneton

ENH: Initial Windows Conversion

parent 4a43c7b4
......@@ -19,6 +19,34 @@
ENDIF(NOT ("${dependencies}" STREQUAL ""))
ENDMACRO(ADD_TEST_CXX_DEPENDENCIES dependencies)
# Cxx Add LDPath Macro
# Author: Brian Panneton
# Description: This macro adds the cxx test ldpaths.
# Parameters:
# ld = any ldpaths needed for cxx tests
MACRO(ADD_TEST_CXX_LDPATH ld)
GET_PROPERTY(ldpath GLOBAL PROPERTY CXX_TEST_LDPATH)
IF("${ld}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY CXX_TEST_LDPATH
"${ldpath}${sep}${ld}"
)
ENDIF("${ld}" STRGREATER "")
ENDMACRO(ADD_TEST_CXX_LDPATH ld)
# Cxx Add Path Macro
# Author: Brian Panneton
# Description: This macro adds the cxx test paths.
# Parameters:
# p = any paths needed for cxx tests
MACRO(ADD_TEST_CXX_PATH p)
GET_PROPERTY(path GLOBAL PROPERTY CXX_TEST_PATH)
IF("${p}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY CXX_TEST_PATH
"${path}${sep}${p}"
)
ENDIF("${p}" STRGREATER "")
ENDMACRO(ADD_TEST_CXX_PATH p)
# CXX Test Macro
# Author: Brian Panneton
# Description: This macro builds and add the cxx test in one shot.
......@@ -38,10 +66,32 @@
ENDIF(EXISTS ${cxx_source_dir}/${executable}.cxx)
GET_PROPERTY(cxx_dependencies GLOBAL PROPERTY CXX_TEST_DEPENDENCIES)
GET_PROPERTY(cxx_ldpath GLOBAL PROPERTY CXX_TEST_LDPATH)
GET_PROPERTY(cxx_path GLOBAL PROPERTY CXX_TEST_PATH)
TARGET_LINK_LIBRARIES(${executable}${dup} ${cxx_dependencies})
# Take care of windowisims
IF(WIN32)
SET_TARGET_PROPERTIES(${executable}${dup} PROPERTIES
PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${cxx_binary_dir}
LIBRARY_OUTPUT_DIRECTORY ${cxx_binary_dir}
ARCHIVE_OUTPUT_DIRECTORY ${cxx_binary_dir})
IF("${cxx_path}" STREQUAL "")
SET(cxx_path ${cxx_ldpath})
ENDIF("${cxx_path}" STREQUAL "")
ENDIF(WIN32)
SET_CORE("${cxx_binary_dir}")
ADD_TEST(Cxx${is_core}_${executable}${dup} ${executable}${dup} ${arguments})
ADD_TEST(Cxx${is_core}_${executable}${dup} ${CMAKE_COMMAND}
-D "EXECUTABLE=${executable}${dup}"
-D "ARGUMENTS=${arguments}"
-D "LDPATH=${cxx_ldpath}"
-D "PATH=${cxx_path}"
-D "SEPARATOR=${sep}"
-P "${cxx_binary_dir}/TestDriverCxx.cmake"
)
ENDMACRO(ADD_TEST_CXX executable)
# CXX Clean Macro
......@@ -55,3 +105,7 @@
ADDITIONAL_MAKE_CLEAN_FILES ${ARGN}
)
ENDMACRO(CLEAN_TEST_CXX executable)
# Configure the cxx 'driver' file
CONFIGURE_FILE(${TESTING_SUITE_DIR}/TestingSuite/TestDriverCxx.cmake.in ${cxx_binary_dir}/TestDriverCxx.cmake @ONLY)
......@@ -40,7 +40,7 @@ MACRO(ADD_TEST_JAVA_CLASSPATH cp)
GET_PROPERTY(classpath GLOBAL PROPERTY JAVA_TEST_CLASSPATH)
IF(NOT ("${cp}" STREQUAL ""))
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_CLASSPATH
"${classpath}:${cp}"
"${classpath}${sep}${cp}"
)
ENDIF(NOT ("${cp}" STREQUAL ""))
ENDMACRO(ADD_TEST_JAVA_CLASSPATH cp)
......@@ -54,11 +54,25 @@ MACRO(ADD_TEST_JAVA_LDPATH ld)
GET_PROPERTY(ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
IF("${ld}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_LDPATH
"${ldpath}:${ld}"
"${ldpath}${sep}${ld}"
)
ENDIF("${ld}" STRGREATER "")
ENDMACRO(ADD_TEST_JAVA_LDPATH ld)
# Java Add Path Macro
# Author: Brian Panneton
# Description: This macro adds the java test paths.
# Parameters:
# p = any paths needed for java tests
MACRO(ADD_TEST_JAVA_PATH p)
GET_PROPERTY(path GLOBAL PROPERTY JAVA_TEST_PATH)
IF("${p}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY JAVA_TEST_PATH
"${path}${sep}${p}"
)
ENDIF("${p}" STRGREATER "")
ENDMACRO(ADD_TEST_JAVA_PATH p)
# Add Java Test Macro
# Author: Brian Panneton
# Description: This macro builds and adds the java test in one shot. There is
......@@ -76,6 +90,7 @@ MACRO(ADD_TEST_JAVA executable)
JAVA_TEST_FILE_DEPENDENCIES)
GET_PROPERTY(java_classpath GLOBAL PROPERTY JAVA_TEST_CLASSPATH)
GET_PROPERTY(java_ldpath GLOBAL PROPERTY JAVA_TEST_LDPATH)
GET_PROPERTY(java_path GLOBAL PROPERTY JAVA_TEST_PATH)
ADD_CUSTOM_COMMAND(
OUTPUT ${java_binary_dir}/${executable}.class
......@@ -83,22 +98,30 @@ MACRO(ADD_TEST_JAVA executable)
DEPENDS ${java_source_dir}/${executable}.java
${java_file_dependencies}
COMMAND ${JAVA_COMPILE}
ARGS -cp '${java_classpath}'
-d '${java_binary_dir}'
ARGS -cp "\"${java_classpath}\""
-d "\"${java_binary_dir}\""
${java_source_dir}/${executable}.java
)
SET_PROPERTY(GLOBAL APPEND PROPERTY JAVA_TEST_TARGETS "${java_binary_dir}/${executable}.class")
# Dlls need to be in the path dir for java
IF(WIN32)
IF("${java_path}" STREQUAL "")
SET(java_path ${java_ldpath})
ENDIF("${java_path}" STREQUAL "")
ENDIF(WIN32)
SET_CORE("${java_binary_dir}")
ADD_TEST(Java${is_core}_${executable}${dup} ${CMAKE_COMMAND}
-D EXECUTABLE=${executable}
-D ARGUMENTS=${arguments}
-D CLASSPATH=${java_classpath}
-D LDPATH=${java_ldpath}
-P ${java_binary_dir}/TestDriverJava.cmake
-D "EXECUTABLE=${executable}"
-D "ARGUMENTS=${arguments}"
-D "CLASSPATH=${java_classpath}"
-D "LDPATH=${java_ldpath}"
-D "PATH=${java_path}"
-D "SEPARATOR=${sep}"
-P "${java_binary_dir}/TestDriverJava.cmake"
)
ENDMACRO(ADD_TEST_JAVA executable)
# Java Clean Macro
......
......@@ -41,7 +41,7 @@ MACRO(ADD_TEST_PYTHON_PYTHONPATH pyp)
GET_PROPERTY(pythonpath GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH)
IF(NOT ("${pyp}" STREQUAL ""))
SET_PROPERTY(GLOBAL PROPERTY PYTHON_TEST_PYTHONPATH
"${pythonpath}:${pyp}"
"${pythonpath}${sep}${pyp}"
)
ENDIF(NOT ("${pyp}" STREQUAL ""))
ENDMACRO(ADD_TEST_PYTHON_PYTHONPATH cp)
......@@ -82,13 +82,12 @@ MACRO(ADD_TEST_PYTHON executable)
SET_CORE("${python_binary_dir}")
ADD_TEST(Python${is_core}_${executable}${dup} ${CMAKE_COMMAND}
-D EXECUTABLE=${executable}
-D ARGUMENTS=${arguments}
-D PYTHONPATH=${python_pythonpath}
-P ${python_binary_dir}/TestDriverPython.cmake
-D "EXECUTABLE=${executable}"
-D "ARGUMENTS=${arguments}"
-D "PYTHONPATH=${python_pythonpath}"
-D "SEPARATOR=${sep}"
-P "${python_binary_dir}/TestDriverPython.cmake"
)
ENDMACRO(ADD_TEST_PYTHON executable)
# Python Clean Macro
......
SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
MESSAGE("| Calling:\t${EXECUTABLE} ${ARGUMENTS}")
EXECUTE_PROCESS(
COMMAND ${EXECUTABLE} ${ARGUMENTS}
RESULT_VARIABLE cxx_result
OUTPUT_VARIABLE cxx_output
ERROR_VARIABLE cxx_error
)
MESSAGE("| Call Result:\t${cxx_result}")
MESSAGE("| Call Output: Begin\n${cxx_output}")
MESSAGE("| Call Output: End")
IF(cxx_error)
MESSAGE("| Call Error: Begin\n${cxx_error}")
MESSAGE("| Call Error: End")
ENDIF(cxx_error)
MESSAGE("| Call Ended")
MESSAGE("----------------------------------------------------------")
# Let's make sure that if the test failed, it failed with CTest too
IF(cxx_error)
MESSAGE(SEND_ERROR "Test Failed.")
ENDIF(cxx_error)
IF(NOT ${cxx_result} EQUAL "0")
MESSAGE(SEND_ERROR "Test Failed.")
ENDIF(NOT ${cxx_result} EQUAL "0")
SET(java_runtime @JAVA_RUNTIME@)
SET(java_binary_dir @CMAKE_CURRENT_BINARY_DIR@)
IF(WIN32)
STRING(REGEX REPLACE ":" ";" CLASSPATH ${CLASSPATH})
ENDIF(WIN32)
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}:$ENV{LD_LIBRARY_PATH}")
SET(ENV{CLASSPATH} "${CLASSPATH}:$ENV{CLASSPATH}")
SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
SET(ENV{CLASSPATH} "${CLASSPATH}${SEPARATOR}$ENV{CLASSPATH}")
MESSAGE("| Calling:\t${java_runtime} ${EXECUTABLE} ${ARGUMENTS}")
EXECUTE_PROCESS(
......
SET(python_runtime @PYTHON_EXECUTABLE@)
SET(python_binary_dir @CMAKE_CURRENT_BINARY_DIR@)
IF(WIN32)
STRING(REGEX REPLACE ":" ";" PYTHONPATH ${PYTHONPATH})
ENDIF(WIN32)
SET(ENV{PYTHONPATH} "${PYTHONPATH}:$ENV{PYTHONPATH}")
SET(ENV{PYTHONPATH} "${PYTHONPATH}${SEPARATOR}$ENV{PYTHONPATH}")
MESSAGE("| Calling:\t${python_runtime} ${EXECUTABLE} ${ARGUMENTS}")
EXECUTE_PROCESS(
......
......@@ -4,12 +4,22 @@ SET(defines
JAVA_TEST_FILE_DEPENDENCIES
JAVA_TEST_CLASSPATH
JAVA_TEST_LDPATH
JAVA_TEST_PATH
JAVA_TEST_TARGETS
PYTHON_TEST_DEPENDENCIES
PYTHON_TEST_FILE_DEPENDENCIES
CXX_TEST_DEPENDENCIES
CXX_TEST_LDPATH
CXX_TEST_PATH
)
# Take care of Windows Path Seperators
IF(WIN32)
SET(sep ";")
ELSE(WIN32)
SET(sep ":")
ENDIF(WIN32)
# Make sure they are defined
FOREACH(def IN LISTS defines)
GET_PROPERTY(is_defined GLOBAL PROPERTY ${def} DEFINED)
......
......@@ -67,6 +67,17 @@ if(XDMF_WRAP_PYTHON)
if("${ARGN}" STRGREATER "")
add_dependencies(${python_name} "${ARGN}")
endif("${ARGN}" STRGREATER "")
if(WIN32)
set_target_properties(${SWIG_MODULE_${python_name}_REAL_NAME}
PROPERTIES
PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif(WIN32)
install(FILES ${CMAKE_BINARY_DIR}/${python_name}.py
DESTINATION lib/python)
install(TARGETS ${SWIG_MODULE_${python_name}_REAL_NAME}
......@@ -98,6 +109,22 @@ if(XDMF_WRAP_JAVA)
set_source_files_properties(${java_name}.i PROPERTIES CPLUSPLUS ON)
swig_add_module(${java_name}Java java ${java_name}.i)
swig_link_libraries(${java_name}Java ${java_name})
if(WIN32)
set_target_properties(${SWIG_MODULE_${java_name}Java_REAL_NAME}
PROPERTIES
PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)
set(java_compile_args "-cp \"\\\"${CMAKE_BINARY_DIR}/*.jar\\\"\" *.java")
set(java_dest "bin")
else(WIN32)
set(java_compile_args -cp '${CMAKE_BINARY_DIR}/*' ${XDMF_JAVA_DIR}/*.java)
set(java_dest "lib/java")
endif(WIN32)
add_custom_target(${java_name}_Java_Dir ALL DEPENDS
${XDMF_JAVA_DIR})
add_custom_command(OUTPUT ${XDMF_JAVA_DIR}
......@@ -107,14 +134,17 @@ if(XDMF_WRAP_JAVA)
${${java_name}_JAVA_JAR})
add_custom_command(OUTPUT ${${java_name}_JAVA_JAR}
COMMAND ${JAVA_COMPILE}
ARGS -cp "'${CMAKE_BINARY_DIR}/*'"
"${XDMF_JAVA_DIR}/*.java"
ARGS ${java_compile_args}
COMMAND ${JAVA_ARCHIVE}
ARGS -cvf ${${java_name}_JAVA_JAR}
"${XDMF_JAVA_PACKAGE_DIR}/*.class"
)
add_dependencies(${java_name}Java ${java_name}_Java_Dir)
add_dependencies(Compiled_${java_name}_Jar ${java_name}Java "${ARGN}")
add_dependencies(Compiled_${java_name}_Jar ${java_name}Java)
if(NOT ${ARGN} EQUAL "")
add_dependencies(Compiled_${java_name}_Jar "${ARGN}")
endif(NOT ${ARGN} EQUAL "")
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
......@@ -124,7 +154,7 @@ if(XDMF_WRAP_JAVA)
install(FILES ${CMAKE_BINARY_DIR}/${java_name}.jar
DESTINATION lib/java)
install(TARGETS ${SWIG_MODULE_${java_name}Java_REAL_NAME}
DESTINATION lib/java)
DESTINATION ${java_dest})
ENDMACRO(XDMF_SWIG_JAVA)
endif(XDMF_WRAP_JAVA)
......@@ -160,6 +190,15 @@ if(NOT XDMF_BUILD_CORE_ONLY)
add_library(Xdmf ${XdmfSources})
target_link_libraries(Xdmf XdmfCore)
if(WIN32)
set_target_properties(Xdmf PROPERTIES
DEFINE_SYMBOL Xdmf_EXPORTS
PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif(WIN32)
if(XDMF_WRAP_JAVA)
XDMF_SWIG_JAVA(Xdmf Compiled_XdmfCore_Jar)
endif(XDMF_WRAP_JAVA)
......@@ -179,5 +218,9 @@ if(NOT XDMF_BUILD_CORE_ONLY)
file(GLOB XdmfHeaders "*.hpp" "*.tpp" "*.i" "CMake/VersionSuite/*.hpp")
install(FILES ${XdmfHeaders} DESTINATION include)
install(TARGETS Xdmf LIBRARY DESTINATION lib)
install(TARGETS Xdmf
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
endif(NOT XDMF_BUILD_CORE_ONLY)
#ifndef _XDMF_HPP
#define _XDMF_HPP
/* Keep all our Win32 Conversions here */
#ifdef _WIN32
/* Used to export/import from the dlls */
#undef XDMFCORE_EXPORT
#define XDMFCORE_EXPORT __declspec(dllimport)
#undef XDMFCORE_TEMPLATE
#define XDMFCORE_TEMPLATE extern
#ifdef Xdmf_EXPORTS
#define XDMF_EXPORT __declspec(dllexport)
#define XDMF_TEMPLATE
#else /* Xdmf_EXPORTS */
#define XDMF_EXPORT __declspec(dllimport)
#define XDMF_TEMPLATE extern
#endif /* Xdmf_EXPORTS */
/* Compiler Warnings */
#ifndef XDMF_DEBUG
#pragma warning( disable : 4231 ) /* nonstandard extension used : 'extern' before template explicit instantiation */
#pragma warning( disable : 4251 ) /* needs to have dll-interface to be used by clients (Most of these guys are in private */
#pragma warning( disable : 4275 ) /* non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class */
#pragma warning( disable : 4373 ) /* virtual function overrides, parameters only differed by const/volatile qualifiers */
#pragma warning( disable : 4748 ) /* /GS can not protect parameters and local variables from local buffer overrun (turned off op)*/
#endif /* XDMF_DEBUG */
/* Compiler Optimizations will result in an 'internal compiler error', so turn them off */
#pragma optimize("g", off)
#else /* _WIN32 */
/* We don't need to export/import since there are no dlls */
#define XDMFCORE_EXPORT
#define XDMF_EXPORT
#define XDMFCORE_TEMPLATE
#define XDMF_TEMPLATE
#endif /* _WIN32 */
#endif /* _XDMF_HPP */
......@@ -5,6 +5,8 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%module Xdmf
%{
#include <Xdmf.hpp>
// XdmfCore Includes
#include <XdmfArray.hpp>
#include <XdmfArrayType.hpp>
......@@ -268,6 +270,7 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%shared_ptr(XdmfTopologyType)
%shared_ptr(XdmfUnstructuredGrid)
%include Xdmf.hpp
%include XdmfGrid.hpp
%include XdmfAttribute.hpp
......
......@@ -6,6 +6,7 @@ class XdmfAttributeCenter;
class XdmfAttributeType;
// Includes
#include "Xdmf.hpp"
#include "XdmfArray.hpp"
/**
......@@ -14,7 +15,7 @@ class XdmfAttributeType;
* XdmfAttribute contains two properties that should be set, XdmfAttributeCenter and XdmfAttributeType.
* XdmfAttribute is a subclass of XdmfDataItem, meaning it contains an XdmfArray to store values.
*/
class XdmfAttribute : public XdmfArray {
class XDMF_EXPORT XdmfAttribute : public XdmfArray {
public:
......@@ -92,4 +93,9 @@ private:
boost::shared_ptr<const XdmfAttributeType> mType;
};
#ifdef _WIN32
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfAttributeType>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfAttributeCenter>;
#endif
#endif /* XDMFATTRIBUTE_HPP_ */
......@@ -79,6 +79,7 @@ boost::shared_ptr<const XdmfAttributeCenter> XdmfAttributeCenter::New(const std:
}
}
assert(false);
return boost::shared_ptr<const XdmfAttributeCenter>();
}
void XdmfAttributeCenter::getProperties(std::map<std::string, std::string> & collectedProperties) const
......
......@@ -2,6 +2,7 @@
#define XDMFATTRIBUTECENTER_HPP_
// Includes
#include "Xdmf.hpp"
#include "XdmfItemProperty.hpp"
/**
......@@ -18,7 +19,7 @@
* Edge
* Node
*/
class XdmfAttributeCenter : public XdmfItemProperty {
class XDMF_EXPORT XdmfAttributeCenter : public XdmfItemProperty {
public:
......
......@@ -103,6 +103,7 @@ boost::shared_ptr<const XdmfAttributeType> XdmfAttributeType::New(const std::map
}
}
assert(false);
return boost::shared_ptr<const XdmfAttributeType>();
}
void XdmfAttributeType::getProperties(std::map<std::string, std::string> & collectedProperties) const
......
......@@ -2,6 +2,7 @@
#define XDMFATTRIBUTETYPE_HPP_
// Includes
#include "Xdmf.hpp"
#include "XdmfItemProperty.hpp"
/**
......@@ -20,7 +21,7 @@
* Tensor6
* GlobalId
*/
class XdmfAttributeType : public XdmfItemProperty {
class XDMF_EXPORT XdmfAttributeType : public XdmfItemProperty {
public:
......
......@@ -5,6 +5,7 @@
class XdmfArray;
// Includes
#include "Xdmf.hpp"
#include "XdmfGrid.hpp"
/**
......@@ -17,7 +18,7 @@ class XdmfArray;
* must be specified.
*
*/
class XdmfCurvilinearGrid : public XdmfGrid {
class XDMF_EXPORT XdmfCurvilinearGrid : public XdmfGrid {
public:
......@@ -112,4 +113,10 @@ private:
};
#ifdef _WIN32
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<XdmfGeometry>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<XdmfArray>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfArray>;
#endif
#endif /* XDMFCURVILINEARGRID_HPP_ */
......@@ -9,6 +9,7 @@ class XdmfRegularGrid;
class XdmfUnstructuredGrid;
// Includes
#include "Xdmf.hpp"
#include "XdmfItem.hpp"
/**
......@@ -17,7 +18,7 @@ class XdmfUnstructuredGrid;
* XdmfDomain is the top XdmfItem in an Xdmf structure. It can store a number of grids and
* provides methods to insert, retrieve, and remove these grids.
*/
class XdmfDomain : public virtual XdmfItem {
class XDMF_EXPORT XdmfDomain : public virtual XdmfItem {
public:
......@@ -57,4 +58,17 @@ private:
};
#ifdef _WIN32
XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfGridCollection> >;
XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfGridCollection>, std::allocator<boost::shared_ptr<XdmfGridCollection> > >;
XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfCurvilinearGrid> >;
XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfCurvilinearGrid>, std::allocator<boost::shared_ptr<XdmfCurvilinearGrid> > >;
XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfRectilinearGrid> >;
XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfRectilinearGrid>, std::allocator<boost::shared_ptr<XdmfRectilinearGrid> > >;
XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfRegularGrid> >;
XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfRegularGrid>, std::allocator<boost::shared_ptr<XdmfRegularGrid> > >;
XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfUnstructuredGrid> >;
XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfUnstructuredGrid>, std::allocator<boost::shared_ptr<XdmfUnstructuredGrid> > >;
#endif
#endif /* XDMFDOMAIN_HPP_ */
......@@ -5,6 +5,7 @@
class XdmfGeometryType;
// Includes
#include "Xdmf.hpp"
#include "XdmfArray.hpp"
/**
......@@ -14,7 +15,7 @@ class XdmfGeometryType;
* of all points contained in an XdmfGrid. XdmfGeometry contains an XdmfGeometryType property
* which should be set that specifies the types of coordinate values stored.
*/
class XdmfGeometry : public XdmfArray {
class XDMF_EXPORT XdmfGeometry : public XdmfArray {
public:
......@@ -67,4 +68,8 @@ private:
boost::shared_ptr<const XdmfGeometryType> mType;
};
#ifdef _WIN32
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfGeometryType>;
#endif
#endif /* XDMFGEOMETRY_HPP_ */
......@@ -65,6 +65,7 @@ boost::shared_ptr<const XdmfGeometryType> XdmfGeometryType::New(const std::map<s
}
}
assert(false);
return boost::shared_ptr<const XdmfGeometryType>();
}
unsigned int XdmfGeometryType::getDimensions() const
......
......@@ -2,6 +2,7 @@
#define XDMFGEOMETRYTYPE_HPP_
// Includes
#include "Xdmf.hpp"
#include "XdmfItemProperty.hpp"
/**
......@@ -16,7 +17,7 @@
* XYZ
* XY
*/
class XdmfGeometryType : public XdmfItemProperty {
class XDMF_EXPORT XdmfGeometryType : public XdmfItemProperty {
public:
......
......@@ -10,6 +10,7 @@ class XdmfTime;
class XdmfTopology;
// Includes
#include "Xdmf.hpp"
#include "XdmfItem.hpp"
/**
......@@ -22,7 +23,7 @@ class XdmfTopology;
*
* XdmfGrid is an abstract base class. There are several implementations for representing both structured and unstructured grids.
*/
class XdmfGrid : public virtual XdmfItem {
class XDMF_EXPORT XdmfGrid : public virtual XdmfItem {
public:
......@@ -131,4 +132,19 @@ private:
};
#ifdef _WIN32
XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfAttribute> >;
XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfAttribute>, std::allocator<boost::shared_ptr<XdmfAttribute> > >;
XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfSet> >;
XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfSet>, std::allocator<boost::shared_ptr<XdmfSet> > >;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<XdmfGeometry>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfGeometry>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<XdmfTopology>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfTopology>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<XdmfMap>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfMap>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<XdmfTime>;
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfTime>;
#endif
#endif /* XDMFGRID_HPP_ */
......@@ -5,6 +5,7 @@
class XdmfGridCollectionType;
// Includes
#include "Xdmf.hpp"
#include "XdmfDomain.hpp"
#include "XdmfGrid.hpp"
......@@ -16,7 +17,7 @@ class XdmfGridCollectionType;
*
* It is valid to nest collections. A spatial collection within a temporal collection is commonly used.
*/
class XdmfGridCollection : public XdmfDomain,
class XDMF_EXPORT XdmfGridCollection : public XdmfDomain,
public XdmfGrid {
public:
......@@ -76,4 +77,8 @@ private:
boost::shared_ptr<const XdmfGridCollectionType> mType;
};
#ifdef _WIN32
XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfGridCollectionType>;
#endif
#endif /* XDMFGRID_HPP_ */
......@@ -59,6 +59,7 @@ boost::shared_ptr<const XdmfGridCollectionType> XdmfGridCollectionType::New(cons
}
}
assert(false);
return boost::shared_ptr<const XdmfGridCollectionType>();
}
void XdmfGridCollectionType::getProperties(std::map<std::string, std::string> & collectedProperties) const
......
......@@ -2,6 +2,7 @@
#define XDMFGRIDCOLLECTIONTYPE_HPP_
// Includes
#include "Xdmf.hpp"
#include "XdmfItemProperty.hpp"
/**
......@@ -16,7 +17,7 @@
* Spatial
* Temporal
*/
class XdmfGridCollectionType : public XdmfItemProperty {
class XDMF_EXPORT XdmfGridCollectionType : public XdmfItemProperty {
public:
......
#include <cctype>
#include <boost/tokenizer.hpp>
#include "XdmfAttribute.hpp"
#include "XdmfCurvilinearGrid.hpp"
......@@ -154,7 +155,7 @@ boost::shared_ptr<XdmfItem> XdmfItemFactory::createItem(const std::string & item
if(type != itemProperties.end())
{
std::string typeVal = type->second;
std::transform(typeVal.begin(), typeVal.end(), typeVal.begin(), (int(*)(int))std::toupper);
std::transform(typeVal.begin(), typeVal.end(), typeVal.begin(), (int(*)(int))toupper);
if(typeVal.compare("2DCORECTMESH") == 0 || typeVal.compare("3DCORECTMESH") == 0
|| typeVal.compare("2DSMESH") == 0 || typeVal.compare("3DSMESH") == 0)
{
......
......@@ -5,12 +5,13 @@
class XdmfItem;
// Includes
#include "Xdmf.hpp"
#include "XdmfCoreItemFactory.hpp"
/**
* @brief Factory for constructing XdmfItems from their ItemTag and ItemProperties
*/
class XdmfItemFactory : public XdmfCoreItemFactory {
class XDMF_EXPORT XdmfItemFactory : public XdmfCoreItemFactory {
public: