Add CMake SOVERSIONs to make-version.pl.
authorGerald Combs <gerald@wireshark.org>
Wed, 4 Mar 2015 20:32:25 +0000 (12:32 -0800)
committerGerald Combs <gerald@wireshark.org>
Wed, 4 Mar 2015 20:33:08 +0000 (20:33 +0000)
Change-Id: Ifd011288ca23263738ca50842d59a23cc25e7952
Reviewed-on: https://code.wireshark.org/review/7532
Reviewed-by: Gerald Combs <gerald@wireshark.org>
epan/CMakeLists.txt
make-version.pl
wiretap/CMakeLists.txt

index 4e91853f223c0c3f90480fbde006690d39be2503..b502fd13fbc19dbafca38f965ff34fd6f1428f08 100644 (file)
@@ -1724,7 +1724,7 @@ add_library(epan ${LINK_MODE_LIB}
        ${CMAKE_BINARY_DIR}/image/libwireshark.rc
 )
 
-set(FULL_SO_VERSION "0.0.0")
+set(FULL_SO_VERSION "0.0.3")
 
 set_target_properties(epan PROPERTIES COMPILE_DEFINITIONS "WS_BUILD_DLL")
 set_target_properties(epan PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
index d53eeb8245e7e1f9284d2c2758a5cdf00610420c..d88578b633e238fa91f7bde7216fb8955b3292e9 100755 (executable)
@@ -542,7 +542,7 @@ sub update_debian_changelog
 }
 
 # Read Makefile.am for each library, then write back out an updated version.
-sub update_lib_releases
+sub update_automake_lib_releases
 {
        my $line;
        my $contents = "";
@@ -579,6 +579,37 @@ sub update_lib_releases
        }
 }
 
+# Read CMakeLists.txt for each library, then write back out an updated version.
+sub update_cmake_lib_releases
+{
+       my $line;
+       my $contents = "";
+       my $version = "";
+       my $filedir;
+       my $filepath;
+
+       return if (!$set_version);
+
+       for $filedir ("epan", "wiretap") {      # "wsutil"
+               $contents = "";
+               $filepath = $filedir . "/CMakeLists.txt";
+               open(CMAKELISTS_TXT, "< $filepath") || die "Can't read $filepath!";
+               while ($line = <CMAKELISTS_TXT>) {
+                       # set(FULL_SO_VERSION "0.0.0")
+
+                       if ($line =~ /^(set\s*\(\s*FULL_SO_VERSION\s+"\d+\.\d+\.)\d+(".*)/) {
+                               $line = sprintf("$1%d$2\n", $version_pref{"version_micro"});
+                       }
+                       $contents .= $line
+               }
+
+               open(CMAKELISTS_TXT, "> $filepath") || die "Can't write $filepath!";
+               print(CMAKELISTS_TXT $contents);
+               close(CMAKELISTS_TXT);
+               print "$filepath has been updated.\n";
+       }
+}
+
 # Update distributed files that contain any version information
 sub update_versioned_files
 {
@@ -587,7 +618,8 @@ sub update_versioned_files
        &update_config_nmake;
        &update_release_notes;
        &update_debian_changelog;
-       &update_lib_releases;
+       &update_automake_lib_releases;
+       &update_cmake_lib_releases;
 }
 
 # Print the version control system's version to $version_file.
index b04e0d567c4ac08fd2d7937d71993685016e857f..b1578d0605ec6ada3d158064c60e2fee9aee00b4 100644 (file)
@@ -109,7 +109,7 @@ add_library(wiretap ${LINK_MODE_LIB}
        ${CMAKE_BINARY_DIR}/image/wiretap.rc
 )
 
-set(FULL_SO_VERSION "0.0.0")
+set(FULL_SO_VERSION "0.0.3")
 
 set_target_properties(wiretap PROPERTIES
        COMPILE_DEFINITIONS "WS_BUILD_DLL"