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