Fix handling of file names, introduced by support for minted#16
Open
gruenich wants to merge 2 commits intodokempf:mainfrom
Open
Fix handling of file names, introduced by support for minted#16gruenich wants to merge 2 commits intodokempf:mainfrom
gruenich wants to merge 2 commits intodokempf:mainfrom
Conversation
This was introduced to support minted. But all files got the extension _source_tex. With this patch, the file name is unchanged unless it is a in-source built to prevent overwriting the actual LaTeX file.
The file name might be altered to support package minted.
gruenich
commented
Dec 9, 2023
Comment on lines
+216
to
+224
| # For LaTeX package minted, replace value of outputdir from CMAKE_CURRENT_BINARY_DIR to | ||
| # its actual value by coping the LaTeX file to the build dir | ||
| set(LMK_SOURCE_REPLACED ${CMAKE_CURRENT_BINARY_DIR}/${LMK_SOURCE}) | ||
| # for in-source-build, adjust | ||
| if("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") | ||
| get_filename_component(source_filename ${LMK_SOURCE} NAME_WE) | ||
| get_filename_component(source_extension ${LMK_SOURCE} LAST_EXT) | ||
| set(LMK_SOURCE_REPLACED "${CMAKE_CURRENT_BINARY_DIR}/${source_filename}_source${source_extension}") | ||
| endif() |
Contributor
Author
There was a problem hiding this comment.
@dokempf We could search the LaTeX source file and check whether it conains "@CMAKE_CURRNET_SOURCE_DIR@". Only in this case, we have to do the configure_file and renaming steps.
This could help with in-source builds to get the same file name, unless they really use minted. I would prefer this but I wanted to know your opinion.
Contributor
Author
|
@dokempf Do you mind having a look and eventually merging this? |
Contributor
Author
|
@dokempf Can you have a look and hitting the merge button? |
Contributor
Author
|
@dokempf Any chance of getting this reviewed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TeX and PDF file names get an additional _source_tex added, which is not wanted.
With this patch, only "_source" is added for in-source builds to preventing that the
original file is overwritten.