[cmake-developers] Making Config.cmake files safer

Brad King brad.king at kitware.com
Thu Nov 17 10:59:37 EST 2011


On 11/15/2011 4:50 PM, Brad King wrote:
> On 11/15/2011 3:54 PM, Alexander Neundorf wrote:
>> Maybe you'll prefer a more map-like implementation ?

The commit you merged to next:

   http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c265207

looks pretty good.  I think the message would look better if the generated
code looked like this:

       MESSAGE(FATAL_ERROR "Imported target \"${target}\" needs file
   ${file}
but it does not exist.  There are multiple possible reasons:
  * The file has been manually deleted, renamed or moved to another location.
  * A previous install or uninstall procedure did not complete successfully.
  * The installation package was faulty, and contained
     ${CMAKE_CURRENT_LIST_FILE}
    but not
     ${file}
    which must always be installed together.\n"
    )

Also, the multi-config generators fail the ExportImport test because
not all configurations exported from the build tree of the "Export"
project are actually built.  Perhaps it makes sense to do this only
for the *install* tree target files.  If a file is missing in a build
tree I think it is likely the user will know what to do.

-Brad



More information about the cmake-developers mailing list