On Mon, Jan 30, 2012 at 05:24, Kevin Kofler kevin.kofler@chello.at wrote:
John5342 wrote:
find_file( GRUB2_BURG_CONFIGURATION_FILE NAMES grub2.cfg burg.cfg grub.cfg PATHS "/boot/grub2" "/boot/burg" "/boot/grub" "/etc" DOC "Path to grub2 or burg configuration file" NO_DEFAULT_PATH )
Ugh, find_file is a very bad way to handle this! We normally build packages in a chroot (and I guess several other distros do the same). There is not necessarily any bootloader installed at all in the chroot.
This needs to be a CMake variable settable from the command line (i.e. from our specfile), with find_file only as a fallback.
Actually that situation is already covered. Anybody building themselves (no packaging) the file will likely be present and all is automatic. For us packagers we can "BuildRequire: grub2" and we would pick up /etc/grub2.cfg automatically or if we want more control the find_file command automatically creates a cache variable with the DOC string so if we want better control it command line configuration is provided for free. This is one of the few things i actually properly like about CMake.