2012-10-07 00:53:51 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) Pixar. All rights reserved.
|
|
|
|
#
|
|
|
|
# This license governs use of the accompanying software. If you
|
|
|
|
# use the software, you accept this license. If you do not accept
|
|
|
|
# the license, do not use the software.
|
|
|
|
#
|
|
|
|
# 1. Definitions
|
|
|
|
# The terms "reproduce," "reproduction," "derivative works," and
|
|
|
|
# "distribution" have the same meaning here as under U.S.
|
|
|
|
# copyright law. A "contribution" is the original software, or
|
|
|
|
# any additions or changes to the software.
|
|
|
|
# A "contributor" is any person or entity that distributes its
|
|
|
|
# contribution under this license.
|
|
|
|
# "Licensed patents" are a contributor's patent claims that read
|
|
|
|
# directly on its contribution.
|
|
|
|
#
|
|
|
|
# 2. Grant of Rights
|
|
|
|
# (A) Copyright Grant- Subject to the terms of this license,
|
|
|
|
# including the license conditions and limitations in section 3,
|
|
|
|
# each contributor grants you a non-exclusive, worldwide,
|
|
|
|
# royalty-free copyright license to reproduce its contribution,
|
|
|
|
# prepare derivative works of its contribution, and distribute
|
|
|
|
# its contribution or any derivative works that you create.
|
|
|
|
# (B) Patent Grant- Subject to the terms of this license,
|
|
|
|
# including the license conditions and limitations in section 3,
|
|
|
|
# each contributor grants you a non-exclusive, worldwide,
|
|
|
|
# royalty-free license under its licensed patents to make, have
|
|
|
|
# made, use, sell, offer for sale, import, and/or otherwise
|
|
|
|
# dispose of its contribution in the software or derivative works
|
|
|
|
# of the contribution in the software.
|
|
|
|
#
|
|
|
|
# 3. Conditions and Limitations
|
|
|
|
# (A) No Trademark License- This license does not grant you
|
|
|
|
# rights to use any contributor's name, logo, or trademarks.
|
|
|
|
# (B) If you bring a patent claim against any contributor over
|
|
|
|
# patents that you claim are infringed by the software, your
|
|
|
|
# patent license from such contributor to the software ends
|
|
|
|
# automatically.
|
|
|
|
# (C) If you distribute any portion of the software, you must
|
|
|
|
# retain all copyright, patent, trademark, and attribution
|
|
|
|
# notices that are present in the software.
|
|
|
|
# (D) If you distribute any portion of the software in source
|
|
|
|
# code form, you may do so only under this license by including a
|
|
|
|
# complete copy of this license with your distribution. If you
|
|
|
|
# distribute any portion of the software in compiled or object
|
|
|
|
# code form, you may only do so under a license that complies
|
|
|
|
# with this license.
|
|
|
|
# (E) The software is licensed "as-is." You bear the risk of
|
|
|
|
# using it. The contributors give no express warranties,
|
|
|
|
# guarantees or conditions. You may have additional consumer
|
|
|
|
# rights under your local laws which this license cannot change.
|
|
|
|
# To the extent permitted under your local laws, the contributors
|
|
|
|
# exclude the implied warranties of merchantability, fitness for
|
|
|
|
# a particular purpose and non-infringement.
|
|
|
|
#
|
|
|
|
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
# Doxygen documentation
|
|
|
|
if (DOXYGEN_FOUND)
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/OpenSubdiv.doxy ${CMAKE_CURRENT_BINARY_DIR}/OpenSubdiv.doxy @ONLY)
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
add_custom_target(doc_doxy
|
|
|
|
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OpenSubdiv.doxy
|
|
|
|
WORKING_DIRECTORY
|
|
|
|
${CMAKE_BINARY_DIR}/public_headers/
|
|
|
|
DEPENDS
|
|
|
|
public_headers
|
|
|
|
COMMENT
|
|
|
|
"Generating API documentation with Doxygen" VERBATIM
|
|
|
|
)
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
list(APPEND DOC_TARGETS doc_doxy)
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/doxy_html
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_PREFIX}/documentation
|
|
|
|
)
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
else()
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
message(WARNING
|
|
|
|
"Doxyen was not found : support for Doxygen automated API documentation is disabled.")
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
endif()
|
2013-07-04 17:47:56 +00:00
|
|
|
|
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
# ReST - HTML documentation
|
|
|
|
if (DOCUTILS_FOUND AND PYTHONINTERP_FOUND)
|
|
|
|
|
|
|
|
set(HTML_FILES
|
|
|
|
search.html
|
|
|
|
)
|
|
|
|
|
|
|
|
set(RST_FILES
|
|
|
|
api_overview.rst
|
|
|
|
intro.rst
|
|
|
|
cmake_build.rst
|
|
|
|
code_examples.rst
|
|
|
|
dxviewer.rst
|
|
|
|
getting_started.rst
|
|
|
|
glviewer.rst
|
|
|
|
glbatchviewer.rst
|
|
|
|
limiteval.rst
|
2013-07-16 02:06:57 +00:00
|
|
|
painttest.rst
|
2013-07-09 17:00:40 +00:00
|
|
|
ptexviewer.rst
|
|
|
|
release_notes.rst
|
|
|
|
subdivision_surfaces.rst
|
|
|
|
using_osd.rst
|
|
|
|
using_osd_compile.rst
|
|
|
|
using_osd_hbr.rst
|
|
|
|
using_osd_textures.rst
|
|
|
|
)
|
|
|
|
|
|
|
|
# process rst markup files
|
|
|
|
foreach(src ${RST_FILES})
|
|
|
|
get_filename_component(BASENAME ${src} NAME_WE)
|
|
|
|
|
|
|
|
set(infile ${CMAKE_CURRENT_SOURCE_DIR}/${src})
|
|
|
|
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/${BASENAME}.html)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
${outfile}
|
|
|
|
COMMAND
|
|
|
|
${RST2HTML_EXECUTABLE}
|
|
|
|
ARGS
|
|
|
|
--date
|
|
|
|
--time
|
|
|
|
--no-xml-declaration
|
|
|
|
--initial-header-level=3
|
|
|
|
--strip-comments
|
|
|
|
--template=${CMAKE_CURRENT_SOURCE_DIR}/rst_template.txt
|
|
|
|
--stylesheet=css/rst.css
|
|
|
|
--link-stylesheet
|
|
|
|
${infile} ${outfile}
|
|
|
|
DEPENDS
|
|
|
|
${infile} rst_template.txt nav_template.txt
|
2013-07-04 17:47:56 +00:00
|
|
|
)
|
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
add_custom_target(${src} DEPENDS ${outfile})
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
list(APPEND RST_TARGETS ${src})
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-05 22:36:54 +00:00
|
|
|
install(
|
2013-07-09 17:00:40 +00:00
|
|
|
FILES
|
|
|
|
${outfile}
|
2013-07-05 22:36:54 +00:00
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_PREFIX}/documentation
|
2013-07-09 17:00:40 +00:00
|
|
|
PERMISSIONS
|
|
|
|
OWNER_READ GROUP_READ WORLD_READ
|
2013-07-05 22:36:54 +00:00
|
|
|
)
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
endforeach()
|
2013-07-04 17:47:56 +00:00
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
# copy html files to the build area
|
|
|
|
foreach(src ${HTML_FILES})
|
|
|
|
set(infile ${CMAKE_CURRENT_SOURCE_DIR}/${src})
|
|
|
|
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/${src})
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
${outfile}
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND}
|
|
|
|
ARGS
|
|
|
|
-E copy ${infile} ${outfile}
|
2013-07-04 17:47:56 +00:00
|
|
|
)
|
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
add_custom_target( ${src} DEPENDS ${outfile})
|
|
|
|
|
|
|
|
list(APPEND HTML_TARGETS ${src})
|
|
|
|
|
2013-07-04 17:47:56 +00:00
|
|
|
install(
|
2013-07-09 17:00:40 +00:00
|
|
|
FILES
|
|
|
|
${outfile}
|
2013-07-04 17:47:56 +00:00
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_PREFIX}/documentation
|
|
|
|
)
|
2013-07-09 17:00:40 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# copy the site resources to the build area so that the
|
|
|
|
# documentation can be read without an install
|
|
|
|
add_custom_target(doc_html_images
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/images ${CMAKE_CURRENT_BINARY_DIR}/images
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(doc_html_css
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/css ${CMAKE_CURRENT_BINARY_DIR}/css
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(doc_tipuesearch
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/tipuesearch ${CMAKE_CURRENT_BINARY_DIR}/tipuesearch
|
|
|
|
)
|
|
|
|
|
|
|
|
# build search index and insert navigation tab
|
|
|
|
add_custom_target(search_index
|
|
|
|
COMMAND
|
|
|
|
${PYTHON_EXECUTABLE}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/processHtml.py
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/nav_template.txt
|
|
|
|
DEPENDS
|
|
|
|
${HTML_TARGETS}
|
|
|
|
${RST_TARGETS}
|
|
|
|
doc_tipuesearch
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(doc_html
|
|
|
|
DEPENDS
|
|
|
|
search_index
|
|
|
|
${HTML_TARGETS}
|
|
|
|
${RST_TARGETS}
|
|
|
|
doc_html_images
|
|
|
|
doc_html_css
|
|
|
|
doc_tipuesearch
|
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/tipuesearch
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_PREFIX}/documentation
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/images
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_PREFIX}/documentation
|
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/css
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_PREFIX}/documentation
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND DOC_TARGETS doc_html)
|
2012-10-07 00:53:51 +00:00
|
|
|
endif()
|
2013-07-09 17:00:40 +00:00
|
|
|
|
|
|
|
add_custom_target(doc ALL DEPENDS ${DOC_TARGETS})
|