2012-10-07 00:53:51 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Copyright 2013 Pixar
|
2012-10-07 00:53:51 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
|
|
|
# with the following modification; you may not use this file except in
|
|
|
|
# compliance with the Apache License and the following modification to it:
|
|
|
|
# Section 6. Trademarks. is deleted and replaced with:
|
2012-10-07 00:53:51 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# 6. Trademarks. This License does not grant permission to use the trade
|
|
|
|
# names, trademarks, service marks, or product names of the Licensor
|
|
|
|
# and its affiliates, except as required to comply with Section 4(c) of
|
|
|
|
# the License and to reproduce the content of the NOTICE file.
|
2012-10-07 00:53:51 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# You may obtain a copy of the Apache License at
|
2012-10-07 00:53:51 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2013-07-18 21:19:50 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the Apache License with the above modification is
|
|
|
|
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the Apache License for the specific
|
|
|
|
# language governing permissions and limitations under the Apache License.
|
2012-10-07 00:53:51 +00:00
|
|
|
#
|
|
|
|
|
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
|
|
|
|
2014-04-09 20:43:38 +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
|
2014-04-09 20:43:38 +00:00
|
|
|
${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/OpenSubdiv.doxy"
|
2014-09-05 22:07:46 +00:00
|
|
|
WORKING_DIRECTORY
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_BINARY_DIR}/public_headers/"
|
2013-07-09 17:00:40 +00:00
|
|
|
DEPENDS
|
|
|
|
public_headers
|
2014-09-05 22:07:46 +00:00
|
|
|
COMMENT
|
2013-07-09 17:00:40 +00:00
|
|
|
"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
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
install(
|
2013-07-09 17:00:40 +00:00
|
|
|
DIRECTORY
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/doxy_html"
|
2014-09-05 22:07:46 +00:00
|
|
|
DESTINATION
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_DOCDIR_BASE}"
|
2013-07-09 17:00:40 +00:00
|
|
|
)
|
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
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
find_package(PythonInterp 2.6)
|
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
|
|
|
|
)
|
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
set(RST_FILES
|
2013-09-14 15:34:27 +00:00
|
|
|
additional_resources.rst
|
2013-07-09 17:00:40 +00:00
|
|
|
api_overview.rst
|
|
|
|
cmake_build.rst
|
|
|
|
code_examples.rst
|
|
|
|
dxviewer.rst
|
2014-09-05 22:07:46 +00:00
|
|
|
dxptexviewer.rst
|
2013-07-30 02:14:19 +00:00
|
|
|
far_overview.rst
|
2013-07-09 17:00:40 +00:00
|
|
|
getting_started.rst
|
2014-09-05 22:07:46 +00:00
|
|
|
glevallimit.rst
|
|
|
|
glfvarviewer.rst
|
|
|
|
glpainttest.rst
|
|
|
|
glptexviewer.rst
|
|
|
|
glsharetopology.rst
|
2013-09-11 23:05:14 +00:00
|
|
|
glstencilviewer.rst
|
2014-09-05 22:07:46 +00:00
|
|
|
glviewer.rst
|
2013-07-30 02:14:19 +00:00
|
|
|
hbr_overview.rst
|
2014-09-05 22:07:46 +00:00
|
|
|
intro.rst
|
2013-11-26 01:12:57 +00:00
|
|
|
maya_osdpolysmooth.rst
|
2013-07-30 02:14:19 +00:00
|
|
|
osd_overview.rst
|
2014-09-05 22:07:46 +00:00
|
|
|
release_notes.rst
|
|
|
|
release_notes_2x.rst
|
|
|
|
sdc_overview.rst
|
|
|
|
subdivision_surfaces.rst
|
|
|
|
tutorials.rst
|
2013-07-09 17:00:40 +00:00
|
|
|
using_osd.rst
|
|
|
|
using_osd_compile.rst
|
|
|
|
using_osd_hbr.rst
|
|
|
|
using_osd_textures.rst
|
2014-09-05 22:07:46 +00:00
|
|
|
vtr_overview.rst
|
2013-07-09 17:00:40 +00:00
|
|
|
)
|
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
|
|
|
|
# Configure release number in RST template file
|
|
|
|
|
|
|
|
# Replace '_' with '.'
|
|
|
|
string(REGEX REPLACE "(_)" "." RELEASE_STRING ${OpenSubdiv_VERSION})
|
|
|
|
|
|
|
|
# Remove starting 'v' character
|
|
|
|
string(REGEX REPLACE "^v" "" RELEASE_STRING ${RELEASE_STRING})
|
|
|
|
|
|
|
|
# Format API version string
|
|
|
|
set(RELEASE_STRING "Release ${RELEASE_STRING}")
|
|
|
|
|
|
|
|
# Replace string in navigation bar
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/rst_template.txt"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/rst_template.txt" )
|
|
|
|
|
2013-07-09 17:00:40 +00:00
|
|
|
# process rst markup files
|
|
|
|
foreach(src ${RST_FILES})
|
|
|
|
get_filename_component(BASENAME ${src} NAME_WE)
|
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
set(infile "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
|
|
|
|
set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${BASENAME}.html")
|
2013-07-09 17:00:40 +00:00
|
|
|
|
|
|
|
add_custom_command(
|
2014-09-05 22:07:46 +00:00
|
|
|
OUTPUT
|
2014-04-09 20:43:38 +00:00
|
|
|
"${outfile}"
|
2014-09-05 22:07:46 +00:00
|
|
|
COMMAND
|
2014-04-09 20:43:38 +00:00
|
|
|
"${RST2HTML_EXECUTABLE}"
|
2014-09-05 22:07:46 +00:00
|
|
|
ARGS
|
2013-07-09 17:00:40 +00:00
|
|
|
--date
|
|
|
|
--time
|
2014-09-05 22:07:46 +00:00
|
|
|
--no-xml-declaration
|
2013-07-09 17:00:40 +00:00
|
|
|
--initial-header-level=3
|
|
|
|
--strip-comments
|
2014-09-05 22:07:46 +00:00
|
|
|
--template="${CMAKE_CURRENT_BINARY_DIR}/rst_template.txt"
|
2013-07-09 17:00:40 +00:00
|
|
|
--stylesheet=css/rst.css
|
|
|
|
--link-stylesheet
|
2014-04-09 20:43:38 +00:00
|
|
|
"${infile}" "${outfile}"
|
2013-07-09 17:00:40 +00:00
|
|
|
DEPENDS
|
2014-04-09 20:43:38 +00:00
|
|
|
"${infile}" rst_template.txt nav_template.txt
|
2013-07-04 17:47:56 +00:00
|
|
|
)
|
|
|
|
|
2014-04-09 20:43:38 +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
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
install(
|
2013-07-09 17:00:40 +00:00
|
|
|
FILES
|
2014-04-09 20:43:38 +00:00
|
|
|
"${outfile}"
|
2014-09-05 22:07:46 +00:00
|
|
|
DESTINATION
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_DOCDIR_BASE}"
|
2014-09-05 22:07:46 +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})
|
2014-04-09 20:43:38 +00:00
|
|
|
set(infile "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
|
|
|
|
set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${src}")
|
2013-07-09 17:00:40 +00:00
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
2014-04-09 20:43:38 +00:00
|
|
|
"${outfile}"
|
2013-07-09 17:00:40 +00:00
|
|
|
COMMAND
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_COMMAND}"
|
2013-07-09 17:00:40 +00:00
|
|
|
ARGS
|
2014-04-09 20:43:38 +00:00
|
|
|
-E copy "${infile}" "${outfile}"
|
2013-07-04 17:47:56 +00:00
|
|
|
)
|
|
|
|
|
2014-04-09 20:43:38 +00:00
|
|
|
add_custom_target( ${src} DEPENDS "${outfile}")
|
2013-07-09 17:00:40 +00:00
|
|
|
|
|
|
|
list(APPEND HTML_TARGETS ${src})
|
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
install(
|
2013-07-09 17:00:40 +00:00
|
|
|
FILES
|
2014-04-09 20:43:38 +00:00
|
|
|
"${outfile}"
|
2014-09-05 22:07:46 +00:00
|
|
|
DESTINATION
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_DOCDIR_BASE}"
|
2013-07-04 17:47:56 +00:00
|
|
|
)
|
2013-07-09 17:00:40 +00:00
|
|
|
endforeach()
|
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
# copy the site resources to the build area so that the
|
2013-07-09 17:00:40 +00:00
|
|
|
# documentation can be read without an install
|
|
|
|
add_custom_target(doc_html_images
|
|
|
|
COMMAND
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/images" "${CMAKE_CURRENT_BINARY_DIR}/images"
|
2013-07-09 17:00:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(doc_html_css
|
|
|
|
COMMAND
|
2014-04-09 20:43:38 +00:00
|
|
|
${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/css" "${CMAKE_CURRENT_BINARY_DIR}/css"
|
2013-07-09 17:00:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(doc_tipuesearch
|
|
|
|
COMMAND
|
2014-04-09 20:43:38 +00:00
|
|
|
${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/tipuesearch" "${CMAKE_CURRENT_BINARY_DIR}/tipuesearch"
|
2013-07-09 17:00:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# build search index and insert navigation tab
|
|
|
|
add_custom_target(search_index
|
|
|
|
COMMAND
|
2014-04-09 20:43:38 +00:00
|
|
|
"${PYTHON_EXECUTABLE}"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/processHtml.py"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/nav_template.txt"
|
2014-09-05 22:07:46 +00:00
|
|
|
DEPENDS
|
2014-04-09 20:43:38 +00:00
|
|
|
${HTML_TARGETS}
|
|
|
|
${RST_TARGETS}
|
2013-07-09 17:00:40 +00:00
|
|
|
doc_tipuesearch
|
|
|
|
)
|
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
add_custom_target(doc_html
|
|
|
|
DEPENDS
|
|
|
|
search_index
|
2014-04-09 20:43:38 +00:00
|
|
|
${HTML_TARGETS}
|
|
|
|
${RST_TARGETS}
|
2014-09-05 22:07:46 +00:00
|
|
|
doc_html_images
|
|
|
|
doc_html_css
|
2013-07-09 17:00:40 +00:00
|
|
|
doc_tipuesearch
|
|
|
|
)
|
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
install(
|
2013-07-09 17:00:40 +00:00
|
|
|
DIRECTORY
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/tipuesearch"
|
2014-09-05 22:07:46 +00:00
|
|
|
DESTINATION
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_DOCDIR_BASE}"
|
2013-07-09 17:00:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
install(
|
2013-07-09 17:00:40 +00:00
|
|
|
DIRECTORY
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/images"
|
2014-09-05 22:07:46 +00:00
|
|
|
DESTINATION
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_DOCDIR_BASE}"
|
2013-07-09 17:00:40 +00:00
|
|
|
)
|
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
install(
|
2013-07-09 17:00:40 +00:00
|
|
|
DIRECTORY
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/css"
|
2014-09-05 22:07:46 +00:00
|
|
|
DESTINATION
|
2014-04-09 20:43:38 +00:00
|
|
|
"${CMAKE_DOCDIR_BASE}"
|
2013-07-09 17:00:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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})
|