From 827586ca48c77666f5550eb29fc90b869d774578 Mon Sep 17 00:00:00 2001 From: Yurin Andrey Date: Wed, 5 Jun 2024 21:40:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=B0=D0=BF=D0=BA=D1=83=20=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BC=D0=B5=D1=81=D1=82=D0=B8=D0=BB=20=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yurin_a_multi_step_scheme/CMakeLists.txt | 44 ++++++++++++++++--- .../latex/CMakeLists.txt | 41 ----------------- .../{latex => }/yurin.tex | 0 3 files changed, 39 insertions(+), 46 deletions(-) delete mode 100644 modules/stl/yurin_a_multi_step_scheme/latex/CMakeLists.txt rename modules/stl/yurin_a_multi_step_scheme/{latex => }/yurin.tex (100%) diff --git a/modules/stl/yurin_a_multi_step_scheme/CMakeLists.txt b/modules/stl/yurin_a_multi_step_scheme/CMakeLists.txt index d5c42e0..a96070f 100644 --- a/modules/stl/yurin_a_multi_step_scheme/CMakeLists.txt +++ b/modules/stl/yurin_a_multi_step_scheme/CMakeLists.txt @@ -1,7 +1,41 @@ -message(STATUS "Yurin Andrey Multi Step Scheme") +get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME) -SUBDIRLIST(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) +set(LATEX_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") +if (NOT EXISTS ${LATEX_OUTPUT_PATH}) + file(MAKE_DIRECTORY ${LATEX_OUTPUT_PATH}) +endif () -foreach(subd ${subdirs}) - add_subdirectory(${subd}) -endforeach() +if (USE_LATEX) + message( STATUS "-- " ${ProjectId} ) + file(GLOB_RECURSE report_files "*.tex") + + foreach (report ${report_files}) + get_filename_component(report_name ${report} NAME_WE) + list(APPEND list_report_names ${report_name}) + endforeach () + + add_custom_target( ${ProjectId}_prebuild + COMMAND ${PDFLATEX_COMPILER} -draftmode -interaction=nonstopmode ${report_files} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${report_files}) + + add_custom_target( ${ProjectId}_pdf + COMMAND ${PDFLATEX_COMPILER} ${report_files} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${report_files}) + + add_custom_target(${ProjectId}_all_formats ALL) + add_dependencies(${ProjectId}_all_formats ${ProjectId}_pdf) + + foreach (report_name ${list_report_names}) + add_custom_command( + TARGET ${ProjectId}_all_formats + POST_BUILD + COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.aux" "${LATEX_OUTPUT_PATH}/${report_name}.aux" + COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.log" "${LATEX_OUTPUT_PATH}/${report_name}.log" + COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.pdf" "${LATEX_OUTPUT_PATH}/${report_name}.pdf" + ) + endforeach () +else() + message( STATUS "-- ${ProjectId} - NOT BUILD!" ) +endif() diff --git a/modules/stl/yurin_a_multi_step_scheme/latex/CMakeLists.txt b/modules/stl/yurin_a_multi_step_scheme/latex/CMakeLists.txt deleted file mode 100644 index a96070f..0000000 --- a/modules/stl/yurin_a_multi_step_scheme/latex/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME) - -set(LATEX_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") -if (NOT EXISTS ${LATEX_OUTPUT_PATH}) - file(MAKE_DIRECTORY ${LATEX_OUTPUT_PATH}) -endif () - -if (USE_LATEX) - message( STATUS "-- " ${ProjectId} ) - file(GLOB_RECURSE report_files "*.tex") - - foreach (report ${report_files}) - get_filename_component(report_name ${report} NAME_WE) - list(APPEND list_report_names ${report_name}) - endforeach () - - add_custom_target( ${ProjectId}_prebuild - COMMAND ${PDFLATEX_COMPILER} -draftmode -interaction=nonstopmode ${report_files} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${report_files}) - - add_custom_target( ${ProjectId}_pdf - COMMAND ${PDFLATEX_COMPILER} ${report_files} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${report_files}) - - add_custom_target(${ProjectId}_all_formats ALL) - add_dependencies(${ProjectId}_all_formats ${ProjectId}_pdf) - - foreach (report_name ${list_report_names}) - add_custom_command( - TARGET ${ProjectId}_all_formats - POST_BUILD - COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.aux" "${LATEX_OUTPUT_PATH}/${report_name}.aux" - COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.log" "${LATEX_OUTPUT_PATH}/${report_name}.log" - COMMAND mv "${CMAKE_CURRENT_SOURCE_DIR}/${report_name}.pdf" "${LATEX_OUTPUT_PATH}/${report_name}.pdf" - ) - endforeach () -else() - message( STATUS "-- ${ProjectId} - NOT BUILD!" ) -endif() diff --git a/modules/stl/yurin_a_multi_step_scheme/latex/yurin.tex b/modules/stl/yurin_a_multi_step_scheme/yurin.tex similarity index 100% rename from modules/stl/yurin_a_multi_step_scheme/latex/yurin.tex rename to modules/stl/yurin_a_multi_step_scheme/yurin.tex