ngompa / rpms / cmake

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