2013-08-16 11:35:44 +02:00
|
|
|
#
|
|
|
|
# Macros for cmake
|
|
|
|
#
|
|
|
|
%__cmake %{_bindir}/cmake
|
2014-08-18 10:21:42 +02:00
|
|
|
%__ctest %{_bindir}/ctest
|
2013-08-16 11:35:44 +02:00
|
|
|
|
|
|
|
%cmake \
|
|
|
|
find . -name CMakeLists.txt \\\
|
2014-07-02 10:57:25 +02:00
|
|
|
-exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\\\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\\\)/{s/^/#IGNORE /}' {} + \
|
2013-08-16 11:35:44 +02:00
|
|
|
mkdir -p build \
|
|
|
|
cd build \
|
|
|
|
%__cmake .. \\\
|
|
|
|
-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} \\\
|
2015-11-13 10:24:59 +01:00
|
|
|
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\
|
2014-08-20 12:42:37 +02:00
|
|
|
-DCMAKE_BUILD_TYPE=None \\\
|
|
|
|
-DCMAKE_C_FLAGS="${CFLAGS:-%optflags} -DNDEBUG" \\\
|
|
|
|
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags} -DNDEBUG" \\\
|
|
|
|
-DCMAKE_Fortran_FLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}} -DNDEBUG" \\\
|
2014-08-20 12:46:19 +02:00
|
|
|
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
|
|
|
|
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
|
|
|
|
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \\\
|
2013-08-16 11:35:44 +02:00
|
|
|
%if "%{?_lib}" == "lib64" \
|
|
|
|
-DLIB_SUFFIX=64 \\\
|
|
|
|
%endif \
|
|
|
|
-DCMAKE_SKIP_RPATH:BOOL=ON \\\
|
|
|
|
-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 \\\
|
2013-11-06 19:29:08 +01:00
|
|
|
-DCMAKE_MODULES_INSTALL_DIR=%{_datadir}/cmake/Modules \\\
|
|
|
|
-DCMAKE_USER_MAKE_RULES_OVERRIDE="%{_datadir}/cmake/Modules/opensuse_rules.cmake"
|
2013-08-16 11:35:44 +02:00
|
|
|
|
2014-08-20 12:42:37 +02:00
|
|
|
%make_jobs \
|
2014-08-20 12:46:19 +02:00
|
|
|
%__make %{?_smp_mflags} VERBOSE=1
|
2014-08-20 12:42:37 +02:00
|
|
|
|
2013-08-16 11:35:44 +02:00
|
|
|
%cmake_install \
|
2014-08-20 12:46:19 +02:00
|
|
|
%__make VERBOSE=1 DESTDIR=%{buildroot} install/fast -C build
|
2014-08-18 10:21:42 +02:00
|
|
|
|
|
|
|
%ctest \
|
|
|
|
cd build \
|
|
|
|
%__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} \
|
|
|
|
cd ..
|