Commit 30a38ee2 authored by spear's avatar spear

Added XdmfFunctions.cmake macro, modified XdmfConfig, Added function call and...

Added XdmfFunctions.cmake macro, modified XdmfConfig, Added function call and file copy for the XdmfConfig file to the CMakeLists.txt
parent 0ae7134a
......@@ -14,6 +14,8 @@ set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake/VersionSuite
)
include("${CMAKE_CURRENT_SOURCE_DIR}/XdmfFunctions.cmake")
# Should we build with documentation
option(XDMF_BUILD_DOCUMENTATION OFF)
if(XDMF_BUILD_DOCUMENTATION)
......@@ -249,6 +251,6 @@ if(NOT XDMF_BUILD_CORE_ONLY)
)
endif(NOT XDMF_BUILD_CORE_ONLY)
configure_file(${CMAKE_BINARY_DIR}/XdmfConfig.cmake.in
${CMAKE_BINARY_DIR}/XdmfConfig.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/XdmfConfig.cmake DESTINATION .)
xdmf_create_config_file(${PROJECT_NAME})
file(COPY "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" DESTINATION ${CMAKE_INSTALL_PREFIX}
FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
# XdmfConfig.cmake - Configure file that provides details for where Xdmf parts
# reside and which libraries were used.
#
# This file is used by UseXdmf.cmake module to load Xdmf's settings.
# XdmfConfig.cmake
#
# Xdmf Library locations
set(XDMF_DIR "@CMAKE_INSTALL_PREFIX@")
set(XDMF_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include")
set(XDMF_LIBRARIES "@XDMF_LIBRARIES@")
set(XDMF_BINARIES "@XDMF_BINARIES@")
set(XDMFCORE_LIBRARY "@XDMFCORE_LIBRARY_CONFIG@")
set(XDMF_LIBRARY "@XDMF_LIBRARY_CONFIG@")
set(XDMF_JAVA_DIR "@CMAKE_INSTALL_PREFIX@/lib/java")
set(XDMFCORE_JAVA_JAR "@XDMFCORE_JAVA_JAR_CONFIG@")
set(XDMF_JAVA_JAR "@XDMF_JAVA_JAR_CONFIG@")
set(XDMF_PYTHON_DIR "@CMAKE_INSTALL_PREFIX@/lib/python")
set(XDMFCORE_PYTHON "@XDMFCORE_PYTHON_CONFIG@")
set(XDMF_PYTHON "@XDMF_PYTHON_CONFIG@")
# Xdmf Boost Locations
set(XDMF_BOOST_ROOT_DIR "@XDMF_BOOST_ROOT_DIR@")
set(XDMF_BOOST_INCLUDE_DIRS "@XDMF_BOOST_INCLUDE_DIRS@")
# Xdmf HDF5 Locations
set(XDMF_HDF5_ROOT_DIR "@XDMF_HDF5_ROOT_DIR@")
set(XDMF_HDF5_INCLUDE_DIR "@XDMF_HDF5_INCLUDE_DIR@")
set(XDMF_HDF5_LIBRARIES "@XDMF_HDF5_LIBRARIES@")
set(XDMF_HDF5_BINARY_DIRS "@XDMF_HDF5_BINARY_DIRS@")
# Xdmf LibXml2 Locations
set(XDMF_LIBXML2_ROOT_DIR "@XDMF_LIBXML2_ROOT_DIR@")
set(XDMF_LIBXML2_INCLUDE_DIR "@XDMF_LIBXML2_INCLUDE_DIR@")
set(XDMF_LIBXML2_LIBRARIES "@XDMF_LIBXML2_LIBRARIES@")
set(XDMF_LIBXML2_BINARY_DIRS "@XDMF_LIBXML2_BINARY_DIRS@")
# Xdmf Swig Locations
set(XDMF_SWIG_EXECUTABLE "@XDMF_SWIG_EXECUTABLE@")
# Xdmf Python Locations
set(XDMF_PYTHON_EXECUTABLE "@XDMF_PYTHON_EXECUTABLE@")
set(XDMF_PYTHON_LIBRARIES "@XDMF_PYTHON_LIBRARIES@")
set(XDMF_PYTHON_INCLUDE_DIRS "@XDMF_PYTHON_INCLUDE_DIRS@")
# Xdmf Java Locations
set(XDMF_JAVA_INCLUDE_PATH "@XDMF_JAVA_INCLUDE_PATH@")
set(XDMF_JAVA_INCLUDE_PATH2 "@XDMF_JAVA_INCLUDE_PATH2@")
set(XDMF_JAVA_RUNTIME "@XDMF_JAVA_RUNTIME@")
set(XDMF_JAVA_COMPILE "@XDMF_JAVA_COMPILE@")
set(XDMF_JAVA_ARCHIVE "@XDMF_JAVA_ARCHIVE@")
@XDMF_VARS@
function(xdmf_create_config_file name)
get_cmake_property(ALL_VARS VARIABLES)
set(XDMF_VARS "")
foreach(var ${ALL_VARS})
if (var MATCHES "^(XDMF).*$")
if ("${${var}}" MATCHES ".+")
set(XDMF_VARS "${XDMF_VARS}\nset(${var}\t\t${${var}})")
endif()
else()
#message("set(${var} ${${var}}")
#list(APPEND XDMF_VARS ${var})
if ("${${var}}" MATCHES ".+")
set(XDMF_VARS "${XDMF_VARS}\nset(XDMF_${var}\t\t${${var}})")
endif()
endif()
endforeach()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${name}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${name}Config.cmake @ONLY)
endfunction()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment