Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
opengm: Added a patch to let us skip the sphinx docs build with a cma…
Browse files Browse the repository at this point in the history
…ke switch.
  • Loading branch information
stuarteberg committed May 28, 2014
1 parent 4d9ddf1 commit 6f444ef
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 1 deletion.
6 changes: 5 additions & 1 deletion opengm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ ExternalProject_Add(${opengm_NAME}
GIT_REPOSITORY ${opengm_URL}
GIT_TAG ${opengm_TAG}
UPDATE_COMMAND ""
PATCH_COMMAND ""
# This patch adds the BUILD_PYTHON_DOCS setting, used to avoid building the sphinx documentation.
# Future versions of OpenGM will probably not need this patch.
PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE}
${opengm_SRC_DIR}/src/interfaces/python/CMakeLists.txt ${PATCH_DIR}/opengm.patch

CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${opengm_SRC_DIR}
-DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR}
Expand All @@ -42,6 +45,7 @@ ExternalProject_Add(${opengm_NAME}
-DWITH_BOOST=ON
-DWITH_HDF5=ON
-DBUILD_PYTHON_WRAPPER=ON
-DBUILD_PYTHON_DOCS=OFF
-DWITH_OPENMP=OFF # Mac doesn't support OpenMP
${CMAKE_CPLEX_ROOT_DIR}

Expand Down
89 changes: 89 additions & 0 deletions patches/opengm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
--- src/interfaces/python/CMakeLists.txt 2014-05-28 16:03:43.000000000 -0400
+++ src/interfaces/python/CMakeLists.txt2 2014-05-28 16:03:38.000000000 -0400
@@ -16,47 +16,50 @@

message(STATUS ${OPENGM_PYTHON_BUILD_MODULE_DIR})

-find_package(SPHINX)
-if(SPHINX_FOUND)
- message(STATUS "FOUND_SPHINX")
+set( BUILD_PYTHON_DOCS 0 CACHE BOOL "Build the Python documentation with Sphinx" )

- if(NOT DEFINED SPHINX_THEME)
- set(SPHINX_THEME default)
+if(BUILD_PYTHON_DOCS)
+ find_package(SPHINX)
+ if(SPHINX_FOUND)
+ message(STATUS "FOUND_SPHINX")
+
+ if(NOT DEFINED SPHINX_THEME)
+ set(SPHINX_THEME default)
+ endif()
+ if(NOT DEFINED SPHINX_THEME_DIR)
+ set(SPHINX_THEME_DIR)
+ endif()
+ # configured documentation tools and intermediate build results
+ set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build)
+ # Sphinx cache with pickled ReST documents
+ set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/opengm/_doctrees")
+ # HTML output directory
+ set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/opengm/html")
+ configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source/conf.py.in"
+ #"${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source/conf.py"
+ "${BINARY_BUILD_DIR}/conf.py"
+ @ONLY)
+ add_custom_target(python-doc ALL
+ ${SPHINX_EXECUTABLE}
+ -q -b html
+ #-c "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source"
+ -c "${BINARY_BUILD_DIR}"
+ -d "${SPHINX_CACHE_DIR}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source"
+ "${SPHINX_HTML_DIR}"
+ COMMENT "Building HTML documentation with Sphinx")
+ add_dependencies(python-doc _opengmcore )
+ add_dependencies(python-doc _inference )
+ add_dependencies(python-doc _hdf5 )
+
+ else()
+ message(STATUS "CANNOT Building HTML documentation with Sphinx , did not find Sphinx")
endif()
- if(NOT DEFINED SPHINX_THEME_DIR)
- set(SPHINX_THEME_DIR)
- endif()
- # configured documentation tools and intermediate build results
- set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
- file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build)
- # Sphinx cache with pickled ReST documents
- set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/opengm/_doctrees")
- # HTML output directory
- set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/opengm/html")
- configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source/conf.py.in"
- #"${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source/conf.py"
- "${BINARY_BUILD_DIR}/conf.py"
- @ONLY)
- add_custom_target(python-doc ALL
- ${SPHINX_EXECUTABLE}
- -q -b html
- #-c "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source"
- -c "${BINARY_BUILD_DIR}"
- -d "${SPHINX_CACHE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}/docsrc/source"
- "${SPHINX_HTML_DIR}"
- COMMENT "Building HTML documentation with Sphinx")
- add_dependencies(python-doc _opengmcore )
- add_dependencies(python-doc _inference )
- add_dependencies(python-doc _hdf5 )
-
-else()
- message(STATUS "CANNOT Building HTML documentation with Sphinx , did not find Sphinx")
endif()





-

0 comments on commit 6f444ef

Please sign in to comment.