Only create output directory if it was set

This commit is contained in:
Wouter Wijsman
2024-10-31 10:57:00 +01:00
parent 64ea2da258
commit 6544b80356

View File

@@ -34,15 +34,15 @@ macro(create_pbp_file)
# set output directory to where the target is build if not set # set output directory to where the target is build if not set
if (NOT DEFINED ARG_OUTPUT_DIR) if (NOT DEFINED ARG_OUTPUT_DIR)
set(ARG_OUTPUT_DIR $<TARGET_FILE_DIR:${ARG_TARGET}>) set(ARG_OUTPUT_DIR $<TARGET_FILE_DIR:${ARG_TARGET}>)
endif() else()
# Make sure the output directory exists
# Make sure the output directory exists if(NOT IS_DIRECTORY ${ARG_OUTPUT_DIR})
if(NOT IS_DIRECTORY ${ARG_OUTPUT_DIR}) add_custom_command(
add_custom_command( TARGET ${APP} POST_BUILD
TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory
COMMAND ${CMAKE_COMMAND} -E make_directory ${ARG_OUTPUT_DIR}
${ARG_OUTPUT_DIR} )
) endif()
endif() endif()
# As pack-pbp takes undefined arguments in form of "NULL" string, # As pack-pbp takes undefined arguments in form of "NULL" string,