forked from lammps/lammps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lammps#4324 from rbberger/cmake_optional_docenv
Make CMake Doc build docenv optional
- Loading branch information
Showing
2 changed files
with
59 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Find sphinx-build | ||
find_program(Sphinx_EXECUTABLE NAMES sphinx-build | ||
PATH_SUFFIXES bin | ||
DOC "Sphinx documenation build executable") | ||
mark_as_advanced(Sphinx_EXECUTABLE) | ||
|
||
if(Sphinx_EXECUTABLE) | ||
execute_process(COMMAND ${Sphinx_EXECUTABLE} --version | ||
OUTPUT_VARIABLE sphinx_version | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
RESULT_VARIABLE _sphinx_version_result) | ||
|
||
if(_sphinx_version_result) | ||
message(WARNING "Unable to determine sphinx-build verison: ${_sphinx_version_result}") | ||
else() | ||
string(REGEX REPLACE "sphinx-build ([0-9.]+).*" | ||
"\\1" | ||
Sphinx_VERSION | ||
"${sphinx_version}") | ||
endif() | ||
|
||
if(NOT TARGET Sphinx::sphinx-build) | ||
add_executable(Sphinx::sphinx-build IMPORTED GLOBAL) | ||
set_target_properties(Sphinx::sphinx-build PROPERTIES IMPORTED_LOCATION "${Sphinx_EXECUTABLE}") | ||
endif() | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Sphinx REQUIRED_VARS Sphinx_EXECUTABLE VERSION_VAR Sphinx_VERSION) |