PATTERN "CMakeLists.txt" EXCLUDE
PATTERN "doxygen" EXCLUDE
PATTERN "*.in" EXCLUDE
+ PATTERN "news" EXCLUDE
)
CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/source/
${CMAKE_BINARY_DIR}/include/
${CMAKE_SOURCE_DIR}/doc/news/
+ ${CMAKE_BINARY_DIR}/doc/news/
${CMAKE_CURRENT_BINARY_DIR}/tutorial/tutorial.h
)
##
## ---------------------------------------------------------------------
+
#
# Set up all necessary bits for the changelog generation
#
#
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/changes.h
- COMMAND
- ${CMAKE_CURRENT_SOURCE_DIR}/changes/create_changes_h.sh
- > ${CMAKE_CURRENT_BINARY_DIR}/changes.h
+ COMMAND ${CMAKE_COMMAND} -DOUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/changes.h
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/changes/create_changes_h.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/changes
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/changes/header
${CMAKE_CURRENT_SOURCE_DIR}/changes/header_incompatibilities
${CMAKE_CURRENT_SOURCE_DIR}/changes/header_major
${CMAKE_CURRENT_SOURCE_DIR}/changes/header_minor
- ${CMAKE_CURRENT_SOURCE_DIR}/changes/create_changes_h.sh
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes/footer
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes/major
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes/minor
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes/incompatibilities
)
ADD_CUSTOM_TARGET(changelog ALL
ADD_DEPENDENCIES(documentation changelog)
- #
- # Install the static elements of the html documentation:
- #
-
ENDIF(DEAL_II_COMPONENT_DOCUMENTATION)
--- /dev/null
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2016 by the deal.II Authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+# Auxiliary functions
+FUNCTION(CAT IN_FILE OUT_FILE INDENT)
+ FILE(READ ${IN_FILE} CONTENTS)
+ IF(${INDENT} MATCHES "TRUE")
+ FILE(STRINGS ${IN_FILE} LINESTMP)
+ FOREACH(LINETMP ${LINESTMP})
+ FILE(APPEND ${OUT_FILE} " ${LINETMP}\n")
+ ENDFOREACH()
+ ELSE()
+ FILE(APPEND ${OUT_FILE} "${CONTENTS}")
+ ENDIF()
+ENDFUNCTION()
+
+FUNCTION(PROCESS IN_DIR OUT_FILE)
+ FILE(APPEND ${OUT_FILE} "<ol>\n")
+ FILE(GLOB ENTRY_LIST ${IN_DIR}/[0-9]*)
+ LIST(SORT ENTRY_LIST)
+ LIST(REVERSE ENTRY_LIST)
+ FOREACH(ENTRY ${ENTRY_LIST})
+ FILE(APPEND ${OUT_FILE} "\n <li>\n")
+ CAT(${ENTRY} ${OUT_FILE} "TRUE")
+ FILE(APPEND ${OUT_FILE} " </li>\n")
+ ENDFOREACH()
+ FILE(APPEND ${OUT_FILE} "\n</ol>\n")
+ENDFUNCTION()
+
+# Generate 'changes.h'.
+
+# First, create a file 'changes.h.in' based on all changelog fragments.
+FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "")
+CAT (${CMAKE_CURRENT_SOURCE_DIR}/header
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE")
+CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_incompatibilities
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE")
+PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/incompatibilities
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in)
+CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_major
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE")
+PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/major
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in)
+CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_minor
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE")
+PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/minor
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in)
+CAT (${CMAKE_CURRENT_SOURCE_DIR}/footer
+ ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE")
+
+# Copy it over to 'changes.h' but only touch the time stamp
+# if the file actually changed (this is what CONFIGURE_FILE does).
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in ${OUTPUT_FILE} COPYONLY)
+++ /dev/null
-#!/bin/bash
-## ---------------------------------------------------------------------
-##
-## Copyright (C) 2016 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## The deal.II library is free software; you can use it, redistribute
-## it, and/or modify it under the terms of the GNU Lesser General
-## Public License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-## The full text of the license can be found in the file LICENSE at
-## the top level of the deal.II distribution.
-##
-## ---------------------------------------------------------------------
-
-#
-# This script creates "changes.h.new" from the contributions in the subfolders
-# of ./doc/news/changes.
-#
-# The script needs to be executed as
-# ./create_changes_h.sh
-# from ./doc/news/changes. It simply outputs its results to the console,
-# from where the text can be captured to a file.
-
-
-
-if test ! -d incompatibilities -o ! -d major -o ! -d minor ; then
- echo "*** This script must be run from ./doc/news/changes!"
- exit 1
-fi
-
-
-function process_directory
-{
- echo "<ol>"
- # process all entries in the right order
- ARRAY=($(ls "$1" | sort -r))
- for f in "${ARRAY[@]}"; do
- echo ""
- echo -n " <li>"
- # indent lines by one blank space
- sed 's/^[ ]*/ /' "$1"/"$f"
- echo " </li>"
- done
- echo ""
- echo "</ol>"
-}
-
-
-
-cat header
-
-cat header_incompatibilities
-process_directory incompatibilities
-
-cat header_major
-process_directory major
-
-cat header_minor
-process_directory minor
-
-cat footer