Commit 03fb2f8f authored by Kenneth Leiter's avatar Kenneth Leiter
Browse files

Merge formatting changes into 'master'

parents 8f2dc168 36ed6d02
core/XdmfVersion.hpp
core/XdmfVersion.cpp
# - Run Doxygen
#
# Adds a doxygen target that runs doxygen to generate the html
# and optionally the LaTeX API documentation.
# The doxygen target is added to the doc target as dependency.
# i.e.: the API documentation is built with:
# make doc
#
#
# Adds a doxygen target that runs doxygen to generate the html and
# optionally the LaTeX API documentation. The doxygen target is added
# to the doc target as dependency. i.e.: the API documentation is
# built with: make doc
#
# USAGE: GLOBAL INSTALL
#
# Install it with:
# cmake ./ && sudo make install
# Add the following to the CMakeLists.txt of your project:
# include(UseDoxygen OPTIONAL)
# Optionally copy Doxyfile.in in the directory of CMakeLists.txt and edit it.
#
#
# Install it with: cmake ./ && sudo make install Add the following to
# the CMakeLists.txt of your project: include(UseDoxygen OPTIONAL)
# Optionally copy Doxyfile.in in the directory of CMakeLists.txt and
# edit it.
#
# USAGE: INCLUDE IN PROJECT
#
# set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
# include(UseDoxygen)
# Add the Doxyfile.in and UseDoxygen.cmake files to the projects source directory.
#
#
# Variables you may define are:
# DOXYFILE_OUTPUT_DIR - Path where the Doxygen output is stored. Defaults to "doc".
#
# DOXYFILE_LATEX_DIR - Directory where the Doxygen LaTeX output is stored. Defaults to "latex".
#
# DOXYFILE_HTML_DIR - Directory where the Doxygen html output is stored. Defaults to "html".
#
#
# set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
# include(UseDoxygen) Add the Doxyfile.in and UseDoxygen.cmake files
# to the projects source directory.
#
#
# Variables you may define are: DOXYFILE_OUTPUT_DIR - Path where the
# Doxygen output is stored. Defaults to "doc".
#
# DOXYFILE_LATEX_DIR - Directory where the Doxygen LaTeX output is
# stored. Defaults to "latex".
#
# DOXYFILE_HTML_DIR - Directory where the Doxygen html output is
# stored. Defaults to "html".
#
# Copyright (c) 2009, 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
......@@ -38,63 +37,65 @@
#
macro(usedoxygen_set_default name value)
if(NOT DEFINED "${name}")
set("${name}" "${value}")
endif()
if(NOT DEFINED "${name}")
set("${name}" "${value}")
endif()
endmacro()
find_package(Doxygen)
mark_as_advanced(CLEAR DOXYGEN_EXECUTABLE)
find_package(Doxygen REQUIRED)
if(DOXYGEN_FOUND)
find_file(DOXYFILE_IN "Doxyfile.in"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_ROOT}/Modules/"
NO_DEFAULT_PATH)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DOXYFILE_IN DEFAULT_MSG "DOXYFILE_IN")
mark_as_advanced(FORCE DOXYGEN_EXECUTABLE)
find_file(DOXYFILE_IN "Doxyfile.in"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_ROOT}/Modules/"
NO_DEFAULT_PATH)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DOXYFILE_IN DEFAULT_MSG "DOXYFILE_IN")
endif()
if(DOXYGEN_FOUND AND DOXYFILE_IN_FOUND)
add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
usedoxygen_set_default(DOXYFILE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/doc")
usedoxygen_set_default(DOXYFILE_HTML_DIR "html")
usedoxygen_set_default(DOXYFILE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/doc")
usedoxygen_set_default(DOXYFILE_HTML_DIR "html")
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES "${DOXYFILE_OUTPUT_DIR}/${DOXYFILE_HTML_DIR}")
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES "${DOXYFILE_OUTPUT_DIR}/${DOXYFILE_HTML_DIR}")
set(DOXYFILE_LATEX "NO")
set(DOXYFILE_PDFLATEX "NO")
set(DOXYFILE_DOT "NO")
set(DOXYFILE_LATEX "NO")
set(DOXYFILE_PDFLATEX "NO")
set(DOXYFILE_DOT "NO")
find_package(LATEX)
if(LATEX_COMPILER AND MAKEINDEX_COMPILER)
set(DOXYFILE_LATEX "YES")
usedoxygen_set_default(DOXYFILE_LATEX_DIR "latex")
find_package(LATEX)
if(LATEX_COMPILER AND MAKEINDEX_COMPILER)
set(DOXYFILE_LATEX "YES")
usedoxygen_set_default(DOXYFILE_LATEX_DIR "latex")
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"${DOXYFILE_OUTPUT_DIR}/${DOXYFILE_LATEX_DIR}")
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"${DOXYFILE_OUTPUT_DIR}/${DOXYFILE_LATEX_DIR}")
if(PDFLATEX_COMPILER)
set(DOXYFILE_PDFLATEX "YES")
endif()
if(DOXYGEN_DOT_EXECUTABLE)
set(DOXYFILE_DOT "YES")
endif()
if(PDFLATEX_COMPILER)
set(DOXYFILE_PDFLATEX "YES")
endif()
if(DOXYGEN_DOT_EXECUTABLE)
set(DOXYFILE_DOT "YES")
endif()
add_custom_command(TARGET doxygen
POST_BUILD
COMMAND ${CMAKE_MAKE_PROGRAM}
WORKING_DIRECTORY "${DOXYFILE_OUTPUT_DIR}/${DOXYFILE_LATEX_DIR}")
endif()
add_custom_command(TARGET doxygen
POST_BUILD
COMMAND ${CMAKE_MAKE_PROGRAM}
WORKING_DIRECTORY "${DOXYFILE_OUTPUT_DIR}/${DOXYFILE_LATEX_DIR}")
endif()
configure_file(${DOXYFILE_IN} Doxyfile ESCAPE_QUOTES IMMEDIATE @ONLY)
configure_file(${DOXYFILE_IN} Doxyfile ESCAPE_QUOTES IMMEDIATE @ONLY)
get_target_property(DOC_TARGET doc TYPE)
if(NOT DOC_TARGET)
add_custom_target(doc)
endif()
get_target_property(DOC_TARGET doc TYPE)
if(NOT DOC_TARGET)
add_custom_target(doc)
endif()
add_dependencies(doc doxygen)
add_dependencies(doc doxygen)
endif()
......@@ -3,9 +3,9 @@
# Descrition: This small suite allows you to add support
# for versioning in your projects
# This allows you to turn on and off the auto
# This allows you to turn on and off the auto
# update of the (project name)Version.hpp file
SET(VERSION_CONTROL_AUTOUPDATE ON CACHE BOOL "Automaticaly Update The Version")
SET(VERSION_CONTROL_AUTOUPDATE OFF CACHE BOOL "Automaticaly Update The Version")
MARK_AS_ADVANCED(VERSION_CONTROL_AUTOUPDATE)
# We need to make sure we have the header file
......@@ -37,7 +37,7 @@ MACRO(VersionCalculate)
FOREACH(r ${return})
MATH(EXPR count "${count} + 1")
ENDFOREACH(r ${return})
SET(vMinor ${count})
SET(vMinor ${count})
ELSE(GIT_FOUND)
SET(vMinor "X")
ENDIF(GIT_FOUND)
......@@ -49,8 +49,8 @@ MACRO(VersionWrite vProjectName export_name)
FOREACH(il ${include_list})
SET(includes "${includes}\n\#include \"${il}\"")
ENDFOREACH(il ${include_list})
FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${vProjectName}Version.hpp
"/* Current Version of ${vProjectName}
FILE(WRITE ${CMAKE_BINARY_DIR}/${vProjectName}Version.hpp
"/* Current Version of ${vProjectName}
* Major is: ${vMajor}
* Minor is: ${vMinor}
*/
......@@ -59,9 +59,9 @@ ${includes}
extern ${export_name} ProjectVersion ${vProjectName}Version;\n"
)
FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${vProjectName}Version.cpp
FILE(WRITE ${CMAKE_BINARY_DIR}/${vProjectName}Version.cpp
"/* Current Version of ${vProjectName}
* Make sure to include this file in your built sources
* Make sure to include this file in your built sources
*/
\#include \"${vProjectName}Version.hpp\"
ProjectVersion ${vProjectName}Version = ProjectVersion(\"${vProjectName}\", \"${vMajor}\", \"${vMinor}\");\n"
......
......@@ -3,30 +3,33 @@ cmake_minimum_required(VERSION 2.6)
set(BUILD_SHARED_LIBS true)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
include_directories(${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake
${CMAKE_SOURCE_DIR}/CMake/TestingSuite
${CMAKE_SOURCE_DIR}/CMake/VersionSuite
)
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake
${CMAKE_SOURCE_DIR}/CMake/TestingSuite
${CMAKE_SOURCE_DIR}/CMake/VersionSuite)
include("${CMAKE_CURRENT_SOURCE_DIR}/XdmfFunctions.cmake")
# RPath
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Should we build with documentation
option(XDMF_BUILD_DOCUMENTATION OFF)
if(XDMF_BUILD_DOCUMENTATION)
add_subdirectory(doc)
add_subdirectory(doc)
endif(XDMF_BUILD_DOCUMENTATION)
option(XDMF_BUILD_TESTING ON)
if(XDMF_BUILD_TESTING)
enable_testing()
include(CTest)
endif(XDMF_BUILD_TESTING)
# Enable CMake testing
option(BUILD_TESTING "Build Tests" OFF)
if(BUILD_TESTING)
enable_testing()
include(CTest)
endif(BUILD_TESTING)
# Wrapper Setup
option(XDMF_WRAP_PYTHON OFF)
......@@ -34,149 +37,147 @@ option(XDMF_WRAP_JAVA OFF)
# If we are wrapping either, we need swig
if(XDMF_WRAP_PYTHON OR XDMF_WRAP_JAVA)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
if(${SWIG_VERSION} LESS 2.0.0)
message(SEND_ERROR "Swig must be version 2.0.0 or greater")
endif(${SWIG_VERSION} LESS 2.0.0)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
if(${SWIG_VERSION} LESS 2.0.0)
message(SEND_ERROR "Swig must be version 2.0.0 or greater")
endif(${SWIG_VERSION} LESS 2.0.0)
endif(XDMF_WRAP_PYTHON OR XDMF_WRAP_JAVA)
# If we are wrapping python, let's include it in the top level
if(XDMF_WRAP_PYTHON)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
# A macro to swig and create the python files
# Since we essentually do the same thing inside and outside core, it
# would be easier as a macro
# Parameters:
# python_name = the name of the intended target to be wrapped
# ${ARGN} = any dependencies needed by the target
# Output:
# Target Name = the output target name will have ${python_name} as its name
MACRO(XDMF_SWIG_PYTHON python_name)
set(CMAKE_SWIG_OUTDIR ${CMAKE_BINARY_DIR})
set(CMAKE_SWIG_FLAGS "")
set_source_files_properties(${python_name}.i PROPERTIES CPLUSPLUS ON)
set(swig_extra_generated_files "")
swig_add_module(${python_name} python ${python_name}.i)
swig_link_libraries(${python_name} ${python_name} ${PYTHON_LIBRARIES})
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_BINARY_DIR}/${python_name}.pyc
)
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)
string(TOUPPER ${python_name} python_name_upper)
set(${python_name_upper}_PYTHON
${CMAKE_INSTALL_PREFIX}/lib/python/${python_name}.py)
get_directory_property(${python_name}Parent PARENT_DIRECTORY)
if(NOT "${${python_name}Parent}" STREQUAL "")
set(${python_name_upper}_PYTHON ${${python_name_upper}_PYTHON}
PARENT_SCOPE)
endif(NOT "${${python_name}Parent}" STREQUAL "")
install(FILES ${CMAKE_BINARY_DIR}/${python_name}.py
DESTINATION lib/python)
install(TARGETS ${SWIG_MODULE_${python_name}_REAL_NAME}
DESTINATION lib/python)
ENDMACRO(XDMF_SWIG_PYTHON)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
# A macro to swig and create the python files
# Since we essentually do the same thing inside and outside core, it
# would be easier as a macro
# Parameters:
# python_name = the name of the intended target to be wrapped
# ${ARGN} = any dependencies needed by the target
# Output:
# Target Name = the output target name will have ${python_name} as its name
macro(XDMF_SWIG_PYTHON python_name)
set(CMAKE_SWIG_OUTDIR ${CMAKE_BINARY_DIR})
set(CMAKE_SWIG_FLAGS "")
set_source_files_properties(${python_name}.i PROPERTIES CPLUSPLUS ON)
set(swig_extra_generated_files "")
swig_add_module(${python_name} python ${python_name}.i)
swig_link_libraries(${python_name} ${python_name} ${PYTHON_LIBRARIES})
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_BINARY_DIR}/${python_name}.pyc
)
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)
string(TOUPPER ${python_name} python_name_upper)
set(${python_name_upper}_PYTHON
${CMAKE_INSTALL_PREFIX}/lib/python/${python_name}.py)
get_directory_property(${python_name}Parent PARENT_DIRECTORY)
if(NOT "${${python_name}Parent}" STREQUAL "")
set(${python_name_upper}_PYTHON ${${python_name_upper}_PYTHON}
PARENT_SCOPE)
endif(NOT "${${python_name}Parent}" STREQUAL "")
install(FILES ${CMAKE_BINARY_DIR}/${python_name}.py
DESTINATION lib/python)
install(TARGETS ${SWIG_MODULE_${python_name}_REAL_NAME}
DESTINATION lib/python)
endmacro(XDMF_SWIG_PYTHON)
endif(XDMF_WRAP_PYTHON)
# If we are wrapping java, let's include it in the top level
if(XDMF_WRAP_JAVA)
find_package(Java REQUIRED)
find_package(JNI REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
# A macro to swig and create the jar files
# Since we essentually do the same thing inside and outside core, it
# would be easier as a macro
# Parameters:
# java_name = the name of the intended target to be wrapped
# ${ARGN} = any dependencies needed by the target
# Output:
# Target Name = the output target name will have ${java_name}Java as its name
# Target Jar = the output target jar will have ${java_name}Java.jar as its name
MACRO(XDMF_SWIG_JAVA java_name)
set(${java_name}_JAVA_JAR ${CMAKE_BINARY_DIR}/${java_name}.jar)
set(XDMF_JAVA_PACKAGE_DIR mil/army/arl/xdmf)
set(XDMF_JAVA_DIR ${CMAKE_CURRENT_BINARY_DIR}/${XDMF_JAVA_PACKAGE_DIR})
set(CMAKE_SWIG_OUTDIR ${XDMF_JAVA_DIR})
set(CMAKE_SWIG_FLAGS -v -make_default -package mil.army.arl.xdmf)
set_source_files_properties(${java_name}.i PROPERTIES CPLUSPLUS ON)
set(swig_extra_generated_files "")
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}/*" *.java)
set(java_dest "bin")
else(WIN32)
set(java_compile_args -cp "${CMAKE_BINARY_DIR}/*.jar" ${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}
COMMAND ${CMAKE_COMMAND} -E make_directory ${XDMF_JAVA_DIR}
)
add_custom_target(Compiled_${java_name}_Jar ALL DEPENDS
${${java_name}_JAVA_JAR})
add_custom_command(OUTPUT ${${java_name}_JAVA_JAR}
COMMAND ${CMAKE_COMMAND} -E chdir ${XDMF_JAVA_PACKAGE_DIR}
${JAVA_COMPILE} ${java_compile_args}
COMMAND ${JAVA_ARCHIVE} -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)
if(NOT ${ARGN} EQUAL "")
add_dependencies(Compiled_${java_name}_Jar "${ARGN}")
endif(NOT ${ARGN} EQUAL "")
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_BINARY_DIR}/${java_name}.jar
${XDMF_JAVA_DIR}
)
string(TOUPPER ${java_name} java_name_upper)
set(${java_name_upper}_JAVA_JAR
${CMAKE_INSTALL_PREFIX}/lib/java/${java_name}.jar)
get_directory_property(${java_name}Parent PARENT_DIRECTORY)
if(NOT "${${java_name}Parent}" STREQUAL "")
set(${java_name_upper}_JAVA_JAR ${${java_name_upper}_JAVA_JAR}
PARENT_SCOPE)
endif(NOT "${${java_name}Parent}" STREQUAL "")
install(FILES ${CMAKE_BINARY_DIR}/${java_name}.jar
DESTINATION lib/java)
install(TARGETS ${SWIG_MODULE_${java_name}Java_REAL_NAME}
DESTINATION ${java_dest})
ENDMACRO(XDMF_SWIG_JAVA)
find_package(Java REQUIRED)
find_package(JNI REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH2})
# A macro to swig and create the jar files
# Since we essentually do the same thing inside and outside core, it
# would be easier as a macro
# Parameters:
# java_name = the name of the intended target to be wrapped
# ${ARGN} = any dependencies needed by the target
# Output:
# Target Name = the output target name will have ${java_name}Java as its name
# Target Jar = the output target jar will have ${java_name}Java.jar as its name
macro(XDMF_SWIG_JAVA java_name)
set(${java_name}_JAVA_JAR ${CMAKE_BINARY_DIR}/${java_name}.jar)
set(XDMF_JAVA_PACKAGE_DIR mil/army/arl/xdmf)
set(XDMF_JAVA_DIR ${CMAKE_CURRENT_BINARY_DIR}/${XDMF_JAVA_PACKAGE_DIR})
set(CMAKE_SWIG_OUTDIR ${XDMF_JAVA_DIR})
set(CMAKE_SWIG_FLAGS -v -make_default -package mil.army.arl.xdmf)
set_source_files_properties(${java_name}.i PROPERTIES CPLUSPLUS ON)
set(swig_extra_generated_files "")
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}/*" *.java)
set(java_dest "bin")
else(WIN32)
set(java_compile_args -cp "${CMAKE_BINARY_DIR}/*.jar"
${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}
COMMAND ${CMAKE_COMMAND} -E make_directory ${XDMF_JAVA_DIR})
add_custom_target(Compiled_${java_name}_Jar ALL DEPENDS
${${java_name}_JAVA_JAR})
add_custom_command(OUTPUT ${${java_name}_JAVA_JAR}
COMMAND ${CMAKE_COMMAND} -E chdir ${XDMF_JAVA_PACKAGE_DIR}
${JAVA_COMPILE} ${java_compile_args}
COMMAND ${JAVA_ARCHIVE} -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)
if(NOT ${ARGN} EQUAL "")
add_dependencies(Compiled_${java_name}_Jar "${ARGN}")
endif(NOT ${ARGN} EQUAL "")
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_BINARY_DIR}/${java_name}.jar
${XDMF_JAVA_DIR})
string(TOUPPER ${java_name} java_name_upper)
set(${java_name_upper}_JAVA_JAR
${CMAKE_INSTALL_PREFIX}/lib/java/${java_name}.jar)
get_directory_property(${java_name}Parent PARENT_DIRECTORY)
if(NOT "${${java_name}Parent}" STREQUAL "")
set(${java_name_upper}_JAVA_JAR ${${java_name_upper}_JAVA_JAR}
PARENT_SCOPE)
endif(NOT "${${java_name}Parent}" STREQUAL "")
install(FILES ${CMAKE_BINARY_DIR}/${java_name}.jar
DESTINATION lib/java)
install(TARGETS ${SWIG_MODULE_${java_name}Java_REAL_NAME}
DESTINATION ${java_dest})
endmacro(XDMF_SWIG_JAVA)
endif(XDMF_WRAP_JAVA)
add_subdirectory(core)
......@@ -184,73 +185,72 @@ include_directories(${XdmfCore_INCLUDE_DIRS})
option(XDMF_BUILD_CORE_ONLY OFF)
if(NOT XDMF_BUILD_CORE_ONLY)
set(XdmfSources
XdmfAttribute
XdmfAttributeCenter
XdmfAttributeType
XdmfCurvilinearGrid
XdmfDomain
XdmfGeometry
XdmfGeometryType
XdmfGrid
XdmfGridCollection
XdmfGridCollectionType
XdmfItemFactory
XdmfMap
XdmfReader
XdmfRectilinearGrid
XdmfRegularGrid
XdmfSet
XdmfSetType
XdmfTime
XdmfTopology
XdmfTopologyType
XdmfUnstructuredGrid
)
add_library(Xdmf ${XdmfSources})
target_link_libraries(Xdmf XdmfCore)
set(XdmfSources
XdmfAttribute
XdmfAttributeCenter
XdmfAttributeType
XdmfCurvilinearGrid
XdmfDomain
XdmfGeometry
XdmfGeometryType
XdmfGrid
XdmfGridCollection
XdmfGridCollectionType
XdmfItemFactory
XdmfMap
XdmfReader
XdmfRectilinearGrid
XdmfRegularGrid
XdmfSet
XdmfSetType
XdmfTime
XdmfTopology
XdmfTopologyType
XdmfUnstructuredGrid)
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)
if(XDMF_WRAP_PYTHON)
XDMF_SWIG_PYTHON(Xdmf XdmfCore)
endif(XDMF_WRAP_PYTHON)
if(BUILD_TESTING)
add_subdirectory(tests)
endif(BUILD_TESTING)
option(XDMF_BUILD_UTILS OFF)
if(XDMF_BUILD_UTILS)
add_subdirectory(utils)
endif(XDMF_BUILD_UTILS)
if(WIN32)
set(XDMF_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/Xdmf.lib)