Skip to content
Snippets Groups Projects
Commit c6a5ea65 authored by Adam Štěpánek's avatar Adam Štěpánek
Browse files

Fix resource conficts in CMakeLists

parent 34d7610b
No related branches found
No related tags found
No related merge requests found
......@@ -115,6 +115,7 @@ target_include_directories(final
function(copy_resources SUBDIR GLOB)
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR})
set(TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR})
set(INDEX 0)
file(GLOB_RECURSE RESOURCES RELATIVE ${SOURCE_DIR} ${SOURCE_DIR}/${GLOB})
foreach(RESOURCE ${RESOURCES})
set(ORIG ${SOURCE_DIR}/${RESOURCE})
......@@ -127,8 +128,8 @@ function(copy_resources SUBDIR GLOB)
${ORIG}
${COPY}
)
get_filename_component(RESOURCE_NAME ${RESOURCE} NAME)
add_custom_target(copy-${RESOURCE_NAME} ALL DEPENDS ${ORIG} ${COPY})
add_custom_target(${SUBDIR}-${INDEX} ALL DEPENDS ${ORIG} ${COPY})
math(EXPR INDEX "${INDEX}+1")
endforeach()
endfunction()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment