Commit eae48216 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

Changes from ARL's Repo (C Wrappers, DSM rework, Custom Types, Templates,...

Changes from ARL's Repo (C Wrappers, DSM rework, Custom Types, Templates, GridControllers, TIFF integration, XdmfAggregate)
parent 06d2b52b
SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}") SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
set(XDMF_DSM_IS_CRAY "@XDMF_DSM_IS_CRAY@")
if (XDMF_DSM_IS_CRAY)
SET(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}${SEPARATOR}${LDPATH}")
else (XDMF_DSM_IS_CRAY)
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
endif (XDMF_DSM_IS_CRAY)
SET(ENV{MPIEXEC} "@MPIEXEC@") SET(ENV{MPIEXEC} "@MPIEXEC@")
MESSAGE("| Calling:\t${EXECUTABLE} ${ARGUMENTS}") MESSAGE("| Calling:\t${EXECUTABLE} ${ARGUMENTS}")
......
SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}") SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
set(XDMF_DSM_IS_CRAY "@XDMF_DSM_IS_CRAY@")
if (XDMF_DSM_IS_CRAY)
SET(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}${SEPARATOR}${LDPATH}")
else (XDMF_DSM_IS_CRAY)
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
endif (XDMF_DSM_IS_CRAY)
SET(ENV{MPIEXEC} "@MPIEXEC@") SET(ENV{MPIEXEC} "@MPIEXEC@")
MESSAGE("| Calling:\t${EXECUTABLE} ${ARGUMENTS}") MESSAGE("| Calling:\t${EXECUTABLE} ${ARGUMENTS}")
......
SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}") SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
set(XDMF_DSM_IS_CRAY "@XDMF_DSM_IS_CRAY@")
if (XDMF_DSM_IS_CRAY)
SET(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}${SEPARATOR}${LDPATH}")
else (XDMF_DSM_IS_CRAY)
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
endif (XDMF_DSM_IS_CRAY)
SET(ENV{MPIEXEC} "@MPIEXEC@") SET(ENV{MPIEXEC} "@MPIEXEC@")
MESSAGE("| Calling:\t${EXECUTABLE} ${ARGUMENTS}") MESSAGE("| Calling:\t${EXECUTABLE} ${ARGUMENTS}")
......
...@@ -3,7 +3,13 @@ SET(python_binary_dir "@CMAKE_CURRENT_BINARY_DIR@") ...@@ -3,7 +3,13 @@ SET(python_binary_dir "@CMAKE_CURRENT_BINARY_DIR@")
SET(ENV{PYTHONPATH} "${PYTHONPATH}${SEPARATOR}$ENV{PYTHONPATH}") SET(ENV{PYTHONPATH} "${PYTHONPATH}${SEPARATOR}$ENV{PYTHONPATH}")
SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}") SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
set(XDMF_DSM_IS_CRAY "@XDMF_DSM_IS_CRAY@")
if (XDMF_DSM_IS_CRAY)
SET(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}${SEPARATOR}${LDPATH}")
else (XDMF_DSM_IS_CRAY)
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
endif (XDMF_DSM_IS_CRAY)
MESSAGE("| Calling:\t${python_runtime} ${EXECUTABLE} ${ARGUMENTS}") MESSAGE("| Calling:\t${python_runtime} ${EXECUTABLE} ${ARGUMENTS}")
EXECUTE_PROCESS( EXECUTE_PROCESS(
......
...@@ -3,7 +3,16 @@ SET(python_binary_dir "@CMAKE_CURRENT_BINARY_DIR@") ...@@ -3,7 +3,16 @@ SET(python_binary_dir "@CMAKE_CURRENT_BINARY_DIR@")
SET(ENV{PYTHONPATH} "${PYTHONPATH}${SEPARATOR}$ENV{PYTHONPATH}") SET(ENV{PYTHONPATH} "${PYTHONPATH}${SEPARATOR}$ENV{PYTHONPATH}")
SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}") SET(ENV{PATH} "${PATH}${SEPARATOR}$ENV{PATH}")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
set(XDMF_DSM_IS_CRAY "@XDMF_DSM_IS_CRAY@")
if (XDMF_DSM_IS_CRAY)
# message("Cray Style")
SET(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}${SEPARATOR}${LDPATH}")
else (XDMF_DSM_IS_CRAY)
# message("Normal Style")
SET(ENV{LD_LIBRARY_PATH} "${LDPATH}${SEPARATOR}$ENV{LD_LIBRARY_PATH}")
endif (XDMF_DSM_IS_CRAY)
SET(ENV{PYTHON_EXECUTABLE} "${python_runtime}") SET(ENV{PYTHON_EXECUTABLE} "${python_runtime}")
SET(ENV{MPIEXEC} "@MPIEXEC@") SET(ENV{MPIEXEC} "@MPIEXEC@")
......
...@@ -82,5 +82,10 @@ MACRO(SET_CORE dir) ...@@ -82,5 +82,10 @@ MACRO(SET_CORE dir)
STRING(REGEX MATCH "core" is_core "${dir}") STRING(REGEX MATCH "core" is_core "${dir}")
IF(EXISTS ${is_core}) IF(EXISTS ${is_core})
SET(is_core "Core") SET(is_core "Core")
ELSE(EXISTS ${is_core})
STRING(REGEX MATCH "utils" is_core "${dir}")
IF(EXISTS ${is_core})
SET(is_core "Util")
ENDIF(EXISTS ${is_core})
ENDIF(EXISTS ${is_core}) ENDIF(EXISTS ${is_core})
ENDMACRO(SET_CORE dir) ENDMACRO(SET_CORE dir)
...@@ -19,27 +19,31 @@ class ProjectVersion { ...@@ -19,27 +19,31 @@ class ProjectVersion {
* *
* @param name of the project * @param name of the project
*/ */
ProjectVersion(std::string iProjectName, int iMajor, int iMinor) { ProjectVersion(std::string iProjectName, int iMajor, int iMinor, int iPatch) {
setProjectName(iProjectName); setProjectName(iProjectName);
setMajor(iMajor); setMajor(iMajor);
setMinor(iMinor); setMinor(iMinor);
} setPatch(iPatch);
}
ProjectVersion(std::string iProjectName, ProjectVersion(std::string iProjectName,
std::string iMajor, std::string iMinor) { std::string iMajor, std::string iMinor, std::string iPatch) {
setProjectName(iProjectName); setProjectName(iProjectName);
setMajorStr(iMajor); setMajorStr(iMajor);
setMinorStr(iMinor); setMinorStr(iMinor);
} setPatchStr(iPatch);
/** }
* Get the version string
* /**
* @return the Version in "ProjectName Major.Minor" string format * Get the version string
*/ *
* @return the Version in "ProjectName Major.Minor.Patch" string format
*/
std::string getFull() { std::string getFull() {
return getProjectName()+std::string(" ")+ return getProjectName()+std::string(" ")+
getMajorStr()+std::string(".")+ getMajorStr()+std::string(".")+
getMinorStr(); getMinorStr()+std::string(".")+
getPatchStr();
} }
/** /**
...@@ -47,79 +51,101 @@ class ProjectVersion { ...@@ -47,79 +51,101 @@ class ProjectVersion {
* *
* @return the Version in "Major.Minor" string format * @return the Version in "Major.Minor" string format
*/ */
std::string getShort() { std::string getShort() {
return getMajorStr()+std::string(".")+ return getMajorStr()+std::string(".")+
getMinorStr(); getMinorStr();
} }
/** /**
* Get the version objects project name * Get the version objects project name
* *
* @return the project name in string format * @return the project name in string format
*/ */
std::string getProjectName() { return ProjectName; } std::string getProjectName() { return ProjectName; }
/** /**
* Get the Version Major * Get the Version Major
* *
* @return the Version Major in string format * @return the Version Major in string format
*/ */
std::string getMajorStr() std::string getMajorStr()
{ {
if(Major != -1) return IntToStr(Major); if(Major != -1) return IntToStr(Major);
return("X"); return("X");
} }
/** /**
* Get the Version Minor * Get the Version Minor
* *
* @return the Version Minor in string format * @return the Version Minor in string format
*/ */
std::string getMinorStr() std::string getMinorStr()
{ {
if(Minor != -1) return IntToStr(Minor); if(Minor != -1) return IntToStr(Minor);
return("X"); return("X");
} }
/** /**
* Get the Version Patch
*
* @return the Version Patch in string format
*/
std::string getPatchStr()
{
if(Patch != -1) return IntToStr(Patch);
return("X");
}
/**
* Get the Version Major * Get the Version Major
* *
* @return the Version Major in int format * @return the Version Major in int format
*/ */
int getMajor() { return Major; } int getMajor() { return Major; }
/** /**
* Get the Version Minor * Get the Version Minor
* *
* @return the Version Minor in int format * @return the Version Minor in int format
*/ */
int getMinor() { return Minor; } int getMinor() { return Minor; }
/**
* Get the Version Patch
*
* @return the Version Patch in int format
*/
int getPatch() { return Patch; }
private: private:
std::string ProjectName; std::string ProjectName;
int Major, Minor; int Major, Minor, Patch;
std::string IntToStr(int number) { std::string IntToStr(int number) {
std::stringstream s; std::stringstream s;
s << number; s << number;
return s.str(); return s.str();
} }
int StrToInt(std::string string) { int StrToInt(std::string string) {
int i = 0; int i = 0;
std::stringstream s(string); std::stringstream s(string);
if(!(s >> i)) return -1; if(!(s >> i)) return -1;
return i; return i;
} }
void setProjectName(std::string iProjectName) void setProjectName(std::string iProjectName)
{ ProjectName = iProjectName; } { ProjectName = iProjectName; }
void setMajor(int iMajor) { Major = iMajor; } void setMajor(int iMajor) { Major = iMajor; }
void setMajorStr(std::string iMajor) { void setMajorStr(std::string iMajor) {
Major = StrToInt(iMajor); Major = StrToInt(iMajor);
} }
void setMinor(int iMinor) { Minor = iMinor; } void setMinor(int iMinor) { Minor = iMinor; }
void setMinorStr(std::string iMinor) { void setMinorStr(std::string iMinor) {
Minor = StrToInt(iMinor); Minor = StrToInt(iMinor);
}
void setPatch(int iPatch) { Patch = iPatch; }
void setPatchStr(std::string iPatch) {
Patch = StrToInt(iPatch);
} }
}; };
......
...@@ -14,11 +14,16 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/CMake/VersionSuite) ...@@ -14,11 +14,16 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/CMake/VersionSuite)
# Default incase CalculateVerison is not called # Default incase CalculateVerison is not called
SET(vMajor "0") SET(vMajor "0")
SET(vMinor "0") SET(vMinor "0")
SET(vPatch "0")
# This Macro allows you to set up the Version in a one liner # This Macro allows you to set up the Version in a one liner
MACRO(VersionCreate versionName versionMajor export_name) MACRO(VersionCreate versionName versionMajor versionMinor versionPatch export_name)
VersionMajorSet(${versionMajor}) VersionMajorSet(${versionMajor})
VersionCalculate() VersionMinorSet(${versionMinor})
VersionPatchSet(${versionPatch})
# Manually generating minor version
# VersionCalculate()
VersionWrite(${versionName} ${export_name} "${ARGN}") VersionWrite(${versionName} ${export_name} "${ARGN}")
ENDMACRO(VersionCreate versionName versionMajor export_name) ENDMACRO(VersionCreate versionName versionMajor export_name)
...@@ -27,6 +32,14 @@ MACRO(VersionMajorSet versionMajor) ...@@ -27,6 +32,14 @@ MACRO(VersionMajorSet versionMajor)
SET(vMajor ${versionMajor}) SET(vMajor ${versionMajor})
ENDMACRO(VersionMajorSet) ENDMACRO(VersionMajorSet)
MACRO(VersionMinorSet versionMinor)
SET(vMinor ${versionMinor})
ENDMACRO(VersionMinorSet)
MACRO(VersionPatchSet versionPatch)
SET(vPatch ${versionPatch})
ENDMACRO(VersionPatchSet)
# This Macro calculates the number of tags from your git repo # This Macro calculates the number of tags from your git repo
MACRO(VersionCalculate) MACRO(VersionCalculate)
FIND_PACKAGE(Git) FIND_PACKAGE(Git)
...@@ -53,6 +66,7 @@ MACRO(VersionWrite vProjectName export_name) ...@@ -53,6 +66,7 @@ MACRO(VersionWrite vProjectName export_name)
"/* Current Version of ${vProjectName} "/* Current Version of ${vProjectName}
* Major is: ${vMajor} * Major is: ${vMajor}
* Minor is: ${vMinor} * Minor is: ${vMinor}
* Patch is: ${vPatch}
*/ */
${includes} ${includes}
\#include \"ProjectVersion.hpp\" \#include \"ProjectVersion.hpp\"
...@@ -64,6 +78,6 @@ extern ${export_name} ProjectVersion ${vProjectName}Version;\n" ...@@ -64,6 +78,6 @@ extern ${export_name} ProjectVersion ${vProjectName}Version;\n"
* Make sure to include this file in your built sources * Make sure to include this file in your built sources
*/ */
\#include \"${vProjectName}Version.hpp\" \#include \"${vProjectName}Version.hpp\"
ProjectVersion ${vProjectName}Version = ProjectVersion(\"${vProjectName}\", \"${vMajor}\", \"${vMinor}\");\n" ProjectVersion ${vProjectName}Version = ProjectVersion(\"${vProjectName}\", \"${vMajor}\", \"${vMinor}\", \"${vPatch}\");\n"
) )
ENDMACRO(VersionWrite vProjectName export_name) ENDMACRO(VersionWrite vProjectName export_name)
...@@ -12,7 +12,16 @@ if(MSVC10) ...@@ -12,7 +12,16 @@ if(MSVC10)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
endif(MSVC10) endif(MSVC10)
set(BUILD_SHARED_LIBS true) option(BUILD_SHARED_LIBS ON PARENT_SCOPE)
if (BUILD_SHARED_LIBS)
STRING(REGEX MATCH "-fPIC" IS_FPIC "${CMAKE_CXX_FLAGS}")
if ("${IS_FPIC}" STREQUAL "")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif ("${IS_FPIC}" STREQUAL "")
add_definitions(-DXDMFSTATIC)
endif (BUILD_SHARED_LIBS)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
...@@ -49,6 +58,19 @@ endif(BUILD_TESTING) ...@@ -49,6 +58,19 @@ endif(BUILD_TESTING)
option(XDMF_WRAP_PYTHON OFF) option(XDMF_WRAP_PYTHON OFF)
option(XDMF_WRAP_JAVA OFF) option(XDMF_WRAP_JAVA OFF)
#check for TIFF
find_package(TIFF)
if (TIFF_FOUND)
add_definitions(-DXDMF_BUILD_TIFF)
mark_as_advanced(FORCE TIFF_INCLUDE_DIR)
mark_as_advanced(FORCE TIFF_LIBRARIES)
mark_as_advanced(FORCE TIFF_LIBRARY)
include_directories(${TIFF_INCLUDE_DIR})
get_filename_component(TIFF_LIBRARY_DIR "${TIFF_LIBRARY}" PATH)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} ${TIFF_LIBRARY_DIR})
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${TIFF_LIBRARIES})
endif (TIFF_FOUND)
# Test for DSM # Test for DSM
option(XDMF_BUILD_DSM OFF) option(XDMF_BUILD_DSM OFF)
...@@ -70,6 +92,7 @@ if(XDMF_BUILD_DSM) ...@@ -70,6 +92,7 @@ if(XDMF_BUILD_DSM)
mark_as_advanced(FORCE PYTHON_INCLUDE_MPI4PY_DIR) mark_as_advanced(FORCE PYTHON_INCLUDE_MPI4PY_DIR)
set(PYTHON_INCLUDE_MPI4PY_DIR "" CACHE STRING "Directory containing mpi4py/mpi4py.i") set(PYTHON_INCLUDE_MPI4PY_DIR "" CACHE STRING "Directory containing mpi4py/mpi4py.i")
endif (XDMF_WRAP_PYTHON) endif (XDMF_WRAP_PYTHON)
add_definitions(-DXDMF_BUILD_DSM)
endif(XDMF_BUILD_DSM) endif(XDMF_BUILD_DSM)
# If we are wrapping either, we need swig # If we are wrapping either, we need swig
...@@ -146,7 +169,6 @@ if(XDMF_WRAP_PYTHON) ...@@ -146,7 +169,6 @@ if(XDMF_WRAP_PYTHON)
PROPERTIES PROPERTIES
OUTPUT_NAME "_${python_name}") OUTPUT_NAME "_${python_name}")
string(TOUPPER ${python_name} python_name_upper) string(TOUPPER ${python_name} python_name_upper)
set(${python_name_upper}_PYTHON set(${python_name_upper}_PYTHON
${CMAKE_INSTALL_PREFIX}/lib/python/${python_name}.py) ${CMAKE_INSTALL_PREFIX}/lib/python/${python_name}.py)
...@@ -257,6 +279,7 @@ link_directories(${XDMF_LIBRARY_DIRS}) ...@@ -257,6 +279,7 @@ link_directories(${XDMF_LIBRARY_DIRS})
option(XDMF_BUILD_CORE_ONLY OFF) option(XDMF_BUILD_CORE_ONLY OFF)
if(NOT XDMF_BUILD_CORE_ONLY) if(NOT XDMF_BUILD_CORE_ONLY)
set(XdmfSources set(XdmfSources
XdmfAggregate
XdmfAttribute XdmfAttribute
XdmfAttributeCenter XdmfAttributeCenter
XdmfAttributeType XdmfAttributeType
...@@ -268,6 +291,7 @@ if(NOT XDMF_BUILD_CORE_ONLY) ...@@ -268,6 +291,7 @@ if(NOT XDMF_BUILD_CORE_ONLY)
XdmfGrid XdmfGrid
XdmfGridCollection XdmfGridCollection
XdmfGridCollectionType XdmfGridCollectionType
XdmfGridController
XdmfItemFactory XdmfItemFactory
XdmfMap XdmfMap
XdmfReader XdmfReader
...@@ -280,24 +304,50 @@ if(NOT XDMF_BUILD_CORE_ONLY) ...@@ -280,24 +304,50 @@ if(NOT XDMF_BUILD_CORE_ONLY)
XdmfTopologyType XdmfTopologyType
XdmfUnstructuredGrid) XdmfUnstructuredGrid)
add_library(Xdmf ${XdmfSources}) add_library(XdmfObjects OBJECT ${XdmfSources})
add_library(Xdmf $<TARGET_OBJECTS:XdmfObjects>)
if (BUILD_SHARED_LIBS)
add_library(Xdmf_Static STATIC $<TARGET_OBJECTS:XdmfObjects>)
if (UNIX)
set_target_properties(Xdmf_Static PROPERTIES
OUTPUT_NAME "Xdmf")
endif (UNIX)
endif (BUILD_SHARED_LIBS)
if(XDMF_BUILD_DSM) if(XDMF_BUILD_DSM)
target_link_libraries(Xdmf XdmfCore XdmfDSM) target_link_libraries(Xdmf XdmfCore XdmfDSM)
if (BUILD_SHARED_LIBS)
target_link_libraries(Xdmf_Static XdmfCore_Static XdmfDSM_Static)
endif (BUILD_SHARED_LIBS)
else(XDMF_BUILD_DSM) else(XDMF_BUILD_DSM)
target_link_libraries(Xdmf XdmfCore) target_link_libraries(Xdmf XdmfCore)
if (BUILD_SHARED_LIBS)
target_link_libraries(Xdmf_Static XdmfCore_Static)
endif (BUILD_SHARED_LIBS)
endif(XDMF_BUILD_DSM) endif(XDMF_BUILD_DSM)
if(WIN32) if(WIN32)
set_target_properties(Xdmf PROPERTIES set_target_properties(Xdmf PROPERTIES
DEFINE_SYMBOL Xdmf_EXPORTS) DEFINE_SYMBOL Xdmf_EXPORTS)
if (BUILD_SHARED_LIBS)
set_target_properties(Xdmf_Static PROPERTIES
DEFINE_SYMBOL Xdmf_EXPORTS)
endif (BUILD_SHARED_LIBS)
if(NOT MSVC10) if(NOT MSVC10)
set_target_properties(Xdmf PROPERTIES set_target_properties(Xdmf PROPERTIES
PREFIX ../ PREFIX ../
IMPORT_PREFIX ../ IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif(NOT MSVC10) if (BUILD_SHARED_LIBS)
set_target_properties(Xdmf_Static PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif (BUILD_SHARED_LIBS)
endif(NOT MSVC10)
endif(WIN32) endif(WIN32)
if(XDMF_WRAP_JAVA) if(XDMF_WRAP_JAVA)
...@@ -305,7 +355,15 @@ if(NOT XDMF_BUILD_CORE_ONLY) ...@@ -305,7 +355,15 @@ if(NOT XDMF_BUILD_CORE_ONLY)
endif(XDMF_WRAP_JAVA) endif(XDMF_WRAP_JAVA)
if(XDMF_WRAP_PYTHON) if(XDMF_WRAP_PYTHON)
XDMF_SWIG_PYTHON(Xdmf XdmfCore XdmfDSM) if (NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "Python Wrappers do not function"
" properly without shared libraries")
endif (NOT BUILD_SHARED_LIBS)
if (XDMF_BUILD_DSM)
XDMF_SWIG_PYTHON(Xdmf XdmfCore XdmfDSM)
else (XDMF_BUILD_DSM)
XDMF_SWIG_PYTHON(Xdmf XdmfCore)
endif (XDMF_BUILD_DSM)
set(XDMF_PYTHON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/python/) set(XDMF_PYTHON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/python/)
endif(XDMF_WRAP_PYTHON) endif(XDMF_WRAP_PYTHON)
...@@ -323,7 +381,11 @@ if(NOT XDMF_BUILD_CORE_ONLY) ...@@ -323,7 +381,11 @@ if(NOT XDMF_BUILD_CORE_ONLY)
endif(WIN32) endif(WIN32)
if(UNIX) if(UNIX)
set(XDMF_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libXdmf.so) if (BUILD_SHARED_LIBS)
set(XDMF_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libXdmf.so)
else (BUILD_SHARED_LIBS)
set(XDMF_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libXdmf.a)
endif (BUILD_SHARED_LIBS)
endif(UNIX) endif(UNIX)
if(APPLE) if(APPLE)
...@@ -342,6 +404,12 @@ if(NOT XDMF_BUILD_CORE_ONLY) ...@@ -342,6 +404,12 @@ if(NOT XDMF_BUILD_CORE_ONLY)
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib) ARCHIVE DESTINATION lib)
if (BUILD_SHARED_LIBS)
install(TARGETS Xdmf_Static
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif (BUILD_SHARED_LIBS)
endif(NOT XDMF_BUILD_CORE_ONLY) endif(NOT XDMF_BUILD_CORE_ONLY)
xdmf_create_config_file(${PROJECT_NAME}) xdmf_create_config_file(${PROJECT_NAME})
......
<?xml version="1.0" encoding="UTF-8"?>
<!--Root element of dataset-->
<!ELEMENT Xdmf (Information*, Domain+)>
<!ATTLIST Xdmf
Version CDATA #IMPLIED
>
<!--Contains domain data information-->
<!ELEMENT Domain (Information*, Grid+)>
<!ATTLIST Domain