I have a project with some asset (shader) files that are also frequently updated and need to be copied to a build destination folder every time my project is built.
Right now, the files are copied the first time, but then, when the project is rebuilt (from within Clion) the files are not continually copied. For instance, if I delete them from the directory they are copied to, they do not show up again.
Here is my Cmake file:
# Name for this project
set(PROJECT_NAME "3d_model")
# Choose the library for the final build
set(PROJECT_BUILD_DIR ${CMAKE_SOURCE_DIR}/bin/${PROJECT_NAME})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BUILD_DIR}/$<CONFIG>)
# Set sources
set(PROJECTS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/projects)
set(SOURCES
src/main.cpp
${INCLUDE_DIR}/glad/src/glad.c)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS} glfw ${GLFW_LIBRARIES})
# Copy resources
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets DESTINATION ${PROJECT_BUILD_DIR}/)
You can see in the last line my attempt to get the projects assets to copy every time the project is built.
Is there a way to ensure this happens?