Permalink
Browse files

add pandoc dependency for building the cookbook in cmake

  • Loading branch information...
1 parent affc926 commit 71e11847e33c38c44161bc32579d6fe0cadd4a8b @karlnapf karlnapf committed Oct 24, 2016
Showing with 29 additions and 4 deletions.
  1. +4 −3 CMakeLists.txt
  2. +24 −0 cmake/FindPandoc.cmake
  3. +1 −1 cmake/FindSphinx.cmake
View
@@ -734,9 +734,10 @@ ENDIF(BUILD_META_EXAMPLES)
# add meta example dir below after tests have been defined
-# cookbook and dependencies
-find_package(Sphinx)
-IF(BUILD_META_EXAMPLES AND SPHINX_FOUND)
+# cookbook and dependencies (note there are in fact more, see its requirements.txt)
+FIND_PACKAGE(Sphinx)
+FIND_PACKAGE(Pandoc)
+IF(BUILD_META_EXAMPLES AND SPHINX_FOUND AND PANDOC_FOUND)
SET(BUILD_COOKBOOK 1)
ENDIF()
@@ -0,0 +1,24 @@
+# Midified from https://llvm.org/svn/llvm-project/llvm/trunk/cmake/modules/FindSphinx.cmake
+# under "UIUC" BSD-Style license.
+# CMake find_package() Module for pandoc markdown converter, http://pandoc.org/
+#
+# Example usage:
+#
+# find_package(Pandoc)
+#
+# If successful the following variables will be defined
+# PANDOC_FOUND
+# PANDOC_EXECUTABLE
+
+find_program(PANDOC_EXECUTABLE
+ NAMES pandoc
+ PATH /usr/local/bin
+ DOC "Path to pandoc executable")
+
+# Handle REQUIRED and QUIET arguments
+# this will also set PANDOC_FOUND to true if PANDOC_EXECUTABLE exists
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Pandoc
+ "Failed to locate pandoc executable"
+ PANDOC_EXECUTABLE)
+
@@ -1,4 +1,4 @@
-# Talen from https://llvm.org/svn/llvm-project/llvm/trunk/cmake/modules/FindSphinx.cmake
+# Taken from https://llvm.org/svn/llvm-project/llvm/trunk/cmake/modules/FindSphinx.cmake
# under "UIUC" BSD-Style license.
# CMake find_package() Module for Sphinx documentation generator
# http://sphinx-doc.org/

0 comments on commit 71e1184

Please sign in to comment.