File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change
1
+ function (add_to_dist )
2
+ set (local_dist_files ${dist_files} )
3
+ foreach (file ${ARGN} )
4
+ file (RELATIVE_PATH relative ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} /${file} )
5
+ list (APPEND local_dist_files ${relative} )
6
+ endforeach ()
7
+ set (dist_files ${local_dist_files}
8
+ CACHE INTERNAL "Files that will be included in the distribution tarball" )
9
+ endfunction ()
Original file line number Diff line number Diff line change @@ -4,12 +4,17 @@ function (add_pdf_target docname lang entities figdir)
4
4
set (pdffile "${docname} .pdf" )
5
5
file (GLOB figures "${CMAKE_CURRENT_SOURCE_DIR} /${figdir} /*.png" )
6
6
7
- # Determine paper format depending on language
8
- # It's a pretty simple hack: only US or C will be set to letter. All others use A4.
9
- if (lang MATCHES ".*_us.*|C" )
10
- set (XSLTFLAGS_FO "--stringparam paper.type letter" )
11
- else ()
12
- set (XSLTFLAGS_FO "--stringparam paper.type A4" )
7
+ # Determine paper format depending on language (which maps to the document's directory name)
8
+ # * for language "C" (fallback language) determine paper format based on current locale
9
+ # * for other languages, the will be set to letter. All others use A4.
10
+ set (XSLTFLAGS_FO "--stringparam paper.type A4" )
11
+ if (lang STREQUAL "C" )
12
+ # For the fallback language determine paper format depending on locale
13
+ # Only US or C will be set to letter. All others use A4.
14
+ set (ENV_LANG $ENV{LANG} )
15
+ if (ENV_LANG AND ENV_LANG MATCHES ".*_us.*|C" ) # Replacing ENV_LANG here with if ($ENV{LANG}) won't work.
16
+ set (XSLTFLAGS_FO "--stringparam paper.type letter" )
17
+ endif ()
13
18
endif ()
14
19
15
20
add_custom_target ("${lang} -${docname} -fo"
You can’t perform that action at this time.
0 commit comments