CMake: Create destination folder for doc_source.cpp generation

When compiling using 'MinGW Makefiles' the folders aren't created automatically.
pull/1709/head
Samuel Nicholas 2025-01-25 18:51:41 +10:30
parent 79f9bc9600
commit 23c24073f4
1 changed files with 3 additions and 0 deletions

View File

@ -124,6 +124,9 @@ function( generate_doc_source OUTPUT_PATH SOURCES )
list( TRANSFORM PYTHON_LIST REPLACE "(.*\.xml)" "'\\1'" )
list( JOIN PYTHON_LIST "," PYTHON_LIST )
get_filename_component(OUTPUT_DIR "${OUTPUT_PATH}" DIRECTORY)
file(MAKE_DIRECTORY ${OUTPUT_DIR} )
# Python one-liner to run our command
# lists in CMake are just strings delimited by ';', so this works.
set( PYTHON_SCRIPT "from doc_source_generator import generate_doc_source"