[CMake] generating info.plist files in POST_BUILD step unreliable

Tim Blechmann tim at klingt.org
Fri Aug 15 03:57:01 EDT 2014


hi all,

a combination of question and feature request:

i'm using a highly customized shell script to generate Info.plists on
osx. this build script has to make use of the usage requirements of the
corresponding target and it is called via a POST_BUILD custom command.

however this conflicts with cmake's info.plist generation
(cmLocalGenerator::GenerateAppleInfoPList()): the post-build step will
only be called after a build, but cmake's info.plist generation will
overwrite this file at configure-time.

1. run cmake: generate info.plist from MacOSXBundleInfo.plist.in
2. build: overwrite generated info.plist from post-build step
3. re-run cmake: overwrite correctly generated info.plist file from
MacOSXBundleInfo.plist.in
4. build: since the target's sources did not change, the target is not
rebuilt and the post-build step is not executed. the info.plist file is
therefore incorrect.

the 'cmake way' of generating info.plist files (setting
MACOSX_BUNDLE_INFO_PLIST) will not work for me, as the shell script
requires the usage requirements of the target.

--

so i think that my issue could be solved in two ways:

* if there would be a way to suppress the automatic generation of
info.plist files in cmLocalGenerator::GenerateAppleInfoPList(), e.g. via
a new property (MACOSX_BUNDLE_PREVENT_INFO_PLIST_GENERATION)

* if there would be a way to force the evaluation of post-build steps
after re-running cmake.

any advice how to proceed from here? or maybe there is a workaround that
i am missing?

thanks a lot,
tim



More information about the CMake mailing list