Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of file names, introduced by support for minted #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gruenich
Copy link
Contributor

@gruenich gruenich commented Dec 9, 2023

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.

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.
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()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@gruenich
Copy link
Contributor Author

@dokempf Do you mind having a look and eventually merging this?

@gruenich
Copy link
Contributor Author

@dokempf Can you have a look and hitting the merge button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant