summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2020-03-27 10:59:47 (GMT)
committerbiao716.wang <biao716.wang@samsung.com>2020-03-27 10:59:47 (GMT)
commit04c87672f50ee420d3a1fab45169428011b825d8 (patch)
treef999e7a0e1b6d934646bdfdde75bcdf2dc558937
parent223cf873796719e548b97dfb522a89ba7b058434 (diff)
downloadcmake-sandbox/wangbiao/cmake_3164.zip
cmake-sandbox/wangbiao/cmake_3164.tar.gz
cmake-sandbox/wangbiao/cmake_3164.tar.bz2
recover with macros.cmake with 3.16.4sandbox/wangbiao/cmake_3164
Change-Id: Ib03ad3e3807077b43ec60721727db7d4cf054c69 Signed-off-by: biao716.wang <biao716.wang@samsung.com>
-rw-r--r--packaging/macros.cmake62
-rw-r--r--packaging/macros.cmake_316465
-rw-r--r--packaging/macros.cmake_orig25
3 files changed, 76 insertions, 76 deletions
diff --git a/packaging/macros.cmake b/packaging/macros.cmake
index 8257f96..37ec99c 100644
--- a/packaging/macros.cmake
+++ b/packaging/macros.cmake
@@ -1,25 +1,65 @@
#
# Macros for cmake
#
-%_cmake_lib_suffix64 -DLIB_SUFFIX=64
-%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON
%__cmake %{_bindir}/cmake
+%__ctest %{_bindir}/ctest
+%__builddir build
+%__builder %__make
+%__sourcedir .
%cmake \
- CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
- CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
- FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
- %__cmake \\\
- -DCMAKE_VERBOSE_MAKEFILE=ON \\\
+ find %__sourcedir -name CMakeLists.txt \\\
+ -exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\\\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\\\)/{s/^/#IGNORE /}' {} + \
+ mkdir -p %__builddir \
+ cd %__builddir \
+ %__cmake $OLDPWD/%__sourcedir \\\
+%if "%__builder" == "%__make" \
+ -G"Unix Makefiles" \\\
+%else \
+ -GNinja \\\
+%endif \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
- -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\
-DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\
-DLIB_INSTALL_DIR:PATH=%{_libdir} \\\
-DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
+ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\
+ -DCMAKE_C_FLAGS="${CFLAGS:-%optflags} -DNDEBUG" \\\
+ -DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags} -DNDEBUG" \\\
+ -DCMAKE_Fortran_FLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}} -DNDEBUG" \\\
+ -DCMAKE_EXE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
+ -DCMAKE_MODULE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed" \\\
+ -DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
%if "%{?_lib}" == "lib64" \
- %{?_cmake_lib_suffix64} \\\
+ -DLIB_SUFFIX=64 \\\
+%endif \
+ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
+ -DBUILD_SHARED_LIBS:BOOL=ON \\\
+ -DBUILD_STATIC_LIBS:BOOL=OFF \\\
+ -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \\\
+ -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \\\
+ -DCMAKE_MODULES_INSTALL_DIR=%{_datadir}/cmake/Modules
+
+%__builder_verbose \
+%if "%__builder" == "%__make" \
+ %{?_make_output_sync} VERBOSE=1 \\\
+%else \
+ -v \\\
%endif \
- %{?_cmake_skip_rpath} \\\
- -DBUILD_SHARED_LIBS:BOOL=ON
+%{nil}
+
+%cmake_build %__builder \\%__builder_verbose %{?_smp_mflags}
+
+%make_jobs \
+ echo "Deprecated %%make_jobs macro used, please use %%cmake_build" \
+ %cmake_build
+
+%cmake_install \
+ DESTDIR=%{buildroot} %__builder install -C %__builddir
+
+%ctest(:-:) \
+ cd %__builddir \
+ %__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %** \
+ cd ..
diff --git a/packaging/macros.cmake_3164 b/packaging/macros.cmake_3164
deleted file mode 100644
index 37ec99c..0000000
--- a/packaging/macros.cmake_3164
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Macros for cmake
-#
-%__cmake %{_bindir}/cmake
-%__ctest %{_bindir}/ctest
-%__builddir build
-%__builder %__make
-%__sourcedir .
-
-%cmake \
- find %__sourcedir -name CMakeLists.txt \\\
- -exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\\\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\\\)/{s/^/#IGNORE /}' {} + \
- mkdir -p %__builddir \
- cd %__builddir \
- %__cmake $OLDPWD/%__sourcedir \\\
-%if "%__builder" == "%__make" \
- -G"Unix Makefiles" \\\
-%else \
- -GNinja \\\
-%endif \
- -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} \\\
- -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\
- -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\
- -DCMAKE_C_FLAGS="${CFLAGS:-%optflags} -DNDEBUG" \\\
- -DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags} -DNDEBUG" \\\
- -DCMAKE_Fortran_FLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}} -DNDEBUG" \\\
- -DCMAKE_EXE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
- -DCMAKE_MODULE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed" \\\
- -DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
-%if "%{?_lib}" == "lib64" \
- -DLIB_SUFFIX=64 \\\
-%endif \
- -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
- -DBUILD_SHARED_LIBS:BOOL=ON \\\
- -DBUILD_STATIC_LIBS:BOOL=OFF \\\
- -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \\\
- -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \\\
- -DCMAKE_MODULES_INSTALL_DIR=%{_datadir}/cmake/Modules
-
-%__builder_verbose \
-%if "%__builder" == "%__make" \
- %{?_make_output_sync} VERBOSE=1 \\\
-%else \
- -v \\\
-%endif \
-%{nil}
-
-%cmake_build %__builder \\%__builder_verbose %{?_smp_mflags}
-
-%make_jobs \
- echo "Deprecated %%make_jobs macro used, please use %%cmake_build" \
- %cmake_build
-
-%cmake_install \
- DESTDIR=%{buildroot} %__builder install -C %__builddir
-
-%ctest(:-:) \
- cd %__builddir \
- %__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %** \
- cd ..
-
diff --git a/packaging/macros.cmake_orig b/packaging/macros.cmake_orig
new file mode 100644
index 0000000..8257f96
--- /dev/null
+++ b/packaging/macros.cmake_orig
@@ -0,0 +1,25 @@
+#
+# Macros for cmake
+#
+%_cmake_lib_suffix64 -DLIB_SUFFIX=64
+%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON
+%__cmake %{_bindir}/cmake
+
+%cmake \
+ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
+ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+ FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
+ %__cmake \\\
+ -DCMAKE_VERBOSE_MAKEFILE=ON \\\
+ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
+ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\
+ -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 \
+ %{?_cmake_skip_rpath} \\\
+ -DBUILD_SHARED_LIBS:BOOL=ON
+