| |
@@ -1,3 +1,34 @@
|
| |
# This file is used _only_ to override macros which exist in RHEL.
|
| |
# It should be used very sparingly.
|
| |
|
| |
+ # Override the cmake macro to support out-of-source builds
|
| |
+ # The cmake version in RHEL 8 does not accept -B and -S flags
|
| |
+ # Reimplement using a shell wrapper
|
| |
+ %cmake \
|
| |
+ %if 0%{?set_build_flags:1} \
|
| |
+ %set_build_flags \
|
| |
+ %else \
|
| |
+ 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 ;} \
|
| |
+ %endif \
|
| |
+ %if 0%{?__cmake_in_source_build:1} \
|
| |
+ %__cmake \\\
|
| |
+ %else \
|
| |
+ %{_rpmconfigdir}/cmakewrapper %__cmake "%{__cmake_builddir}" \\\
|
| |
+ %endif \
|
| |
+ -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 \
|
| |
+ %{?_cmake_shared_libs}
|
| |
Add new cmake macros (backported to the cmake version in RHEL 8)
References:
https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
https://bugzilla.redhat.com/show_bug.cgi?id=1861329