!82 [sync] PR-81: Support cmake_build and cmake_install
From: @openeuler-sync-bot Reviewed-by: @ Signed-off-by: @lyn1001
This commit is contained in:
commit
622b8e7b0a
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
Name: cmake
|
Name: cmake
|
||||||
Version: 3.27.9
|
Version: 3.27.9
|
||||||
Release: 4
|
Release: 5
|
||||||
Summary: Cross-platform make system
|
Summary: Cross-platform make system
|
||||||
License: BSD and MIT and zlib
|
License: BSD and MIT and zlib
|
||||||
URL: http://www.cmake.org
|
URL: http://www.cmake.org
|
||||||
@ -299,6 +299,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
|||||||
%exclude %{_pkgdocdir}/Copyright.txt
|
%exclude %{_pkgdocdir}/Copyright.txt
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Aug 22 2024 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 3.27.9-5
|
||||||
|
- Support %cmake_build and %cmake_install.
|
||||||
|
|
||||||
* Wed Jul 10 2024 fuanan <fuanan3@h-partners.com> - 3.27.9-4
|
* Wed Jul 10 2024 fuanan <fuanan3@h-partners.com> - 3.27.9-4
|
||||||
- Add compilation options for i686.
|
- Add compilation options for i686.
|
||||||
- Support arrch64-ilp32 compilation.
|
- Support arrch64-ilp32 compilation.
|
||||||
|
|||||||
44
macros.cmake
44
macros.cmake
@ -5,6 +5,8 @@
|
|||||||
%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON
|
%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON
|
||||||
%_cmake_version @@CMAKE_VERSION@@
|
%_cmake_version @@CMAKE_VERSION@@
|
||||||
%__cmake /usr/bin/cmake
|
%__cmake /usr/bin/cmake
|
||||||
|
%__ctest /usr/bin/ctest
|
||||||
|
%__cmake_builddir %{!?__cmake_in_source_build:%{_vpath_builddir}}%{?__cmake_in_source_build:.}
|
||||||
|
|
||||||
# - Set default compile flags
|
# - Set default compile flags
|
||||||
# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables
|
# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables
|
||||||
@ -36,4 +38,46 @@
|
|||||||
%endif \
|
%endif \
|
||||||
-DBUILD_SHARED_LIBS:BOOL=ON
|
-DBUILD_SHARED_LIBS:BOOL=ON
|
||||||
|
|
||||||
|
# cmake for cmake_build and cmake_install
|
||||||
|
%cmake_conf \
|
||||||
|
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
|
||||||
|
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
|
||||||
|
FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS ; \
|
||||||
|
FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS ; \
|
||||||
|
%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} \
|
||||||
|
%__cmake \\\
|
||||||
|
%{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \\\
|
||||||
|
%{!?__cmake_in_source_build:-B "%{__cmake_builddir}"} \\\
|
||||||
|
-DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
|
||||||
|
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
|
||||||
|
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
|
||||||
|
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
|
||||||
|
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
|
||||||
|
-DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\
|
||||||
|
-DLIB_INSTALL_DIR:PATH=%{_libdir} \\\
|
||||||
|
-DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
|
||||||
|
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
|
||||||
|
%if "%{?_lib}" == "lib64" \
|
||||||
|
%{?_cmake_lib_suffix64} \\\
|
||||||
|
%endif \
|
||||||
|
%if "%{?_lib}" == "libilp32" \
|
||||||
|
-DLIB_SUFFIX=ilp32 \\\
|
||||||
|
%endif \
|
||||||
|
-DBUILD_SHARED_LIBS:BOOL=ON
|
||||||
|
|
||||||
|
%cmake_build \
|
||||||
|
%__cmake --build "%{__cmake_builddir}" %{?_smp_mflags} --verbose
|
||||||
|
|
||||||
|
%cmake_install \
|
||||||
|
DESTDIR="%{buildroot}" %__cmake --install "%{__cmake_builddir}"
|
||||||
|
|
||||||
|
%ctest(:-:) \
|
||||||
|
cd "%{__cmake_builddir}" \
|
||||||
|
%__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %{**} \
|
||||||
|
cd -
|
||||||
|
|
||||||
%cmake@@CMAKE_MAJOR_VERSION@@ %cmake
|
%cmake@@CMAKE_MAJOR_VERSION@@ %cmake
|
||||||
|
%cmake@@CMAKE_MAJOR_VERSION@@_conf %cmake_conf
|
||||||
|
%cmake@@CMAKE_MAJOR_VERSION@@_build %cmake_build
|
||||||
|
%cmake@@CMAKE_MAJOR_VERSION@@_install %cmake_install
|
||||||
|
%ctest@@CMAKE_MAJOR_VERSION@@(:-:) %ctest %{**}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user