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