From 9d02312603b2d418599123bed909d0f9210715d4 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Fri, 13 Sep 2013 13:51:28 -0400 Subject: [PATCH] [doc] preproc: translate {{INSTALL_PREFIX}} preproc.sh now translates the {{INSTALL_PREFIX}} string as well as the {{OWLPS_VERSION}} string. Both values are now obtained from the corresponding environment variables (OWLPS_VERSION was previously obtained through a special git command). --- doc/CMakeLists.txt | 2 +- doc/preproc.sh | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index a0d3a54..5933b06 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -40,7 +40,7 @@ else() # Command to generate the man page add_custom_command( OUTPUT "${TARGET}" - COMMAND "${PREPROC_MAN}" "${SOURCE}" | "${TXT2TAGS_EXECUTABLE}" -q --infile=- --outfile="${TARGET}" -t man + COMMAND OWLPS_VERSION=${OWLPS_VERSION} INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} "${PREPROC_MAN}" "${SOURCE}" | "${TXT2TAGS_EXECUTABLE}" -q --infile=- --outfile="${TARGET}" -t man DEPENDS "${SOURCE}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Generating ${TARGETNAME}") diff --git a/doc/preproc.sh b/doc/preproc.sh index 318d8d6..715764d 100755 --- a/doc/preproc.sh +++ b/doc/preproc.sh @@ -3,10 +3,11 @@ # This script is for preprocessing the files before to call txt2tags. # # Modifications done: -# - Replaces all the occurrences of {{OWLPS_VERSION}} by the current Git -# version (as provided by git describe). +# - Replaces all the occurrences of {{OWLPS_VERSION}} by the value of +# the OWLPS_VERSION environment variable. +# - Replaces all the occurrences of {{INSTALL_PREFIX}} by the value of +# the INSTALL_PREFIX environment variable. -# OwlPS source version -OWLPS_VERSION=$(git describe 2>/dev/null || echo 'UNKNOWN_VERSION') - -sed "s/{{OWLPS_VERSION}}/${OWLPS_VERSION}/g" $@ +sed "{ \ + s/{{OWLPS_VERSION}}/${OWLPS_VERSION}/g ; \ + s@{{INSTALL_PREFIX}}@${INSTALL_PREFIX}@g }" $@