Only use $(MAKE) in doc target if make is used as generator

The old behavior broke builds with other CMake generators like Ninja as it obviously has no concept of $(MAKE)
This commit is contained in:
Dominik Schmidt 2017-09-22 11:15:35 +02:00 коммит произвёл Markus Goetz
Родитель 30957479a3
Коммит 7f51803d04
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -41,7 +41,13 @@ if(SPHINX_FOUND)
-D latex_logo=${LATEX_LOGO} -D latex_logo=${LATEX_LOGO}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${SPHINX_PDF_DIR} ) ${SPHINX_PDF_DIR} )
add_custom_target(doc-pdf $(MAKE) -C ${SPHINX_PDF_DIR} all-pdf
set(MAKE "make" CACHE FILEPATH "make to be used for documentation generation if not using make as generator anyway")
if(CMAKE_GENERATOR MATCHES "Makefiles")
set(MAKE "$(MAKE)")
endif()
add_custom_target(doc-pdf ${MAKE} -C ${SPHINX_PDF_DIR} all-pdf
DEPENDS doc-latex ) DEPENDS doc-latex )
add_dependencies(doc doc-pdf) add_dependencies(doc doc-pdf)
endif(PDFLATEX_FOUND) endif(PDFLATEX_FOUND)