# attempt to provide a convenience cmake file # that can be included in a CMakeLists.txt and that # will automatically call jpp_add_latex() or jpp_add_pptx() for any # tex or pptx file in that directory # # WARNING: to achieve this functionallity we are using file globbing # which is generally not the recommended way of working with CMake. # function(jpp_auto_add_documents) cmake_parse_arguments(PARSE_ARGV 0 A "" "" "") if(A_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Got trailing arguments ${A_UNPARSED_ARGUMENTS}") endif() file(GLOB tex *.tex) file(GLOB pptx *.pptx) list(APPEND CMAKE_MESSAGE_CONTEXT "auto-add") foreach(s IN LISTS tex) cmake_path(GET s FILENAME stex) message(DEBUG "jpp_add_latex(${stex})") jpp_add_latex(${stex}) endforeach() foreach(s IN LISTS pptx) cmake_path(GET s FILENAME spptx) message(DEBUG "jpp_add_pptx(${spptx})") jpp_add_pptx(${spptx}) endforeach() list(POP_BACK CMAKE_MESSAGE_CONTEXT) endfunction()