CPackIFW doesn't work properly on OSX
According to the documentation for
binarycreator, to create an offline installer the command line is:
<location-of-ifw>/binarycreator -t <location-of-ifw>/installerbase -p <package_directory> -c <config_directory>/<config_file> <installer_name>
On Mac, the target is created as an application bundle with the extension .app, which is automatically added, if not supplied. Additionally, you can specify the .dmg extension, which creates a DMG disk image that contains an .app bundle.
There are a few problems with that:
We cannot set
CPACK_PACKAGE_FILE_NAMEto something like
CPackconsiders it as a package file name without extension. Therefore it keeps adding
.appat the end of the string and creating a bundle. In other terms, there is no way to create a
.dmgby means of
CPackIFWon OSX. On the other side, that's one of the most interesting feature of IFW, so I would consider it a bug of the module.
This should be the offending code. At least, This is where the
<installer_name>is appended to the command line to run
binarycreator. I'm not sure where and how
.apppostfix is appended to
packageFileNamesand I'm a bit busy to look over the whole code base of
CMake, I'm sorry.
The bundle isn't a file, it's a directory. Therefore, when
CPacktries to copy it over to the proper location, it simply creates an empty directory and doesn't copy anything. On Linux it copies the
.shfile, on Windows it copies the
.exefile, on OSX it creates an empty directory and that's all. It could be due to how
cmSystemTools::CopyFileIfDifferentworks, but it's just a guess.
Of course, the bundle is present within the
_CPack_Packagestree, but we must run custom scripts to move it out of it somehow and create a