summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-05-05 06:37:30 -0700
committerCraig Earls <enderw88@gmail.com>2014-05-05 06:37:30 -0700
commit8c787122584e47485dfcdcba0a21a951fb82051d (patch)
treefb3dee86044b5bde83690e5310904f5a61bb86df
parent07b206bf6abe582ff155a4094fd81d002469ba5d (diff)
parentdcb285ac556aa54aa01c60b3c1c9fa40199d8f06 (diff)
downloadfork-ledger-8c787122584e47485dfcdcba0a21a951fb82051d.tar.gz
fork-ledger-8c787122584e47485dfcdcba0a21a951fb82051d.tar.bz2
fork-ledger-8c787122584e47485dfcdcba0a21a951fb82051d.zip
Merge pull request #283 from afh/pull/builddocs
Improve building and installing ledger documentation files
-rw-r--r--CMakeLists.txt2
-rwxr-xr-xacprep5
-rw-r--r--doc/CMakeLists.txt34
3 files changed, 33 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b7289748..a6e52f95 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@ option(DISABLE_ASSERTS "Build without any internal consistency checks" OFF)
option(BUILD_DEBUG "Build support for runtime debugging" OFF)
option(BUILD_LIBRARY "Build and install Ledger as a library" ON)
-option(BUILD_DOCS "Build and install documentation" ON)
+option(BUILD_DOCS "Build and install documentation" OFF)
option(BUILD_WEB_DOCS "Build version of documentation suitable for viewing online" OFF)
option(BUILD_EMACSLISP "Build and install ledger-mode for Emacs" OFF)
diff --git a/acprep b/acprep
index 754a2427..f9fb74d7 100755
--- a/acprep
+++ b/acprep
@@ -875,6 +875,9 @@ class PrepareBuild(CommandLineApp):
if self.options.boost_include:
conf_args.append('-DBOOST_INCLUDEDIR=%s' %
self.options.boost_include)
+ if self.options.build_dir:
+ conf_args.append('-DBUILD_DIR=%s' %
+ self.options.build_dir)
if self.prefix_directory():
conf_args.append('-DCMAKE_INSTALL_PREFIX=%s' % self.prefix_directory())
@@ -942,7 +945,7 @@ class PrepareBuild(CommandLineApp):
make_args.append('-j%d' % self.options.jobs)
if self.options.verbose:
- make_args.append('VERBOSE=1')
+ make_args.append('-v' if self.options.use_ninja else 'VERBOSE=1')
self.log.debug('Configure arguments => ' + str(config_args))
self.log.debug('Makefile arguments => ' + str(make_args))
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 15f1318c..8a9ba2fd 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -36,6 +36,7 @@ set(info_files ledger3.texi ledger-mode.texi)
find_program(MAKEINFO makeinfo)
find_program(TEXI2PDF texi2pdf)
+find_program(TEX tex)
find_program(MAN2HTML man2html)
find_program(GROFF groff)
@@ -43,11 +44,21 @@ find_program(GROFF groff)
foreach(file ${info_files})
get_filename_component(file_base ${file} NAME_WE)
+
+ if(NOT MAKEINFO)
+ message(WARNING "Could not find makeinfo. Info version of documentation cannot be built.")
+ else()
+ add_custom_command(OUTPUT ${file_base}.info
+ COMMAND makeinfo --force --no-split -o ${file_base}.info ${CMAKE_CURRENT_SOURCE_DIR}/${file}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
+ VERBATIM)
+ list(APPEND ledger_doc_files ${file_base}.info)
+ endif()
+
if(BUILD_WEB_DOCS)
if(NOT MAKEINFO)
- message(FATAL_ERROR "Could not find makeinfo. HTML version of documentation cannot be built.")
+ message(WARNING "Could not find makeinfo. HTML version of documentation cannot be built.")
endif()
-
add_custom_command(OUTPUT ${file_base}.html
COMMAND makeinfo --force --html --no-split -o ${file_base}.html ${CMAKE_CURRENT_SOURCE_DIR}/${file}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
@@ -55,8 +66,8 @@ foreach(file ${info_files})
list(APPEND ledger_doc_files ${file_base}.html)
endif(BUILD_WEB_DOCS)
- if(NOT TEXI2PDF)
- message(WARNING "Could not find texi2pdf. PDF version of documentation will not be built.")
+ if(NOT TEXI2PDF OR NOT TEX)
+ message(WARNING "Could not find texi2pdf or tex. PDF version of documentation will not be built.")
else()
if(BUILD_A4_PDF)
set(papersize --texinfo=@afourpaper)
@@ -109,8 +120,19 @@ endif(CMAKE_INSTALL_MANDIR)
foreach(file ${info_files})
get_filename_component(file_base ${file} NAME_WE)
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file}
+ if (CMAKE_SOURCE_DIR STREQUAL BUILD_DIR)
+ set(doc_dir CMAKE_CURRENT_SOURCE_DIR)
+ else()
+ get_filename_component(dir_base ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
+ set(doc_dir "${CMAKE_SOURCE_DIR}/${BUILD_DIR}/${dir_base}")
+ endif()
+
+ install(FILES ${doc_dir}/${file_base}.info
DESTINATION ${CMAKE_INSTALL_INFODIR} COMPONENT doc)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file_base}.pdf
+ install(FILES ${doc_dir}/${file_base}.pdf
DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc OPTIONAL)
+ if (BUILD_WEB_DOCS)
+ install(FILES ${doc_dir}/${file_base}.html
+ DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT doc)
+ endif(BUILD_WEB_DOCS)
endforeach()