Skip to content

Commit

Permalink
create internal fmt directory if missing
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Wójt <[email protected]>
  • Loading branch information
domin144 committed Dec 6, 2023
1 parent b726ace commit 4eeb968
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,23 @@ if (INTERNALIZE_FMT OR OIIO_USING_FMT_LOCAL)
if (fmt_VERSION VERSION_GREATER_EQUAL 9)
list (APPEND fmt_headers_base_names std.h)
endif ()
set (fmt_internal_directory ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt)
list (TRANSFORM fmt_headers_base_names
PREPEND ${FMT_INCLUDE_DIR}/fmt/
OUTPUT_VARIABLE fmt_headers)
list (TRANSFORM fmt_headers_base_names
PREPEND ${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt/
PREPEND ${fmt_internal_directory}/
OUTPUT_VARIABLE fmt_headers_internal)
add_custom_command (OUTPUT ${fmt_internal_directory}
COMMAND
${CMAKE_COMMAND} -E make_directory
${fmt_internal_directory})
add_custom_command (OUTPUT ${fmt_headers_internal}
DEPENDS ${fmt_headers}
DEPENDS ${fmt_headers} ${fmt_internal_directory}
COMMAND
${CMAKE_COMMAND} -E copy
${fmt_headers}
${CMAKE_BINARY_DIR}/include/OpenImageIO/detail/fmt)
${fmt_internal_directory})
add_custom_target (fmt_internal DEPENDS ${fmt_headers_internal})
add_dependencies (fmt::fmt fmt_internal)
else ()
Expand Down

0 comments on commit 4eeb968

Please sign in to comment.