[CMake] Q: cmExportFileGenerator::GenerateImportedFileCheckLoop

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Mar 12 02:06:52 EDT 2012


Hi there,

  CMake 2.8.7 recently added a new behavior when reading export files:

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

  I perfectly understand the goal here, I think this is a great user
functionality. However this breaks the old behavior of cmake being
tolerant with missing files. This is particularly difficult to handle
for large package such as VTK. Currently in debian we split the VTK
package into sub-packages:
 * C++ dev,
 * Qt dev,
 * TCL,
 * Java and
 * Python bindings.
  Since there is a single export file, we are now forced to install
all those sub-packages while in the past we could bypass any cmake
internals checks and only install -say- C++-dev package.

  Would it make sense to conditionally remove this automatic check ?
Something like:

diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index c4f5dfb..6eaf4d5 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -384,7 +384,7 @@
cmExportFileGenerator::GenerateImportedFileCheckLoop(std::ostream& os)
   os << "# Loop over all imported files and verify that they actually exist\n"
         "FOREACH(target ${_IMPORT_CHECK_TARGETS} )\n"
         "  FOREACH(file ${_IMPORT_CHECK_FILES_FOR_${target}} )\n"
-        "    IF(NOT EXISTS \"${file}\" )\n"
+        "    IF(NOT CMAKE_SKIP_IMPORT_CHECK_FILES AND NOT EXISTS
\"${file}\" )\n"
         "      MESSAGE(FATAL_ERROR \"The imported target \\\"${target}\\\""
         " references the file\n"
         "   \\\"${file}\\\"\n"

Thanks for comments,

-- 
Mathieu


More information about the CMake mailing list