Skip to content

Commit d2ad117

Browse files
committed
packaging: Require cmake version at least 3.15
1 parent 47cae63 commit d2ad117

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

packaging/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
# along with this program; if not, write to the Free Software Foundation, Inc.,
2727
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2828

29-
cmake_minimum_required(VERSION 3.5)
29+
# Note: Version 3.15 is required becausae package build instructions
30+
# depend on cmake recognizing --install opton.
31+
32+
cmake_minimum_required(VERSION 3.15)
3033

3134
project(MySQL_CONCPP_Packages)
3235

packaging/deb-in/control.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Section: database
44
Priority: optional
55
Standards-Version: 3.9.8
66
Homepage: https://dev.mysql.com/doc/connector-cpp/en/
7-
Build-Depends: cmake, debhelper (>= 10), libboost-dev, libmysqlclient-dev, libssl-dev, chrpath
7+
Build-Depends: cmake (>= 3.15.0), debhelper (>= 10), libboost-dev, libmysqlclient-dev, libssl-dev, chrpath
88

99
Package: libmysqlcppconnx@ABI_VERSION_MAJOR@
1010
Architecture: any

packaging/mysql-connector-c++.spec.in

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848

4949
%{?el8:%global gcc_toolset gcc-toolset-13}
5050
%{?el9:%global gcc_toolset gcc-toolset-13}
51+
52+
%global cmake_cmd cmake%{?el6:3}%{?el7:3}
53+
5154
%if 0%{?suse_version} == 1315
5255
%global dist .sles12
5356
%endif
@@ -78,7 +81,7 @@ Source0: https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connecto
7881
Provides: libmysqlcppconn8.so.2()(%{?__isa_bits}bit) = %{version}-%{release}
7982
Obsoletes: mysql-connector-c++%{?product_suffix} < %{version}-%{release}
8083
Obsoletes: mysql-connector-c++ < %{version}-%{release}
81-
BuildRequires: cmake%{?el6:3}%{?el7:3}
84+
BuildRequires: %{cmake_cmd} >= 3.15.0
8285
%if 0%{?fedora} || 0%{?suse_version}
8386
BuildRequires: gcc
8487
BuildRequires: gcc-c++
@@ -138,17 +141,16 @@ cd ${RPM_BUILD_DIR}
138141

139142
# Note: use relative paths for CMAKE_INSTALL_XXX options
140143

141-
%global __cmake_cmd cmake%{?el6:3}%{?el7:3}
142144
%global __cmake_common_opts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_LIBDIR=.%{_libdir} -DCMAKE_INSTALL_INCLUDEDIR=.%{_includedir}/mysql-cppconn -DWITH_SSL=system -DDEFAULT_PLUGIN_DIR=%{plugin_dir} -DWITH_JDBC=1 -DMYSQLCLIENT_STATIC_LINKING=1 -DBUNDLE_DEPENDENCIES=1 %{?mysql_opt} %{__cmake_test_opts} -DDEBUG_PREFIX_MAP=OFF
143-
%global __cmake_config %{__cmake_cmd} %{__cmake_common_opts} %{__cmake_explicit_opts}
145+
%global __cmake_config %{cmake_cmd} %{__cmake_common_opts} %{__cmake_explicit_opts}
144146

145147
rm -rf build-static && mkdir build-static
146148
%{__cmake_config} -S ${SRC} -B build-static -DBUILD_STATIC=1
147-
%{__cmake_cmd} --build build-static --verbose
149+
%{cmake_cmd} --build build-static --verbose
148150

149151
rm -rf build-dynamic && mkdir build-dynamic
150152
%{__cmake_config} -S ${SRC} -B build-dynamic -DBUILD_STATIC=0
151-
%{__cmake_cmd} --build build-dynamic --verbose
153+
%{cmake_cmd} --build build-dynamic --verbose
152154

153155

154156
%install
@@ -157,8 +159,8 @@ cd ${RPM_BUILD_DIR}
157159

158160
# Note: order of installations is important!
159161

160-
%{__cmake_cmd} --install build-static --prefix %{buildroot}
161-
%{__cmake_cmd} --install build-dynamic --prefix %{buildroot}
162+
%{cmake_cmd} --install build-static --prefix %{buildroot}
163+
%{cmake_cmd} --install build-dynamic --prefix %{buildroot}
162164

163165
# Remove unwanted files
164166
rm %{buildroot}/{INFO_SRC,INFO_BIN}

0 commit comments

Comments
 (0)