2018-12-20 12:17:15 +08:00
# # # # sol3
# The MIT License (MIT)
#
2019-03-13 17:18:06 +08:00
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
2018-12-20 12:17:15 +08:00
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# # # # sol3, documentation generation
# # # Required minimum version statement
cmake_minimum_required ( VERSION 3.5.0 )
2019-08-15 13:26:52 +08:00
find_package ( Python3 COMPONENTS Interpreter )
2018-12-20 12:17:15 +08:00
2020-01-17 18:22:52 +08:00
if ( NOT Python3_FOUND AND NOT Python3_Interpreter_FOUND )
2018-12-27 15:17:25 +08:00
message ( FATAL_ERROR "sol2 documentation cannot be generated as python 3 has not been found: install or set the python 3 interpreter for the docs to find it and be sure to pip install sphinx" )
2018-12-20 12:17:15 +08:00
endif ( )
find_program ( sol2_make_executable make make.exe mingw32-make mingw32-make.exe )
2018-12-27 15:17:25 +08:00
if ( NOT sol2_make_executable )
message ( FATAL_ERROR "could not find a suitable make executable to build Sphinx documentation" )
2018-12-20 12:17:15 +08:00
endif ( )
2018-12-27 15:17:25 +08:00
add_custom_command ( OUTPUT docs_invisible_file_always_generate
U S E S _ T E R M I N A L
C O M M A N D " $ { s o l 2 _ m a k e _ e x e c u t a b l e } " - C " $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } " h t m l " B U I L D D I R = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } " )
add_custom_target ( docs
D E P E N D S d o c s _ i n v i s i b l e _ f i l e _ a l w a y s _ g e n e r a t e )
install ( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/docs/html" DESTINATION "${CMAKE_INSTALL_DOCDIR}" )