Skip to content

Commit

Permalink
Fix version string handling
Browse files Browse the repository at this point in the history
replace #cmakedefine macro by #define because #cmakedefine replaces the
define with #undef if the variable is 0, resulting in a broken version
comparison function.

Fixing version regex on the way.

git-svn-id: svn+ssh://svn.pointclouds.org/pcl/trunk@8114 a9d63959-f2ad-4865-b262-bf0e56cfafb6
  • Loading branch information
jspricke committed Nov 28, 2012
1 parent 3c0c06d commit 0ed08f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmake/pcl_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ macro(DISSECT_VERSION)
PCL_MAJOR_VERSION "${PCL_VERSION}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1"
PCL_MINOR_VERSION "${PCL_VERSION}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1"
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1"
PCL_REVISION_VERSION "${PCL_VERSION}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1"
PCL_CANDIDATE_VERSION "${PCL_VERSION}")
Expand Down
10 changes: 5 additions & 5 deletions pcl_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#define BUILD_@CMAKE_BUILD_TYPE@
/* PCL version information */
#cmakedefine PCL_MAJOR_VERSION ${PCL_MAJOR_VERSION}
#cmakedefine PCL_MINOR_VERSION ${PCL_MINOR_VERSION}
#cmakedefine PCL_REVISION_VERSION ${PCL_REVISION_VERSION}
#cmakedefine PCL_VERSION_PRETTY "${PCL_VERSION}"
#define PCL_MAJOR_VERSION ${PCL_MAJOR_VERSION}
#define PCL_MINOR_VERSION ${PCL_MINOR_VERSION}
#define PCL_REVISION_VERSION ${PCL_REVISION_VERSION}
#define PCL_VERSION_PRETTY "${PCL_VERSION}"
#define PCL_VERSION_CALC(MAJ, MIN, PATCH) (MAJ*100000+MIN*100+PATCH)
#cmakedefine PCL_VERSION \
#define PCL_VERSION \
PCL_VERSION_CALC(PCL_MAJOR_VERSION,PCL_MINOR_VERSION,PCL_REVISION_VERSION)
#define PCL_VERSION_COMPARE(OP,MAJ,MIN,PATCH) \
(PCL_VERSION OP PCL_VERSION_CALC(MAJ,MIN,PATCH))
Expand Down

0 comments on commit 0ed08f8

Please sign in to comment.