From a1d54d46a03c8a418f718b2bfc287d4c13a98d7f Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Fri, 10 Apr 2015 19:24:38 +0200 Subject: [PATCH] Made the CMake RPM macros more generic --- macros.mingw32 | 39 +++++++++++++-------------------------- macros.mingw64 | 39 +++++++++++++-------------------------- mingw-filesystem.spec | 2 ++ 3 files changed, 28 insertions(+), 52 deletions(-) diff --git a/macros.mingw32 b/macros.mingw32 index ebb2ab7..2d73fe9 100644 --- a/macros.mingw32 +++ b/macros.mingw32 @@ -120,45 +120,32 @@ mandir=%{mingw32_mandir} \\\ infodir=%{mingw32_infodir} -%mingw32_cmake %{mingw32_env} ; \ +%mingw32_cmake_generic %{mingw32_env} ; \ PKG_CONFIG_LIBDIR="%{mingw32_libdir}/pkgconfig:%{mingw32_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \ if test -f CMakeLists.txt; then __mingw32_topdir=.; \\\ elif test -f ../CMakeLists.txt; then __mingw32_topdir=..; \\\ else __mingw32_topdir=""; fi; \\\ PATH=%{_prefix}/%{mingw32_target}/bin:$PATH %__cmake \\\ + -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw32.cmake \\\ -DCMAKE_VERBOSE_MAKEFILE=ON \\\ - -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\ - -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir} \\\ + -DBUILD_SHARED_LIBS:BOOL=ON \\\ + %{?_cmake_skip_rpath} \\\ -DLIB_INSTALL_DIR:PATH=%{mingw32_libdir} \\\ -DSYSCONF_INSTALL_DIR:PATH=%{mingw32_sysconfdir} \\\ -DSHARE_INSTALL_PREFIX:PATH=%{mingw32_datadir} \\\ - %{?_cmake_skip_rpath} \\\ - -DBUILD_SHARED_LIBS:BOOL=ON \\\ - -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw32.cmake \\\ + -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\ + -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\ ${MINGW_CMAKE_ARGS} \\\ ${MINGW32_CMAKE_ARGS} \\\ "$@" $__mingw32_topdir -%mingw32_cmake_kde4 %{mingw32_env} ; \ - PKG_CONFIG_LIBDIR="%{mingw32_libdir}/pkgconfig:%{mingw32_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \ - if test -f CMakeLists.txt; then __mingw32_topdir=.; \\\ - elif test -f ../CMakeLists.txt; then __mingw32_topdir=..; \\\ - else __mingw32_topdir=""; fi; \\\ - %__cmake \\\ - -DCMAKE_VERBOSE_MAKEFILE=ON \\\ - -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\ - -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}/kde4 \\\ - -DLIB_INSTALL_DIR:PATH=%{mingw32_libdir} \\\ - -DSYSCONF_INSTALL_DIR:PATH=%{mingw32_sysconfdir} \\\ - -DSHARE_INSTALL_PREFIX:PATH=%{mingw32_datadir} \\\ - %{?_cmake_skip_rpath} \\\ - -DBUILD_SHARED_LIBS:BOOL=ON \\\ - -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw32.cmake \\\ - ${MINGW_CMAKE_ARGS} \\\ - ${MINGW32_CMAKE_ARGS} \\\ - "$@" $__mingw32_topdir +%mingw32_cmake \ + MINGW32_CMAKE_ARGS="${MINGW32_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}" \ + %mingw32_cmake_generic + +%mingw32_cmake_kde4 \ + MINGW32_CMAKE_ARGS="${MINGW32_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}/kde4" \ + %mingw32_cmake_generic %mingw32_qmake_qt4 /usr/bin/mingw32-qmake-qt4 %mingw32_qmake_qt5 /usr/bin/mingw32-qmake-qt5 diff --git a/macros.mingw64 b/macros.mingw64 index 7f65e24..58b2cc1 100644 --- a/macros.mingw64 +++ b/macros.mingw64 @@ -120,45 +120,32 @@ mandir=%{mingw64_mandir} \\\ infodir=%{mingw64_infodir} -%mingw64_cmake %{mingw64_env} ; \ +%mingw64_cmake_generic %{mingw64_env} ; \ PKG_CONFIG_LIBDIR="%{mingw64_libdir}/pkgconfig:%{mingw64_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \ if test -f CMakeLists.txt; then __mingw64_topdir=.; \\\ elif test -f ../CMakeLists.txt; then __mingw64_topdir=..; \\\ else __mingw64_topdir=""; fi; \\\ PATH=%{_prefix}/%{mingw64_target}/bin:$PATH %__cmake \\\ + -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw64.cmake \\\ -DCMAKE_VERBOSE_MAKEFILE=ON \\\ - -DCMAKE_INSTALL_PREFIX:PATH=%{mingw64_prefix} \\\ - -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw64_libdir} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir} \\\ + -DBUILD_SHARED_LIBS:BOOL=ON \\\ + %{?_cmake_skip_rpath} \\\ -DLIB_INSTALL_DIR:PATH=%{mingw64_libdir} \\\ -DSYSCONF_INSTALL_DIR:PATH=%{mingw64_sysconfdir} \\\ -DSHARE_INSTALL_PREFIX:PATH=%{mingw64_datadir} \\\ - %{?_cmake_skip_rpath} \\\ - -DBUILD_SHARED_LIBS:BOOL=ON \\\ - -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw64.cmake \\\ + -DCMAKE_INSTALL_PREFIX:PATH=%{mingw64_prefix} \\\ + -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw64_libdir} \\\ ${MINGW_CMAKE_ARGS} \\\ ${MINGW64_CMAKE_ARGS} \\\ "$@" $__mingw64_topdir -%mingw64_cmake_kde4 %{mingw64_env} ; \ - PKG_CONFIG_LIBDIR="%{mingw64_libdir}/pkgconfig:%{mingw64_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \ - if test -f CMakeLists.txt; then __mingw64_topdir=.; \\\ - elif test -f ../CMakeLists.txt; then __mingw64_topdir=..; \\\ - else __mingw64_topdir=""; fi; \\\ - %__cmake \\\ - -DCMAKE_VERBOSE_MAKEFILE=ON \\\ - -DCMAKE_INSTALL_PREFIX:PATH=%{mingw64_prefix} \\\ - -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw64_libdir} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir}/kde4 \\\ - -DLIB_INSTALL_DIR:PATH=%{mingw64_libdir} \\\ - -DSYSCONF_INSTALL_DIR:PATH=%{mingw64_sysconfdir} \\\ - -DSHARE_INSTALL_PREFIX:PATH=%{mingw64_datadir} \\\ - %{?_cmake_skip_rpath} \\\ - -DBUILD_SHARED_LIBS:BOOL=ON \\\ - -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/Toolchain-mingw64.cmake \\\ - ${MINGW_CMAKE_ARGS} \\\ - ${MINGW64_CMAKE_ARGS} \\\ - "$@" $__mingw64_topdir +%mingw64_cmake \ + MINGW64_CMAKE_ARGS="${MINGW64_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir}" \ + %mingw64_cmake_generic + +%mingw64_cmake_kde4 \ + MINGW64_CMAKE_ARGS="${MINGW64_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir}/kde4" \ + %mingw64_cmake_generic %mingw64_qmake_qt4 /usr/bin/mingw64-qmake-qt4 %mingw64_qmake_qt5 /usr/bin/mingw64-qmake-qt5 diff --git a/mingw-filesystem.spec b/mingw-filesystem.spec index 908d653..6a2cd73 100644 --- a/mingw-filesystem.spec +++ b/mingw-filesystem.spec @@ -317,6 +317,8 @@ install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_datadir}/mingw/ * Add CMAKE_SYSTEM_PROCESSOR to the CMake toolchain files * Removed Boost_COMPILER from the CMake toolchain files as it was unused and broken anyway + * Made the RPM macros mingw32_cmake, mingw32_cmake_kde4, + mingw64_cmake and mingw64_cmake_kde4 more generic * Sat Jun 07 2014 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild