0ee124
#
0ee124
# Macros for cmake
0ee124
#
0ee124
%_cmake_lib_suffix64 -DLIB_SUFFIX=64
0ee124
%_cmake_shared_libs -DBUILD_SHARED_LIBS:BOOL=ON
0ee124
%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON
0ee124
%_cmake_version @@CMAKE_VERSION@@
0ee124
%__cmake /usr/bin/cmake
0ee124
0ee124
# - Set default compile flags
0ee124
# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables
0ee124
# and default to -O3 -DNDEBUG.  Strip the -O3 so we can override with *FLAGS
0ee124
# - Turn on verbose makefiles so we can see and verify compile flags
0ee124
# - Set default install prefixes and library install directories
0ee124
# - Turn on shared libraries by default
0ee124
%cmake \
0ee124
%if 0%{?set_build_flags:1} \
0ee124
  %set_build_flags \
0ee124
%else \
0ee124
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
0ee124
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
0ee124
  FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS ; \
0ee124
  FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS ; \
0ee124
  %{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} \
0ee124
%endif \
0ee124
  %__cmake \\\
0ee124
        -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
0ee124
        -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
0ee124
        -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
0ee124
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
0ee124
        -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
0ee124
        -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\
0ee124
        -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\
0ee124
        -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
0ee124
        -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
0ee124
%if "%{?_lib}" == "lib64" \
0ee124
        %{?_cmake_lib_suffix64} \\\
0ee124
%endif \
0ee124
	%{?_cmake_shared_libs}
0ee124
0ee124
%cmake@@CMAKE_MAJOR_VERSION@@ %cmake