[cmake-developers] [CMake 0012352]: Error in the formation of variable versions of

Mantis Bug Tracker mantis at public.kitware.com
Wed Jul 20 02:28:51 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12352 
====================================================================== 
Reported By:                Dubrovskiy Viacheslav
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12352
Category:                   CMake
Reproducibility:            have not tried
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-07-20 02:28 EDT
Last Modified:              2011-07-20 02:28 EDT
====================================================================== 
Summary:                    Error in the formation of variable versions of
Description: 
According to the file modules / readme.txt, without specifying the variable
version XXX_FIND_VERSION should not exist, variables XXX_FIND_VERSION_MAJOR,
XXX_FIND_VERSION_MINOR, XXX_FIND_VERSION_PATCH and XXX_FIND_VERSION_TWEAK,
XXX_FIND_VERSION_COUNT. At the moment there is a variable XXX_FIND_VERSION
always defined, variables XXX_FIND_VERSION_MAJOR,
XXX_FIND_VERSION_MINOR, XXX_FIND_VERSION_PATCH and XXX_FIND_VERSION_TWEAK at
no indication of version set to a random value.

In this unpredictable execution module assembly from falling to the assembly
improperly collected files.


diff -Naur cmake-2.8.5.orig/Source/cmFindPackageCommand.cxx
cmake-2.8.5/Source/cmFindPackageCommand.cxx
--- cmake-2.8.5.orig/Source/cmFindPackageCommand.cxx	2011-07-08
15:12:50.000000000 +0400
+++ cmake-2.8.5/Source/cmFindPackageCommand.cxx	2011-07-19 13:39:01.640015703
+0400
@@ -1731,10 +1731,10 @@
 
       // Try to parse the version number and store the results that were
       // successfully parsed.
-      unsigned int parsed_major;
-      unsigned int parsed_minor;
-      unsigned int parsed_patch;
-      unsigned int parsed_tweak;
+      unsigned int parsed_major = 0;
+      unsigned int parsed_minor = 0;
+      unsigned int parsed_patch = 0;
+      unsigned int parsed_tweak = 0;
       this->VersionFoundCount =
         sscanf(this->VersionFound.c_str(), "%u.%u.%u.%u",
                &parsed_major, &parsed_minor,
@@ -1751,6 +1751,7 @@
     }
 
   result_version = this->Makefile->GetSafeDefinition("PACKAGE_VERSION");
+  if(!this->VersionFoundCount)
this->Makefile->RemoveDefinition("PACKAGE_FIND_VERSION");
   if (result_version.empty())
     {
     result_version = "unknown";
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-07-20 02:28 Dubrovskiy ViacheslavNew Issue                                 
  
======================================================================




More information about the cmake-developers mailing list