Added Make targets for PDF and HTML generation.

This commit is contained in:
Markus Makela 2015-02-09 19:39:10 +02:00
parent 0afbc4e503
commit bd10215a84
6 changed files with 79 additions and 3 deletions

View File

@ -21,9 +21,19 @@ check_dirs()
find_package(Valgrind)
find_package(MySQLClient)
find_package(MySQL)
find_package(Pandoc)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/modules)
# Make sure the release notes for this release are present if it is a stable one
if(${MAXSCALE_VERSION} MATCHES "-stable")
file(GLOB ${CMAKE_SOURCE_DIR}/Documentation/Release-Notes RELEASE_NOTES *${MAXSCALE_VERSION_NUMERIC}*.md)
list(LENGTH RELEASE_NOTES HAVE_NOTES)
if( NOT HAVE_NOTES EQUAL 1)
message(FATAL_ERROR "Could not find the release notes for this stable release: ${MAXSCALE_VERSION_NUMERIC}")
endif()
endif()
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/server/include)
configure_file(${CMAKE_SOURCE_DIR}/server/include/version.h.in ${CMAKE_BINARY_DIR}/server/include/version.h)
configure_file(${CMAKE_SOURCE_DIR}/server/test/maxscale_test.h.in ${CMAKE_BINARY_DIR}/server/include/maxscale_test.h)
@ -102,12 +112,11 @@ if(NOT WITHOUT_MAXADMIN)
add_subdirectory(client)
endif()
file(GLOB DOCS Documentation/*.pdf)
message(STATUS "Installing MaxScale to: ${CMAKE_INSTALL_PREFIX}/")
install(FILES server/MaxScale_template.cnf DESTINATION etc)
install(FILES ${ERRMSG} DESTINATION mysql)
install(FILES ${DOCS} DESTINATION Documentation)
install(FILES ${CMAKE_SOURCE_DIR}/COPYRIGHT DESTINATION .)
install(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION .)
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION .)
@ -230,3 +239,20 @@ add_custom_target(testall-valgrind
COMMENT "Running full test suite with Valgrind..." VERBATIM)
endif()
add_custom_target(generate_pdf
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Documentation ${CMAKE_BINARY_DIR}/Documentation
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/Documentation ${CMAKE_COMMAND}
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-P generate-pdf.cmake
COMMENT "Generating PDF files" VERBATIM)
add_custom_target(generate_html
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Documentation ${CMAKE_BINARY_DIR}/Documentation
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/Documentation ${CMAKE_COMMAND}
-DBUILD_DIR=${CMAKE_BINARY_DIR}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-P generate-html.cmake
COMMENT "Generating HTML files" VERBATIM)

View File

@ -48,7 +48,7 @@ MaxScale has added the ability to bind a listener for a service to a network add
The server version reported when connected to a database via MaxScale has now been altered. This now shows the MaxScale name and version together with the backend server name. An example of this can be seen below for the 0.5 release.
-bash-4.1$ mysql -h 127.0.0.1 -P 4006 -uxxxx -pxxxx Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 22320 Server version: MaxScale 0.5.0 MariaDB Server Copyright (c) 2000, 2012, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [(none)]> \s -------------- mysql Ver 15.1 Distrib 5.5.28a-MariaDB, for Linux (i686) using readline 5.1 ... Server: MySQL Server version: MaxScale 0.5.0 MariaDB Server ... -------------- MySQL [(none)]>
-bash-4.1$ mysql -h 127.0.0.1 -P 4006 -uxxxx -pxxxx Welcome to the MariaDB monitor. Commands end with ; or \\g. Your MySQL connection id is 22320 Server version: MaxScale 0.5.0 MariaDB Server Copyright (c) 2000, 2012, Oracle, Monty Program Ab and others. Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement. MySQL [(none)]> \\ys -------------- mysql Ver 15.1 Distrib 5.5.28a-MariaDB, for Linux (i686) using readline 5.1 ... Server: MySQL Server version: MaxScale 0.5.0 MariaDB Server ... -------------- MySQL [(none)]>
# Bug Fixes

View File

@ -0,0 +1,18 @@
# The BUILD_DIR variable is set at runtime
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/")
find_package(Pandoc)
if(PANDOC_FOUND AND BUILD_DIR)
file(MAKE_DIRECTORY ${BUILD_DIR}/html)
file(GLOB_RECURSE MARKDOWN *.md)
foreach(VAR ${MARKDOWN})
string(REPLACE ".md" ".html" OUTPUT ${VAR})
get_filename_component(DIR ${VAR} DIRECTORY)
string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}" "${BUILD_DIR}/html" FILE ${OUTPUT})
execute_process(COMMAND ${CMAKE_COMMAND} -E chdir ${DIR} ${PANDOC_EXECUTABLE} ${VAR} -o ${OUTPUT})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${OUTPUT} ${FILE})
endforeach()
endif()

View File

@ -0,0 +1,18 @@
# The BUILD_DIR variable is set at runtime
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/")
find_package(Pandoc)
if(PANDOC_FOUND AND BUILD_DIR)
file(MAKE_DIRECTORY ${BUILD_DIR}/pdf)
file(GLOB_RECURSE MARKDOWN *.md)
foreach(VAR ${MARKDOWN})
string(REPLACE ".md" ".pdf" OUTPUT ${VAR})
get_filename_component(DIR ${VAR} DIRECTORY)
string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}" "${BUILD_DIR}/pdf" FILE ${OUTPUT})
execute_process(COMMAND ${CMAKE_COMMAND} -E chdir ${DIR} ${PANDOC_EXECUTABLE} ${VAR} -o ${OUTPUT})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${OUTPUT} ${FILE})
endforeach()
endif()

13
cmake/FindPandoc.cmake Normal file
View File

@ -0,0 +1,13 @@
# This CMake file tries to find the Pandoc executable
# The following variables are set:
# PANDOC_FOUND - System has Pandoc
# PANDOC_EXECUTABLE - The Pandoc executable file
find_program(PANDOC_EXECUTABLE pandoc)
if(PANDOC_EXECUTABLE STREQUAL "PANDOC_EXECUTABLE-NOTFOUND")
message(STATUS "Pandoc not found.")
set(PANDOC_FOUND FALSE CACHE INTERNAL "")
unset(PANDOC_EXECUTABLE)
else()
message(STATUS "Pandoc found: ${PANDOC_EXECUTABLE}")
set(PANDOC_FOUND TRUE CACHE INTERNAL "")
endif()

View File

@ -1,3 +1,4 @@
function(debugmsg MSG)
if(DEBUG_OUTPUT)
message(STATUS "DEBUG: ${MSG}")