Removing the line * PROPERTIES RESOURCE foo.txt)
should solve the problem.
Since you have included cpack in your cmake file, the generated TGZ will contain all of the files which would be installed with make install
. In this case, you have
SET_TARGET_PROPERTIES(foo PROPERTIES MACOSX_BUNDLE TRUE)
which will build foo
as an OS X application bundle (doc), and
SET_TARGET_PROPERTIES(foo PROPERTIES RESOURCE TRUE)
specifies foo.txt as a resource files (doc). With both of those PROPERTIES set, make install
will create two versions of foo.txt. One in the bundle, foo.app/Contents/Resources/foot.txt
, and one in the top level directory, foo.txt
. Therefore, CPack will also generate those two versions of foo.txt.