I am trying to make a copy of my executable at the end of my"make install"
I need to do something like:
cp bin/prog bin/prog1
I have added the following as the last line in my CMakelists.txt
install (CODE "execute_process(COMMAND /src/copyExe.sh ${BIN_DIR})")
copyExe.sh is a bash script that does the copying. In order to have the desired affect, I need to run "make install" twice. The first time it complains that prog doesn't exist, and then copies the file to bin. The second time it finds prog and is able to make the copy.
Is there a way to ensure that my copyExe script runs AFTER the files get copied to bin?
Directory structure
site
bin
src
CMakeLists.txt ( contains add_dir(foo) and install(CODE....))
foo
CMakeLists.txt ( contains install( TARGET..... ))