mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-25 15:48:58 +00:00
cmake: break dependency cycle when doing an in-source build
This commit is contained in:
committed by
Anonymous Maarten
parent
9dd3e2305e
commit
bf113bbe2a
@@ -88,9 +88,13 @@ foreach(resource_file IN LISTS RESOURCE_FILES)
|
||||
get_filename_component(res_file_name ${resource_file} NAME)
|
||||
list(APPEND RESOURCE_FILE_NAMES "${res_file_name}")
|
||||
set(resource_file_bindir "${test_bin_dir}/${res_file_name}")
|
||||
set(depends_resource_file "${resource_file}")
|
||||
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
set(depends_resource_file "${CMAKE_CURRENT_LIST_FILE}")
|
||||
endif()
|
||||
add_custom_command(OUTPUT "${resource_file_bindir}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy "${resource_file}" "${resource_file_bindir}"
|
||||
DEPENDS "${resource_file}"
|
||||
DEPENDS "${depends_resource_file}"
|
||||
)
|
||||
list(APPEND RESOURCE_FILES_BINDIR "${resource_file_bindir}")
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user