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

Upstream changes from Dune Project #15

Merged
merged 5 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# It is not actually needed for downstream use.
#

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
project(UseLatexMk)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You just need to
* copy all the CMake modules (`*.cmake`) from this project into your project
* Include them with `include(UseLatexMk)`. This is best done from the top-level
directory of your project, to make the `clean_latex` target available on that level.
* Use CMake 3.5 or newer.
* Use CMake 3.10 or newer.

Now, you are ready to use it!

Expand Down
19 changes: 12 additions & 7 deletions UseLatexMk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
# system environment variable openout_any to "a" (as in "all"), to override the default "paranoid"
# setting.
#
# UseLatexMk.cmake allows to reenable the TeX security measure by setting LATEXMK_PARANOID to TRUE
# UseLatexMk.cmake allows to re-enable the TeX security measure by setting LATEXMK_PARANOID to TRUE
# through cmake -D, but it is not guaranteed to work correctly in that case.
#
# For further informations, visit https://github.com/dokempf/UseLatexMk
# For further information, visit https://github.com/dokempf/UseLatexMk
#
#
# Copyright (c) 2017, Dominic Kempf, Steffen Müthing
Expand Down Expand Up @@ -101,6 +101,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
include_guard(GLOBAL)
gruenich marked this conversation as resolved.
Show resolved Hide resolved

# ensure CMake version is recent enough
if(CMAKE_VERSION VERSION_LESS 3.10)
message(FATAL_ERROR "UseLatexMk.cmake requires CMake 3.10 or newer")
endif()

# Find LATEX and LatexMk
find_package(LATEX)
Expand All @@ -111,9 +117,9 @@ find_file(LATEXMKRC_TEMPLATE
latexmkrc.cmake
HINTS ${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/cmake
${CMAKE_SOURCE_DIR}/cmake/modules
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/cmake
${PROJECT_SOURCE_DIR}/cmake/modules
NO_CMAKE_FIND_ROOT_PATH
)

Expand All @@ -131,7 +137,6 @@ function(add_latex_document)
set(OPTION REQUIRED EXCLUDE_FROM_ALL BUILD_ON_INSTALL)
set(SINGLE SOURCE TARGET INSTALL)
set(MULTI FATHER_TARGET RCFILE)
include(CMakeParseArguments)
gruenich marked this conversation as resolved.
Show resolved Hide resolved
cmake_parse_arguments(LMK "${OPTION}" "${SINGLE}" "${MULTI}" ${ARGN})

if(LMK_UNPARSED_ARGUMENTS)
Expand All @@ -145,7 +150,7 @@ function(add_latex_document)
if(NOT LMK_TARGET)
# Construct a nice target name from the source file
get_filename_component(LMK_TARGET ${LMK_SOURCE} ABSOLUTE)
file(RELATIVE_PATH LMK_TARGET ${CMAKE_SOURCE_DIR} ${LMK_TARGET})
file(RELATIVE_PATH LMK_TARGET ${PROJECT_SOURCE_DIR} ${LMK_TARGET})
string(REPLACE "/" "_" LMK_TARGET ${LMK_TARGET})
string(REPLACE "." "_" LMK_TARGET ${LMK_TARGET})
endif()
Expand Down