mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
Fixed generation of configure header, now replacing date fields
with current date. Added CMake script to generate a variable containing the current date. Removed last argument (the terminating NULL element) from output.
This commit is contained in:
parent
3fa1407c09
commit
38be366a67
@ -68,17 +68,26 @@ set(${MODULE_PREFIX}_LIBS
|
|||||||
${CMAKE_DL_LIBS})
|
${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
if(WITH_MANPAGES)
|
if(WITH_MANPAGES)
|
||||||
|
if(XMLTO_FOUND)
|
||||||
|
# We need the variable ${MAN_TODAY} to contain the current date in ISO
|
||||||
|
# format to replace it in the configure_file step.
|
||||||
|
include(today)
|
||||||
|
|
||||||
|
TODAY(MAN_TODAY)
|
||||||
|
|
||||||
|
configure_file(xfreerdp.1.xml.in xfreerdp.1.xml @ONLY)
|
||||||
|
|
||||||
add_executable(generate_argument_docbook
|
add_executable(generate_argument_docbook
|
||||||
generate_argument_docbook.c)
|
generate_argument_docbook.c)
|
||||||
target_link_libraries(generate_argument_docbook winpr-utils freerdp-core freerdp-utils freerdp-client)
|
target_link_libraries(generate_argument_docbook winpr-utils freerdp-core freerdp-utils freerdp-client)
|
||||||
|
|
||||||
if(XMLTO_FOUND)
|
|
||||||
add_custom_command(OUTPUT xfreerdp.1
|
add_custom_command(OUTPUT xfreerdp.1
|
||||||
COMMAND generate_argument_docbook
|
COMMAND generate_argument_docbook
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp.1.xml ${CMAKE_CURRENT_BINARY_DIR}/
|
|
||||||
COMMAND ${XMLTO_EXECUTABLE} man xfreerdp.1.xml
|
COMMAND ${XMLTO_EXECUTABLE} man xfreerdp.1.xml
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
DEPENDS xfreerdp.1.xml generate_argument_docbook)
|
DEPENDS
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1.xml
|
||||||
|
generate_argument_docbook)
|
||||||
|
|
||||||
add_custom_target(xfreerdp.manpage ALL
|
add_custom_target(xfreerdp.manpage ALL
|
||||||
DEPENDS xfreerdp.1)
|
DEPENDS xfreerdp.1)
|
||||||
|
@ -123,6 +123,7 @@ LPCSTR tr_esc_str(LPCSTR arg)
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
size_t elements = sizeof(args)/sizeof(args[0]);
|
||||||
size_t x;
|
size_t x;
|
||||||
const char *fname = "xfreerdp-argument.1.xml";
|
const char *fname = "xfreerdp-argument.1.xml";
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
@ -142,7 +143,13 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Iterate over argument struct and write data to docbook 4.5
|
/* Iterate over argument struct and write data to docbook 4.5
|
||||||
* compatible XML */
|
* compatible XML */
|
||||||
for(x=0; x<sizeof(args)/sizeof(args[0]); x++)
|
if( elements < 2 )
|
||||||
|
{
|
||||||
|
fprintf(stderr, "The argument array 'args' is empty, writing an empty file.");
|
||||||
|
elements = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(x=0; x<elements - 1; x++)
|
||||||
{
|
{
|
||||||
const COMMAND_LINE_ARGUMENT_A *arg = &args[x];
|
const COMMAND_LINE_ARGUMENT_A *arg = &args[x];
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|||||||
|
|
||||||
<refentry>
|
<refentry>
|
||||||
<refentryinfo>
|
<refentryinfo>
|
||||||
<date>2013-08-05</date>
|
<date>@MAN_TODAY@</date>
|
||||||
<author>
|
<author>
|
||||||
<authorblurb><para>The FreeRDP Team</para></authorblurb>
|
<authorblurb><para>The FreeRDP Team</para></authorblurb>
|
||||||
</author>
|
</author>
|
||||||
@ -25,7 +25,7 @@ PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|||||||
</refnamediv>
|
</refnamediv>
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<refsynopsisdivinfo>
|
<refsynopsisdivinfo>
|
||||||
<date>2013-08-05</date>
|
<date>@MAN_TODAY@</date>
|
||||||
</refsynopsisdivinfo>
|
</refsynopsisdivinfo>
|
||||||
<para>
|
<para>
|
||||||
<command>xfreerdp</command> [file] [options] [/v:server[:port]]
|
<command>xfreerdp</command> [file] [options] [/v:server[:port]]
|
||||||
@ -33,7 +33,7 @@ PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<refsect1info>
|
<refsect1info>
|
||||||
<date>2011-08-27</date>
|
<date>@MAN_TODAY@</date>
|
||||||
</refsect1info>
|
</refsect1info>
|
||||||
<title>DESCRIPTION</title>
|
<title>DESCRIPTION</title>
|
||||||
<para>
|
<para>
|
16
cmake/today.cmake
Normal file
16
cmake/today.cmake
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# This script returns the current date in ISO format
|
||||||
|
#
|
||||||
|
# YYYY-MM-DD
|
||||||
|
#
|
||||||
|
MACRO (TODAY RESULT)
|
||||||
|
IF (WIN32)
|
||||||
|
EXECUTE_PROCESS(COMMAND "cmd" " /C date +%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
|
||||||
|
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
|
||||||
|
ELSEIF(UNIX)
|
||||||
|
EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
|
||||||
|
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
|
||||||
|
ELSE (WIN32)
|
||||||
|
MESSAGE(SEND_ERROR "date not implemented")
|
||||||
|
SET(${RESULT} 000000)
|
||||||
|
ENDIF (WIN32)
|
||||||
|
ENDMACRO (TODAY)
|
Loading…
Reference in New Issue
Block a user