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