I am trying to copy a directory of files after my project is built, every time my project is built.
In my project's CMakeLists.txt
file I have the following:
# Copy resources
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets DESTINATION ${PROJECT_BUILD_DIR}/)
This works the first time the project is built, and it works anytime I call make
in the directory that CMAKE has generated the makefile in.
However, in my IDE (CLion) I think there is some sort of caching / checking to see if the project is already built.
As a result, if I only change an asset file, and not the underlying code, the files are never copied to the location of the binary.
Is there a way to force a post-build script to be executed after every time build is called?
Or, put another way, is there a way to force the CMakeLists.txt
file to be every time I build my project?
This is specific to CLion but concerns cmake more generally.
I am using CMAKE 3.9.1
Thanks