Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit of doxy2swig #101

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ IF (${PACKAGE_NAME}_ENABLE_DeveloperMode)
ENDIF()
ENDIF()

SET(ForTrilinos_PACKAGES "")
SET(ForTrilinos_MODULES "")
# The _ENABLE_... variables are what's in PyTrilinos, don't know if we need that here?
# if so, not sure where they get set
#IF(ForTrilinos_ENABLE_Tpetra)
APPEND_SET(ForTrilinos_PACKAGES Tpetra)
APPEND_SET(ForTrilinos_MODULES Tpetra)
#ENDIF()

#IF(ForTrilinos_ENABLE_Teuchos)
APPEND_SET(ForTrilinos_PACKAGES Teuchos)
APPEND_SET(ForTrilinos_MODULES Teuchos)
#ENDIF()


##---------------------------------------------------------------------------##
## Add the libraries, tests, and examples
##---------------------------------------------------------------------------##
Expand All @@ -49,10 +64,35 @@ ENDIF()
##---------------------------------------------------------------------------##
## Generate the Doxygen documentation
##---------------------------------------------------------------------------##
# There does not currently exist Doxygen documentation
#IF(ForTrilinos_ENABLE_Doxygen)
# ADD_SUBDIRECTORY(docs/doxygen)
#ENDIF()
# The default status for whether we build docstrings for ForTrilinos is
# based on whether the user has doxygen installed.
FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
IF(${DOXYGEN_VERSION} VERSION_EQUAL 1.8.13 AND ForTrilinos_DOCSTRINGS)
MESSAGE(FATAL_ERROR
"Doxygen version ${DOXYGEN_VERSION} has a bug that makes it incompatible with "
"ForTrilinos. To work around this, you may disable ForTrilinos docstrings by setting "
"ForTrilinos_DOCSTRINGS=OFF. "
"Alternatively, you may choose to use a different version of doxygen. If you "
"choose this route, be sure that the new version of doxygen is found first in "
"your environment path.")
ELSE()
SET(ForTrilinos_DOCSTRINGS_DEFAULT ON)
ENDIF()
ELSE()
SET(ForTrilinos_DOCSTRINGS_DEFAULT OFF)
MESSAGE(STATUS "doxygen not found!")
ENDIF()
# Set the ForTrilinos docstrings flag
SET(ForTrilinos_DOCSTRINGS ${ForTrilinos_DOCSTRINGS_DEFAULT} CACHE BOOL
"a flag that determines whether Python docstrings will be built using doxygen")
IF(ForTrilinos_DOCSTRINGS AND NOT DOXYGEN_FOUND)
MESSAGE(ERROR "ForTrilinos docstrings enabled but doxygen not found")
ENDIF()

ADD_SUBDIRECTORY(doc)
#ENDIF()

##---------------------------------------------------------------------------##
## Build the documentation published on http://fortrilinos.readthedocs.org
Expand All @@ -61,6 +101,9 @@ IF(ForTrilinos_ENABLE_ReadTheDocs)
ADD_SUBDIRECTORY(docs)
ENDIF()



TRIBITS_PROCESS_SUBPACKAGES()
TRIBITS_PACKAGE_DEF()
TRIBITS_PACKAGE_POSTPROCESS()

47 changes: 47 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- cmake -*-

# @HEADER
# ***********************************************************************
#
# PyTrilinos: Python Interfaces to Trilinos Packages
# Copyright (2014) Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia
# Corporation, the U.S. Government retains certain rights in this
# software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Questions? Contact William F. Spotz (wfspotz@sandia.gov)
#
# ***********************************************************************
# @HEADER

# Add the Doxygen directory, which builds the python documentation
# strings from the source code Doxygen comments
ADD_SUBDIRECTORY(Doxygen)
53 changes: 53 additions & 0 deletions doc/Doxygen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# -*- cmake -*-

# @HEADER
# ***********************************************************************
#
# ForTrilinos: Fortran Interfaces to Trilinos Packages
# ***********************************************************************
# @HEADER

SET(ADDITIONAL_CLEAN_FILES "")

FOREACH(Package ${ForTrilinos_PACKAGES})

IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${Package}_dox.i)

IF(ForTrilinos_DOCSTRINGS)

IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile_${Package}.in)

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile_${Package}.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_${Package}
@ONLY
)
EXECUTE_PROCESS(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/docstrings.py
--doxygen=${DOXYGEN_EXECUTABLE} ${Package}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

ENDIF()

ELSE(ForTrilinos_DOCSTRINGS)

EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_CURRENT_BINARY_DIR}/${Package}_dox.i
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
MESSAGE(STATUS
"ForTrilinos.${Package} will not have doxygen-generated docstrings")

ENDIF(ForTrilinos_DOCSTRINGS)

IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${Package}_dox.i)
LIST(APPEND ADDITIONAL_CLEAN_FILES ${Package}_dox.i)
ENDIF()

ENDIF()

ENDFOREACH(Package)

# Set this directory's clean files
GET_DIRECTORY_PROPERTY(clean_files ADDITIONAL_MAKE_CLEAN_FILES)
LIST(APPEND clean_files ${ADDITIONAL_CLEAN_FILES})
LIST(REMOVE_DUPLICATES clean_files)
LIST(REMOVE_ITEM clean_files "")
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${clean_files}")
Loading