Skip to content

Commit

Permalink
add doc and targets
Browse files Browse the repository at this point in the history
  • Loading branch information
theoreticalbts committed Feb 28, 2017
1 parent bfdf76e commit a134b6b
Show file tree
Hide file tree
Showing 3 changed files with 411 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ if(ENABLE_COVERAGE_TESTING)
endif()

# external_plugins needs to be compiled first because libraries/app depends on STEEMIT_EXTERNAL_PLUGINS being fully populated
add_subdirectory( doc/src )
add_subdirectory( external_plugins )
add_subdirectory( libraries )
add_subdirectory( programs )
Expand Down
36 changes: 36 additions & 0 deletions doc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# These macros loosely based on https://github.com/sabel83/mpllibs/blob/8e245aedcf658fe77bb29537aeba1d4e1a619a19/cmake/Pandoc.cmake
macro(pandoc_build_html TARGET_NAME OUTDIR)
set(OUTFILES)
foreach(INFILE ${ARGN})
get_filename_component(FILENAME ${INFILE} NAME_WE)
set(OUTFILE ${OUTDIR}/${FILENAME}.html)
set(OUTFILES ${OUTFILES} ${OUTFILE})
add_custom_command(
OUTPUT ${OUTFILE}
COMMAND
${PANDOC} --from markdown --to html -c style.css -o ${OUTFILE} ${IT}
DEPENDS ${IT}
)
endforeach(IT)
add_custom_target(${TARGET_NAME} DEPENDS ${OUTFILES})
endmacro(pandoc_build)

macro(pandoc_build_pdf TARGET_NAME OUTDIR)
set(OUTFILES)
foreach(INFILE ${ARGN})
get_filename_component(FILENAME ${INFILE} NAME_WE)
set(OUTFILE ${OUTDIR}/${FILENAME}.html)
set(OUTFILES ${OUTFILES} ${OUTFILE})
message( STATUS "outfile is ${OUTFILE}" )
add_custom_command(
OUTPUT ${OUTFILE}
COMMAND
${PANDOC} --from markdown --to pdf -o ${OUTFILE} ${IT}
DEPENDS ${IT}
)
endforeach(IT)
add_custom_target(${TARGET_NAME} DEPENDS ${OUTFILES})
endmacro(pandoc_build)

pandoc_build_pdf( curation_pdf ${CMAKE_CURRENT_BINARY_DIR}/doc )
Loading

0 comments on commit a134b6b

Please sign in to comment.