ngompa / rpms / cmake

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