Commit 46e1ff05 authored by Kitware Robot's avatar Kitware Robot Committed by Ben Boeckel

xdmf3 2018-12-11 (978126af)

Code extracted from:

    https://gitlab.kitware.com/third-party/xdmf.git

at commit 978126afd9376659340e0c315f8de138c6b297ac (for/vtk-20181211-master-gfe7dd1ca).
parent c368e870
* -whitespace
* -whitespace
#
# 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)
# - FindMPI4PY
# Find mpi4py includes and library
# This module defines:
# MPI4PY_INCLUDE_DIR, where to find mpi4py.h, etc.
# MPI4PY_FOUND
# https://compacc.fnal.gov/projects/repositories/entry/synergia2/CMake/FindMPI4PY.cmake?rev=c147eafb60728606af4fe7b1b161a660df142e9a
if(NOT MPI4PY_INCLUDE_DIR)
execute_process(COMMAND
"${PYTHON_EXECUTABLE}" "-c" "import mpi4py; print mpi4py.get_include()"
OUTPUT_VARIABLE MPI4PY_INCLUDE_DIR
RESULT_VARIABLE MPI4PY_COMMAND_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(MPI4PY_COMMAND_RESULT)
message("jfa: mpi4py not found")
set(MPI4PY_FOUND FALSE)
else(MPI4PY_COMMAND_RESULT)
if (MPI4PY_INCLUDE_DIR MATCHES "Traceback")
message("jfa: mpi4py matches traceback")
## Did not successfully include MPI4PY
set(MPI4PY_FOUND FALSE)
else (MPI4PY_INCLUDE_DIR MATCHES "Traceback")
## successful
set(MPI4PY_FOUND TRUE)
set(MPI4PY_INCLUDE_DIR ${MPI4PY_INCLUDE_DIR} CACHE STRING "mpi4py include path")
endif (MPI4PY_INCLUDE_DIR MATCHES "Traceback")
endif(MPI4PY_COMMAND_RESULT)
else(NOT MPI4PY_INCLUDE_DIR)
set(MPI4PY_FOUND TRUE)
endif(NOT MPI4PY_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MPI4PY DEFAULT_MSG MPI4PY_INCLUDE_DIR)
# - 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()
ENDMACRO()
# 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()
ENDMACRO()
# 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()
ENDMACRO()
# 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()
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()
ENDIF()
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()
ENDMACRO()
# 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()
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()
ENDIF()
ENDWHILE()
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()
file(COPY
${c_source_dir}/${script}
DESTINATION ${c_binary_dir}/
)
ENDMACRO()
# 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()
# 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()
ENDMACRO()
# 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()
ENDMACRO()
# 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()
ENDMACRO()
# 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()
IF(EXISTS ${cxx_source_dir}/${executable}.cxx)
ADD_EXECUTABLE(${executable}${dup} ${cxx_source_dir}/${executable}.cxx)
ENDIF()
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()
ENDIF()
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()
ENDMACRO()
# 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()
IF(EXISTS ${cxx_source_dir}/${executable}.cxx)
ADD_EXECUTABLE(${executable} ${cxx_source_dir}/${executable}.cxx)
ENDIF()
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()
ENDIF()
ENDWHILE()
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()
file(COPY
${cxx_source_dir}/${script}
DESTINATION ${cxx_binary_dir}/
)
ENDMACRO()
# 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()
# 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()
ENDMACRO()
# 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()
ENDMACRO()
# 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()
ENDMACRO()
# 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()
IF(EXISTS ${fortran_source_dir}/${executable}.f90)
ADD_EXECUTABLE(${executable} ${fortran_source_dir}/${executable}.f90)
ENDIF()
IF(EXISTS ${fortran_source_dir}/${executable}.F90)
ADD_EXECUTABLE(${executable} ${fortran_source_dir}/${executable}.F90)
ENDIF()
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()
ENDIF()
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()
ENDMACRO()
# 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()
IF(EXISTS ${fortran_source_dir}/${executable}.f90)
ADD_EXECUTABLE(${executable} ${fortran_source_dir}/${executable}.f90)
ENDIF()
IF(EXISTS ${fortran_source_dir}/${executable}.F90)
ADD_EXECUTABLE(${executable} ${fortran_source_dir}/${executable}.F90)
ENDIF()
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()
ENDIF()
ENDWHILE()
SET_CORE("${fortran_binary_dir}")
ADD_TEST(FORTRAN${is_core}_${script} ${CMAKE_COMMAND}
-D "EXECUTABLE='./${script}'"
-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}_${script}
PROPERTIES DEPENDS ${tdep} ${script})
ENDIF()
file(COPY
${fortran_source_dir}/${script}
DESTINATION ${fortran_binary_dir}/
)
ENDMACRO()
# Fortran Clean Macro
# Author: Brian Panneton
# Description: This macro sets up the fortran test for a make clean.
# Parameters:
# executable = executable name
# ${ARGN} = files that the executable created
MACRO(CLEAN_TEST_FORTRAN executable)
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES ${ARGN}
)
ENDMACRO()
# Configure the Fortran 'driver' file
CONFIGURE_FILE(${TESTING_SUITE_DIR}/TestingSuite/TestDriverFortran.cmake.in ${fortran_binary_dir}/TestDriverFortran.cmake @ONLY)
INCLUDE(TestingSetup)
# Variables that are set externally
SET(java_binary_dir ${CMAKE_CURRENT_BINARY_DIR})
SET(java_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
# Java Add Dependencies Macro
# Author: Brian Panneton
# Description: This macro adds the java test dependencies.
# Parameters:
# dependencies = any target dependencies needed for java tests
MACRO(ADD_TEST_JAVA_DEPENDENCIES dependencies)
IF(NOT ("${dependencies}" STREQUAL ""))
SET_PROPERTY(GLOBAL APPEND PROPERTY JAVA_TEST_DEPENDENCIES
"${dependencies}"
)
ENDIF()
ENDMACRO()
# Java Add File Dependencies Macro
# Author: Brian Panneton
# Description: This macro adds the java test file dependencies.
# Note: The tests already depend on their own file
# Parameters:
# dependencies = any dependencies needed for java tests
MACRO(ADD_TEST_JAVA_FILE_DEPENDENCIES dependencies)
IF(NOT ("${dependencies}" STREQUAL ""))
SET_PROPERTY(GLOBAL APPEND PROPERTY JAVA_TEST_FILE_DEPENDENCIES
"${dependencies}"
)
ENDIF()
ENDMACRO()
# Java Add Classpath Macro
# Author: Brian Panneton
# Description: This macro adds the java test classpaths.
# Parameters:
# cp = any classpaths needed for java tests
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}${sep}${cp}"
)
ENDIF()
ENDMACRO()
# Java Add LDPath Macro
# Author: Brian Panneton
# Description: This macro adds the java test ldpaths.
# Parameters:
# ld = any ldpaths needed for java tests
MACRO(ADD_TEST_JAVA_L