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>
In particular:
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_NAME
to something like<name>.dmg
, forCPack
considers it as a package file name without extension. Therefore it keeps adding.app
at the end of the string and creating a bundle. In other terms, there is no way to create a.dmg
by means ofCPackIFW
on 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 runbinarycreator
. I'm not sure where and how.app
postfix is appended topackageFileNames[0]
and I'm a bit busy to look over the whole code base ofCMake
, I'm sorry. -
The bundle isn't a file, it's a directory. Therefore, when
CPack
tries to copy it over to the proper location, it simply creates an empty directory and doesn't copy anything. On Linux it copies the.sh
file, on Windows it copies the.exe
file, on OSX it creates an empty directory and that's all. It could be due to howcmSystemTools::CopyFileIfDifferent
works, but it's just a guess.
Of course, the bundle is present within the_CPack_Packages
tree, but we must run custom scripts to move it out of it somehow and create a.dmg
.