cmake macros for dirs

Arkadiusz Miśkiewicz arekm at maven.pl
Tue Dec 9 09:09:02 CET 2014


Some time ago %cmake macro lost -DINCLUDE_INSTALL_DIR
http://git.pld-linux.org/gitweb.cgi?p=packages/rpm-build-macros.git;a=commitdiff;h=b6ce5bb6a311437b480b901de363d834770f1ab8

According to:
/usr/share/cmake/Modules/GNUInstallDirs.cmake
there are defines for almost every dir example

CMAKE_INSTALL_INCLUDEDIR and so on.

Any ideas why we don't set these in %cmake? That would make
us closer to what %configure gets passed.

According to cmake/kde people mixinx relative and absolute
paths is very bad idea. kf5 fails to build correctly due to that:

http://public.kitware.com/Bug/view.php?id=15258
http://public.kitware.com/pipermail/cmake-developers/2014-December/023877.html


diff --git a/rpm.macros b/rpm.macros
index ab6b88e..d40a5e2 100644
--- a/rpm.macros
+++ b/rpm.macros
@@ -264,7 +264,21 @@ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\
 %{__cmake} \\\
        -DCMAKE_VERBOSE_MAKEFILE=ON \\\
        -DCMAKE_BUILD_TYPE=%{!?debug:PLD}%{?debug:Debug} \\\
+       -DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \\\
+       -DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \\\
+       -DCMAKE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \\\
+       -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \\\
+       -DCMAKE_INSTALL_SHAREDSTATEDIRPATH=%{_sharedstatedir} \\\
+       -DCMAKE_INSTALL_LOCALSTATEDIRPATH=%{_localstatedir} \\\
        -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\
+       -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir} \\\
+       -DCMAKE_INSTALL_OLDINCLUDEDIR:PATH=%{_includedir} \\\
+       -DCMAKE_INSTALL_DATAROOTDIR:PATH=%{_datadir} \\\
+       -DCMAKE_INSTALL_DATADIR:PATH=%{_datadir} \\\
+       -DCMAKE_INSTALL_INFODIR:PATH=%{_infodir} \\\
+       -DCMAKE_INSTALL_LOCALEDIR:PATH=%{_localedir} \\\
+       -DCMAKE_INSTALL_MANDIR:PATH=%{_mandir} \\\
+       -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir} \\\
        -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
        -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
        -DCMAKE_CXX_FLAGS_PLD="${CXXFLAGS:-%{rpmcxxflags} -DNDEBUG -DQT_NO_DEBUG}" \\\

-- 
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )


More information about the pld-devel-en mailing list