diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index f603eac55..f706a701c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -41,7 +41,13 @@ if(SPHINX_FOUND) -D latex_logo=${LATEX_LOGO} ${CMAKE_CURRENT_SOURCE_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 ) add_dependencies(doc doc-pdf) endif(PDFLATEX_FOUND)