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
|
2016-07-09 05:45:33 +00:00
|
|
|
"${OpenSubdiv_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
|
2015-06-16 03:16:47 +00:00
|
|
|
compatibility.rst
|
2015-06-22 23:11:37 +00:00
|
|
|
contributing.rst
|
2015-02-28 00:09:17 +00:00
|
|
|
downloads.rst
|
2013-07-09 17:00:40 +00:00
|
|
|
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
|
2015-06-20 20:20:46 +00:00
|
|
|
hedits.rst
|
2013-07-30 02:14:19 +00:00
|
|
|
hbr_overview.rst
|
2014-09-05 22:07:46 +00:00
|
|
|
intro.rst
|
2015-06-18 03:19:14 +00:00
|
|
|
intro_30.rst
|
2014-11-13 21:57:34 +00:00
|
|
|
license.rst
|
2015-01-15 02:11:10 +00:00
|
|
|
mod_notes.rst
|
2013-07-30 02:14:19 +00:00
|
|
|
osd_overview.rst
|
2015-06-18 00:26:09 +00:00
|
|
|
osd_shader_interface.rst
|
2015-06-09 20:21:03 +00:00
|
|
|
porting.rst
|
2015-07-14 01:13:54 +00:00
|
|
|
references.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_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
|
2014-10-27 21:31:04 +00:00
|
|
|
set(RELEASE_STRING "${RELEASE_STRING}")
|
2014-09-05 22:07:46 +00:00
|
|
|
|
|
|
|
# Replace string in navigation bar
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/rst_template.txt"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/rst_template.txt" )
|
|
|
|
|
2014-12-01 23:52:58 +00:00
|
|
|
# Process rst markup files
|
2013-07-09 17:00:40 +00:00
|
|
|
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
|
|
|
|
2014-12-01 23:52:58 +00:00
|
|
|
# Generate tutorials pages
|
|
|
|
|
|
|
|
# XXXX manuelk we should push more of this logic into the python script
|
|
|
|
set(TUTORIAL_CODE
|
|
|
|
hbr/tutorial_0/hbr_tutorial_0.cpp
|
|
|
|
hbr/tutorial_1/hbr_tutorial_1.cpp
|
|
|
|
hbr/tutorial_2/hbr_tutorial_2.cpp
|
|
|
|
far/tutorial_0/far_tutorial_0.cpp
|
|
|
|
far/tutorial_1/far_tutorial_1.cpp
|
|
|
|
far/tutorial_2/far_tutorial_2.cpp
|
|
|
|
far/tutorial_3/far_tutorial_3.cpp
|
|
|
|
far/tutorial_4/far_tutorial_4.cpp
|
|
|
|
far/tutorial_5/far_tutorial_5.cpp
|
|
|
|
far/tutorial_6/far_tutorial_6.cpp
|
|
|
|
far/tutorial_7/far_tutorial_7.cpp
|
|
|
|
osd/tutorial_0/osd_tutorial_0.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(tutorial ${TUTORIAL_CODE})
|
|
|
|
get_filename_component(BASENAME ${tutorial} NAME_WE)
|
|
|
|
|
|
|
|
string(REGEX REPLACE "(/)" "_" TARGET_NAME ${tutorial})
|
2016-07-09 05:45:33 +00:00
|
|
|
set(infile "${OpenSubdiv_SOURCE_DIR}/tutorials/${tutorial}")
|
2014-12-01 23:52:58 +00:00
|
|
|
set(rstfile "${CMAKE_CURRENT_BINARY_DIR}/${BASENAME}.rst")
|
|
|
|
set(htmlfile "${CMAKE_CURRENT_BINARY_DIR}/${BASENAME}.html")
|
|
|
|
|
|
|
|
# Process C++ code to ReST
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
"${rstfile}"
|
|
|
|
COMMAND
|
|
|
|
"${PYTHON_EXECUTABLE}"
|
|
|
|
ARGS
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/processTutorials.py"
|
|
|
|
"${infile}"
|
|
|
|
"${rstfile}"
|
2014-12-02 02:49:51 +00:00
|
|
|
"${tutorial}"
|
2014-12-01 23:52:58 +00:00
|
|
|
DEPENDS
|
|
|
|
${infile}
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/processTutorials.py"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Convert ReST to HTML
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
"${htmlfile}"
|
|
|
|
COMMAND
|
|
|
|
"${RST2HTML_EXECUTABLE}"
|
|
|
|
ARGS
|
|
|
|
--date
|
|
|
|
--time
|
|
|
|
--no-xml-declaration
|
|
|
|
--initial-header-level=3
|
|
|
|
--strip-comments
|
|
|
|
--template="${CMAKE_CURRENT_BINARY_DIR}/rst_template.txt"
|
|
|
|
--stylesheet=css/rst.css
|
|
|
|
--link-stylesheet
|
|
|
|
"${rstfile}" "${htmlfile}"
|
|
|
|
DEPENDS
|
|
|
|
"${rstfile}" rst_template.txt nav_template.txt
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND RST_TARGETS ${TARGET_NAME})
|
|
|
|
|
|
|
|
add_custom_target(${TARGET_NAME} DEPENDS "${htmlfile}")
|
|
|
|
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
"${htmlfile}"
|
|
|
|
DESTINATION
|
|
|
|
"${CMAKE_DOCDIR_BASE}"
|
|
|
|
PERMISSIONS
|
|
|
|
OWNER_READ GROUP_READ WORLD_READ
|
|
|
|
)
|
|
|
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Copy html files to the build area
|
2013-07-09 17:00:40 +00:00
|
|
|
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-12-01 23:52:58 +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}
|
2014-12-01 23:52:58 +00:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/processHtml.py"
|
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})
|