Commit 3fa4d337 authored by XDMF Developers's avatar XDMF Developers Committed by Dave DeMarle

export xdmf for import into vtk

extracted with:
    sha1=975536e3d94f08b06b002452a5ed575dc6eb0fc9 &&
    paths='
    CMake
    CMakeLists.txt
    CTestConfig.cmake
    Copyright.txt
    Xdmf.hpp
    XdmfAttribute.cpp
    XdmfAttribute.hpp
    XdmfAttributeCenter.cpp
    XdmfAttributeCenter.hpp
    XdmfAttributeType.cpp
    XdmfAttributeType.hpp
    XdmfConfig.cmake.in
    XdmfCurvilinearGrid.cpp
    XdmfCurvilinearGrid.hpp
    XdmfDomain.cpp
    XdmfDomain.hpp
    XdmfGeometry.cpp
    XdmfGeometry.hpp
    XdmfGeometryType.cpp
    XdmfGeometryType.hpp
    XdmfGraph.cpp
    XdmfGraph.hpp
    XdmfGrid.cpp
    XdmfGrid.hpp
    XdmfGridCollection.cpp
    XdmfGridCollection.hpp
    XdmfGridCollectionType.cpp
    XdmfGridCollectionType.hpp
    XdmfItemFactory.cpp
    XdmfItemFactory.hpp
    XdmfMap.cpp
    XdmfMap.hpp
    XdmfReader.cpp
    XdmfReader.hpp
    XdmfRectilinearGrid.cpp
    XdmfRectilinearGrid.hpp
    XdmfRegularGrid.cpp
    XdmfRegularGrid.hpp
    XdmfSet.cpp
    XdmfSet.hpp
    XdmfSetType.cpp
    XdmfSetType.hpp
    XdmfTime.cpp
    XdmfTime.hpp
    XdmfTopology.cpp
    XdmfTopology.hpp
    XdmfTopologyType.cpp
    XdmfTopologyType.hpp
    XdmfUnstructuredGrid.cpp
    XdmfUnstructuredGrid.hpp
    core/CMakeLists.txt
    core/XdmfArray.cpp
    core/XdmfArray.hpp
    core/XdmfArray.tpp
    core/XdmfArrayReference.cpp
    core/XdmfArrayReference.hpp
    core/XdmfArrayType.cpp
    core/XdmfArrayType.hpp
    core/XdmfBinaryController.cpp
    core/XdmfBinaryController.hpp
    core/XdmfConfig.hpp.in
    core/XdmfCore.hpp
    core/XdmfCoreItemFactory.cpp
    core/XdmfCoreItemFactory.hpp
    core/XdmfCoreReader.cpp
    core/XdmfCoreReader.hpp
    core/XdmfError.cpp
    core/XdmfError.hpp
    core/XdmfFunction.cpp
    core/XdmfFunction.hpp
    core/XdmfHDF5Controller.cpp
    core/XdmfHDF5Controller.hpp
    core/XdmfHDF5Writer.cpp
    core/XdmfHDF5Writer.hpp
    core/XdmfHeavyDataController.cpp
    core/XdmfHeavyDataController.hpp
    core/XdmfHeavyDataWriter.cpp
    core/XdmfHeavyDataWriter.hpp
    core/XdmfInformation.cpp
    core/XdmfInformation.hpp
    core/XdmfItem.cpp
    core/XdmfItem.hpp
    core/XdmfItemProperty.cpp
    core/XdmfItemProperty.hpp
    core/XdmfSharedPtr.hpp
    core/XdmfSparseMatrix.cpp
    core/XdmfSparseMatrix.hpp
    core/XdmfSubset.cpp
    core/XdmfSubset.hpp
    core/XdmfSystemUtils.cpp
    core/XdmfSystemUtils.hpp
    core/XdmfVisitor.cpp
    core/XdmfVisitor.hpp
    core/XdmfWriter.cpp
    core/XdmfWriter.hpp
    core/loki
    core/dsm/CMakeLists.txt
    core/dsm/XdmfDSM.hpp
    core/dsm/XdmfDSMBuffer.cpp
    core/dsm/XdmfDSMBuffer.hpp
    core/dsm/XdmfDSMCommMPI.cpp
    core/dsm/XdmfDSMCommMPI.hpp
    core/dsm/XdmfDSMDriver.cpp
    core/dsm/XdmfDSMDriver.hpp
    core/dsm/XdmfDSMManager.cpp
    core/dsm/XdmfDSMManager.hpp
    core/dsm/XdmfHDF5ControllerDSM.cpp
    core/dsm/XdmfHDF5ControllerDSM.hpp
    core/dsm/XdmfHDF5WriterDSM.cpp
    core/dsm/XdmfHDF5WriterDSM.hpp
    ' &&
    git archive --prefix=xdmf3-reduced/ $sha1 -- $paths |
    tar x

Change-Id: I8c3dd91dc165a592f7dc3d2898ddf1d18db45811
parents
#
# Find the Exodus finite element data model library from Sandia
#
# EXODUS_FOUND - System has Exodus
# EXODUS_INCLUDE_DIR - The LibXml2 include directory
# EXODUS_LIBRARIES - The libraries needed to use LibXml2
FIND_PACKAGE(NetCDF REQUIRED)
FIND_PATH(EXODUS_INCLUDE_DIR NAMES exodusII.h)
FIND_LIBRARY(EXODUS_LIBRARIES NAMES exodusii exodusIIv2c)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set EXODUS_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Exodus DEFAULT_MSG EXODUS_LIBRARIES EXODUS_INCLUDE_DIR)
MARK_AS_ADVANCED(EXODUS_INCLUDE_DIR EXODUS_LIBRARIES)
# - Try to find the Metis graph partitioning library
# Once done this will define
#
# METIS_FOUND - System has metis
# METIS_INCLUDE_DIR - The metis include directory
# METIS_LIBRARIES - The libraries needed to use metis
FIND_PATH(METIS_INCLUDE_DIR NAMES metis.h)
FIND_LIBRARY(METIS_LIBRARIES NAMES metis)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Metis DEFAULT_MSG METIS_LIBRARIES METIS_INCLUDE_DIR)
MARK_AS_ADVANCED(METIS_INCLUDE_DIR METIS_LIBRARIES)
#
# Find NetCDF include directories and libraries
#
# NetCDF_FOUND - System has NetCDF
# NetCDF_INCLUDE_DIR - The NetCDF include directory
# NetCDF_LIBRARIES - The libraries needed to use NetCDF
FIND_PATH(NetCDF_INCLUDE_DIR netcdf.h)
FIND_LIBRARY(NetCDF_LIBRARIES
NAMES netcdf
${NetCDF_PREFIX}
${NetCDF_PREFIX}/lib64
${NetCDF_PREFIX}/lib
/usr/local/lib64
/usr/lib64
/usr/lib64/netcdf-3
/usr/local/lib
/usr/lib
/usr/lib/netcdf-3
)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set EXODUS_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NetCDF DEFAULT_MSG NetCDF_INCLUDE_DIR NetCDF_LIBRARIES)
MARK_AS_ADVANCED(NetCDF_INCLUDE_DIR NetCDF_LIBRARIES)
INCLUDE(TestingSetup)
# We should have one place that points to the c source directory and the c
# binary directory
SET(c_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
SET(c_binary_dir ${CMAKE_CURRENT_BINARY_DIR})
# C Add Dependencies Macro
# Author: Brian Panneton
# Description: This macro adds the c test dependencies.
# Note: The tests already depend on their own file
# Parameters:
# dependencies = any dependencies needed for c tests
MACRO(ADD_TEST_C_DEPENDENCIES dependencies)
IF(NOT ("${dependencies}" STREQUAL ""))
SET_PROPERTY(GLOBAL APPEND PROPERTY C_TEST_DEPENDENCIES
"${dependencies}"
)
ENDIF(NOT ("${dependencies}" STREQUAL ""))
ENDMACRO(ADD_TEST_C_DEPENDENCIES dependencies)
# C Add LDPath Macro
# Author: Brian Panneton
# Description: This macro adds the c test ldpaths.
# Parameters:
# ld = any ldpaths needed for c tests
MACRO(ADD_TEST_C_LDPATH ld)
GET_PROPERTY(ldpath GLOBAL PROPERTY C_TEST_LDPATH)
IF("${ld}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY C_TEST_LDPATH
"${ldpath}${sep}${ld}"
)
ENDIF("${ld}" STRGREATER "")
ENDMACRO(ADD_TEST_C_LDPATH ld)
# C Add Path Macro
# Author: Brian Panneton
# Description: This macro adds the c test paths.
# Parameters:
# p = any paths needed for c tests
MACRO(ADD_TEST_C_PATH p)
GET_PROPERTY(path GLOBAL PROPERTY C_TEST_PATH)
IF("${p}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY C_TEST_PATH
"${path}${sep}${p}"
)
ENDIF("${p}" STRGREATER "")
ENDMACRO(ADD_TEST_C_PATH p)
# C Test Macro
# Author: Brian Panneton
# Description: This macro builds and add the c test in one shot.
# Parameters:
# executable = executable name
# dup = duplicate number
# tdep = test dependency (Full Test Name with Prefix)
# ${ARGN} = any arguments for the executable
MACRO(ADD_TEST_C executable)
PARSE_TEST_ARGS("${ARGN}")
IF(EXISTS ${c_source_dir}/${executable}.c)
ADD_EXECUTABLE(${executable}${dup} ${c_source_dir}/${executable}.c)
ENDIF(EXISTS ${c_source_dir}/${executable}.c)
GET_PROPERTY(c_dependencies GLOBAL PROPERTY C_TEST_DEPENDENCIES)
GET_PROPERTY(c_ldpath GLOBAL PROPERTY C_TEST_LDPATH)
GET_PROPERTY(c_path GLOBAL PROPERTY C_TEST_PATH)
TARGET_LINK_LIBRARIES(${executable}${dup} ${c_dependencies})
# Take care of windowisims
IF(WIN32)
SET_TARGET_PROPERTIES(${executable}${dup} PROPERTIES
PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${c_binary_dir}
LIBRARY_OUTPUT_DIRECTORY ${c_binary_dir}
ARCHIVE_OUTPUT_DIRECTORY ${c_binary_dir})
IF("${c_path}" STREQUAL "")
SET(c_path ${c_ldpath})
ENDIF("${c_path}" STREQUAL "")
ENDIF(WIN32)
SET_CORE("${c_binary_dir}")
ADD_TEST(C${is_core}_${executable}${dup} ${CMAKE_COMMAND}
-D "EXECUTABLE=${executable}${dup}"
-D "ARGUMENTS=${arguments}"
-D "LDPATH=${c_ldpath}"
-D "PATH=${c_path}"
-D "SEPARATOR=${sep}"
-P "${c_binary_dir}/TestDriverC.cmake"
)
IF(NOT "${tdep}" STREQUAL "")
SET_TESTS_PROPERTIES(C${is_core}_${executable}${dup}
PROPERTIES DEPENDS ${tdep})
ENDIF(NOT "${tdep}" STREQUAL "")
ENDMACRO(ADD_TEST_C executable)
# C MPI Test Macro
# Author: Andrew Burns
# Description: This macro builds and adds a script to execute MPI tests.
# Parameters:
# executable = script name
# files = code to be compiled and executed by the script
# tdep = test dependency (Full Test Name with Prefix)
# ${ARGN} = any arguments for the executable
MACRO(ADD_MPI_TEST_C script files)
PARSE_TEST_ARGS("${ARGN}")
set(tempfiles ${files})
WHILE(NOT "${tempfiles}" STREQUAL "")
# ${executable}
STRING(REGEX MATCH "([^ ,])+,|([^ ,])+" executable "${tempfiles}")
STRING(REGEX REPLACE "," "" executable "${executable}")
STRING(REGEX REPLACE "${executable},|${executable}" "" trimmed "${tempfiles}")
set(tempfiles ${trimmed})
IF(EXISTS ${c_source_dir}/${executable}.c)
ADD_EXECUTABLE(${executable} ${c_source_dir}/${executable}.c)
ENDIF(EXISTS ${c_source_dir}/${executable}.c)
GET_PROPERTY(c_dependencies GLOBAL PROPERTY C_TEST_DEPENDENCIES)
GET_PROPERTY(c_ldpath GLOBAL PROPERTY C_TEST_LDPATH)
GET_PROPERTY(c_path GLOBAL PROPERTY C_TEST_PATH)
TARGET_LINK_LIBRARIES(${executable} ${c_dependencies})
# Take care of windowisims
IF(WIN32)
SET_TARGET_PROPERTIES(${executable} PROPERTIES
PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${c_binary_dir}
LIBRARY_OUTPUT_DIRECTORY ${c_binary_dir}
ARCHIVE_OUTPUT_DIRECTORY ${c_binary_dir})
IF("${c_path}" STREQUAL "")
SET(c_path ${c_ldpath})
ENDIF("${c_path}" STREQUAL "")
ENDIF(WIN32)
ENDWHILE(NOT "${tempfiles}" STREQUAL "")
SET_CORE("${c_binary_dir}")
ADD_TEST(C${is_core}_${script} ${CMAKE_COMMAND}
-D "EXECUTABLE='./${script}'"
-D "ARGUMENTS=${arguments}"
-D "LDPATH=${c_ldpath}"
-D "PATH=${c_path}"
-D "SEPARATOR=${sep}"
-P "${c_binary_dir}/TestDriverC.cmake"
)
IF(NOT "${tdep}" STREQUAL "")
SET_TESTS_PROPERTIES(C${is_core}_${script}
PROPERTIES DEPENDS ${tdep} ${script})
ENDIF(NOT "${tdep}" STREQUAL "")
file(COPY
${c_source_dir}/${script}
DESTINATION ${c_binary_dir}/
)
ENDMACRO(ADD_MPI_TEST_C script files)
# C Clean Macro
# Author: Brian Panneton
# Description: This macro sets up the c test for a make clean.
# Parameters:
# executable = executable name
# ${ARGN} = files that the executable created
MACRO(CLEAN_TEST_C executable)
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES ${ARGN}
)
ENDMACRO(CLEAN_TEST_C executable)
# Configure the c 'driver' file
CONFIGURE_FILE(${TESTING_SUITE_DIR}/TestingSuite/TestDriverC.cmake.in ${c_binary_dir}/TestDriverC.cmake @ONLY)
INCLUDE(TestingSetup)
# We should have one place that points to the cxx source directory and the cxx
# binary directory
SET(cxx_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
SET(cxx_binary_dir ${CMAKE_CURRENT_BINARY_DIR})
# CXX Add Dependencies Macro
# Author: Brian Panneton
# Description: This macro adds the cxx test dependencies.
# Note: The tests already depend on their own file
# Parameters:
# dependencies = any dependencies needed for cxx tests
MACRO(ADD_TEST_CXX_DEPENDENCIES dependencies)
IF(NOT ("${dependencies}" STREQUAL ""))
SET_PROPERTY(GLOBAL APPEND PROPERTY CXX_TEST_DEPENDENCIES
"${dependencies}"
)
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.
# Parameters:
# executable = executable name
# dup = duplicate number
# tdep = test dependency (Full Test Name with Prefix)
# ${ARGN} = any arguments for the executable
MACRO(ADD_TEST_CXX executable)
PARSE_TEST_ARGS("${ARGN}")
IF(EXISTS ${cxx_source_dir}/${executable}.cpp)
ADD_EXECUTABLE(${executable}${dup} ${cxx_source_dir}/${executable}.cpp)
ENDIF(EXISTS ${cxx_source_dir}/${executable}.cpp)
IF(EXISTS ${cxx_source_dir}/${executable}.cxx)
ADD_EXECUTABLE(${executable}${dup} ${cxx_source_dir}/${executable}.cxx)
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} ${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"
)
IF(NOT "${tdep}" STREQUAL "")
SET_TESTS_PROPERTIES(Cxx${is_core}_${executable}${dup}
PROPERTIES DEPENDS ${tdep})
ENDIF(NOT "${tdep}" STREQUAL "")
ENDMACRO(ADD_TEST_CXX executable)
# CXX MPI Test Macro
# Author: Andrew Burns
# Description: This macro builds and adds a script to execute MPI tests.
# Parameters:
# executable = script name
# files = code to be compiled and executed by the script
# tdep = test dependency (Full Test Name with Prefix)
# ${ARGN} = any arguments for the executable
MACRO(ADD_MPI_TEST_CXX script files)
PARSE_TEST_ARGS("${ARGN}")
set(tempfiles ${files})
WHILE(NOT "${tempfiles}" STREQUAL "")
# ${executable}
STRING(REGEX MATCH "([^ ,])+,|([^ ,])+" executable "${tempfiles}")
STRING(REGEX REPLACE "," "" executable "${executable}")
STRING(REGEX REPLACE "${executable},|${executable}" "" trimmed "${tempfiles}")
set(tempfiles ${trimmed})
IF(EXISTS ${cxx_source_dir}/${executable}.cpp)
ADD_EXECUTABLE(${executable} ${cxx_source_dir}/${executable}.cpp)
ENDIF(EXISTS ${cxx_source_dir}/${executable}.cpp)
IF(EXISTS ${cxx_source_dir}/${executable}.cxx)
ADD_EXECUTABLE(${executable} ${cxx_source_dir}/${executable}.cxx)
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} ${cxx_dependencies})
# Take care of windowisims
IF(WIN32)
SET_TARGET_PROPERTIES(${executable} 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)
ENDWHILE(NOT "${tempfiles}" STREQUAL "")
SET_CORE("${cxx_binary_dir}")
ADD_TEST(Cxx${is_core}_${script} ${CMAKE_COMMAND}
-D "EXECUTABLE='./${script}'"
-D "ARGUMENTS=${arguments}"
-D "LDPATH=${cxx_ldpath}"
-D "PATH=${cxx_path}"
-D "SEPARATOR=${sep}"
-P "${cxx_binary_dir}/TestDriverCxx.cmake"
)
IF(NOT "${tdep}" STREQUAL "")
SET_TESTS_PROPERTIES(Cxx${is_core}_${script}
PROPERTIES DEPENDS ${tdep} ${script})
ENDIF(NOT "${tdep}" STREQUAL "")
file(COPY
${cxx_source_dir}/${script}
DESTINATION ${cxx_binary_dir}/
)
ENDMACRO(ADD_MPI_TEST_CXX script files)
# CXX Clean Macro
# Author: Brian Panneton
# Description: This macro sets up the cxx test for a make clean.
# Parameters:
# executable = executable name
# ${ARGN} = files that the executable created
MACRO(CLEAN_TEST_CXX executable)
set_property(DIRECTORY APPEND PROPERTY
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)
INCLUDE(TestingSetup)
# We should have one place that points to the fortran source directory and the fortran
# binary directory
SET(fortran_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
SET(fortran_binary_dir ${CMAKE_CURRENT_BINARY_DIR})
# Fortran Add Dependencies Macro
# Author: Brian Panneton
# Description: This macro adds the fortran test dependencies.
# Note: The tests already depend on their own file
# Parameters:
# dependencies = any dependencies needed for fortran tests
MACRO(ADD_TEST_FORTRAN_DEPENDENCIES dependencies)
IF(NOT ("${dependencies}" STREQUAL ""))
SET_PROPERTY(GLOBAL APPEND PROPERTY FORTRAN_TEST_DEPENDENCIES
"${dependencies}"
)
ENDIF(NOT ("${dependencies}" STREQUAL ""))
ENDMACRO(ADD_TEST_FORTRAN_DEPENDENCIES dependencies)
# Fortran Add LDPath Macro
# Author: Brian Panneton
# Description: This macro adds the fortran test ldpaths.
# Parameters:
# ld = any ldpaths needed for fortran tests
MACRO(ADD_TEST_FORTRAN_LDPATH ld)
GET_PROPERTY(ldpath GLOBAL PROPERTY FORTRAN_TEST_LDPATH)
IF("${ld}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY FORTRAN_TEST_LDPATH
"${ldpath}${sep}${ld}"
)
ENDIF("${ld}" STRGREATER "")
ENDMACRO(ADD_TEST_FORTRAN_LDPATH ld)
# Fortran Add Path Macro
# Author: Brian Panneton
# Description: This macro adds the fortran test paths.
# Parameters:
# p = any paths needed for fortran tests
MACRO(ADD_TEST_FORTRAN_PATH p)
GET_PROPERTY(path GLOBAL PROPERTY FORTRAN_TEST_PATH)
IF("${p}" STRGREATER "")
SET_PROPERTY(GLOBAL PROPERTY FORTRAN_TEST_PATH
"${path}${sep}${p}"
)
ENDIF("${p}" STRGREATER "")
ENDMACRO(ADD_TEST_FORTRAN_PATH p)
# Fortran Test Macro
# Author: Brian Panneton
# Description: This macro builds and add the fortran test in one shot.
# Parameters:
# executable = executable name
# dup = duplicate number
# tdep = test dependency (Full Test Name with Prefix)
# ${ARGN} = any arguments for the executable
MACRO(ADD_TEST_FORTRAN executable)
PARSE_TEST_ARGS("${ARGN}")
IF(EXISTS ${fortran_source_dir}/${executable}.f)
ADD_EXECUTABLE(${executable} ${fortran_source_dir}/${executable}.f)
ENDIF(EXISTS ${fortran_source_dir}/${executable}.f)
IF(EXISTS ${fortran_source_dir}/${executable}.f90)
ADD_EXECUTABLE(${executable} ${fortran_source_dir}/${executable}.f90)
ENDIF(EXISTS ${fortran_source_dir}/${executable}.f90)
GET_PROPERTY(fortran_dependencies GLOBAL PROPERTY FORTRAN_TEST_DEPENDENCIES)
GET_PROPERTY(fortran_ldpath GLOBAL PROPERTY FORTRAN_TEST_LDPATH)
GET_PROPERTY(fortran_path GLOBAL PROPERTY FORTRAN_TEST_PATH)
TARGET_LINK_LIBRARIES(${executable}${dup} ${fortran_dependencies})
# Take care of windowisims
IF(WIN32)
SET_TARGET_PROPERTIES(${executable}${dup} PROPERTIES
PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${fortran_binary_dir}
LIBRARY_OUTPUT_DIRECTORY ${fortran_binary_dir}
ARCHIVE_OUTPUT_DIRECTORY ${fortran_binary_dir})
IF("${fortran_path}" STREQUAL "")
SET(fortran_path ${fortran_ldpath})
ENDIF("${fortran_path}" STREQUAL "")
ENDIF(WIN32)
SET_CORE("${fortran_binary_dir}")
ADD_TEST(FORTRAN${is_core}_${executable}${dup} ${CMAKE_COMMAND}
-D "EXECUTABLE=${executable}${dup}"
-D "ARGUMENTS=${arguments}"
-D "LDPATH=${fortran_ldpath}"
-D "PATH=${fortran_path}"
-D "SEPARATOR=${sep}"
-P "${fortran_binary_dir}/TestDriverFortran.cmake"
)
IF(NOT "${tdep}" STREQUAL "")
SET_TESTS_PROPERTIES(FORTRAN${is_core}_${executable}${dup}
PROPERTIES DEPENDS ${tdep})
ENDIF(NOT "${tdep}" STREQUAL "")
ENDMACRO(ADD_TEST_FORTRAN executable)
# Fortran MPI Test Macro
# Author: Andrew Burns
# Description: This macro builds and adds a script to execute MPI tests.
# Parameters:
# executable = script name
# files = code to be compiled and executed by the script
# tdep = test dependency (Full Test Name with Prefix)
# ${ARGN} = any arguments for the executable
MACRO(ADD_MPI_TEST_FORTRAN script files)
PARSE_TEST_ARGS("${ARGN}")
set(tempfiles ${files})
WHILE(NOT "${tempfiles}" STREQUAL "")
# ${executable}
STRING(REGEX MATCH "([^ ,])+,|([^ ,])+" executable "${tempfiles}")
STRING(REGEX REPLACE "," "" executable "${executable}")
STRING(REGEX REPLACE "${executable},|${executable}" "" trimmed "${tempfiles}")
set(tempfiles ${trimmed})
IF(EXISTS ${fortran_source_dir}/${executable}.f)
ADD_EXECUTABLE(${executable} ${fortran_source_dir}/${executable}.f)
ENDIF(EXISTS ${fortran_source_dir}/${executable}.f)
IF(EXISTS ${fortran_source_dir}/${executable}.f90)
ADD_EXECUTABLE(${executable} ${fortran_source_dir}/${executable}.f90)
ENDIF(EXISTS ${fortran_source_dir}/${executable}.f90)
GET_PROPERTY(fortran_dependencies GLOBAL PROPERTY FORTRAN_TEST_DEPENDENCIES)
GET_PROPERTY(fortran_ldpath GLOBAL PROPERTY FORTRAN_TEST_LDPATH)
GET_PROPERTY(fortran_path GLOBAL PROPERTY FORTRAN_TEST_PATH)
TARGET_LINK_LIBRARIES(${executable} ${fortran_dependencies})
# Take care of windowisims
IF(WIN32)
SET_TARGET_PROPERTIES(${executable} PROPERTIES
PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${fortran_binary_dir}
LIBRARY_OUTPUT_DIRECTORY ${fortran_binary_dir}
ARCHIVE_OUTPUT_DIRECTORY ${fortran_binary_dir})
IF("${fortran_path}" STREQUAL "")
SET(fortran_path ${fortran_ldpath})
ENDIF("${fortran_path}" STREQUAL "")
ENDIF(WIN32)
ENDWHILE(NOT "${tempfiles}" STREQUAL "")