From 330208bc9500979ddcd32032115bee020231d96c Mon Sep 17 00:00:00 2001 From: Simon Praetorius Date: Sun, 7 Mar 2021 14:36:38 +0100 Subject: [PATCH 1/5] Add include_guard to all cmake files --- UseLatexMk.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/UseLatexMk.cmake b/UseLatexMk.cmake index fbe76b5..e015713 100644 --- a/UseLatexMk.cmake +++ b/UseLatexMk.cmake @@ -101,6 +101,7 @@ # (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) # Find LATEX and LatexMk find_package(LATEX) From 3bb582e450ece1d17a8ab087c8e73da4b6ea3d68 Mon Sep 17 00:00:00 2001 From: Simon Praetorius Date: Thu, 8 Apr 2021 20:02:06 +0000 Subject: [PATCH 2/5] Replace CMAKE_SOURCE_DIR by PROJECT_SOURCE_DIR --- UseLatexMk.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UseLatexMk.cmake b/UseLatexMk.cmake index e015713..267b868 100644 --- a/UseLatexMk.cmake +++ b/UseLatexMk.cmake @@ -112,9 +112,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 ) @@ -146,7 +146,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() From e68e7a8428a427cc667dd6824e8b12e6d998817d Mon Sep 17 00:00:00 2001 From: Simon Praetorius Date: Thu, 9 Sep 2021 16:13:13 +0200 Subject: [PATCH 3/5] Remove the cmake module include CMakeParseArguments since it is a cmake language function --- UseLatexMk.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/UseLatexMk.cmake b/UseLatexMk.cmake index 267b868..d4da058 100644 --- a/UseLatexMk.cmake +++ b/UseLatexMk.cmake @@ -132,7 +132,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) cmake_parse_arguments(LMK "${OPTION}" "${SINGLE}" "${MULTI}" ${ARGN}) if(LMK_UNPARSED_ARGUMENTS) From 12f8374015359ae4d4dd9213a81f534709ce88d6 Mon Sep 17 00:00:00 2001 From: Oliver Sander Date: Tue, 21 Jun 2022 07:46:45 +0200 Subject: [PATCH 4/5] Fix all true spelling errors found by 'codespell' --- UseLatexMk.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UseLatexMk.cmake b/UseLatexMk.cmake index d4da058..c7b48ec 100644 --- a/UseLatexMk.cmake +++ b/UseLatexMk.cmake @@ -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 From 98aa4b88e98d6034615e6e6c69cde68eab56159a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Wed, 22 Nov 2023 22:27:08 +0100 Subject: [PATCH 5/5] Bump required CMake version to 3.10 Add version check to UseLatexMk.cmake. CMake 3.10 is required for the include_guard command --- CMakeLists.txt | 2 +- README.md | 2 +- UseLatexMk.cmake | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fdaa8a..2af8669 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/README.md b/README.md index 23ff07f..62fbba3 100644 --- a/README.md +++ b/README.md @@ -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! diff --git a/UseLatexMk.cmake b/UseLatexMk.cmake index c7b48ec..8dde80c 100644 --- a/UseLatexMk.cmake +++ b/UseLatexMk.cmake @@ -103,6 +103,11 @@ # include_guard(GLOBAL) +# 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) find_package(LatexMk)