mingw64-filesystem/macros.mingw64-cmake
Ralf Habacker 222d8d5142 Accepting request 1071509 from home:rhabacker:branches:windows:mingw:win64:cmake-fixes
- Update to version 20230309
  * Let cmake macros be based on associated macros from macros.cmake
  * Add support to define a custom rpm macro when running mingw64
    related shell scripts, see mingw64-scripts.sh for details
  * Drop using external dependency generator (boo#1175587)
  * Add mingw64_*.attr files to support actual used dependency generator
  * Fix bug that rpm does not use attribute file for cmake by renaming
    to mingw64_cmake.attr (rpm does not like '-' in those file name
    and keys inside)
  * Extend mingw64_cmake.attr to find cmake support files in
    share subdirectory as required for example by mingw64-dlfcn-win32
  * Print deprecated message when using %_mingw64_makeinstall or
    %__mingw64_cmake
  * Reduce some differences to mingw32 in changes and other files,
    which are mostly indentions, hours, trailing '/', variable
    definition rows - make it easier to compare

OBS-URL: https://build.opensuse.org/request/show/1071509
OBS-URL: https://build.opensuse.org/package/show/windows:mingw:win64/mingw64-filesystem?expand=0&rev=153
2023-03-15 21:41:19 +00:00

47 lines
1.8 KiB
Plaintext

#
# Macros for cmake for mingw64
#
# depends on macros.cmake
#
%__cmake_generator %{lua: if rpm.expand("%__builder") == rpm.expand("%__make") then print("-G'Unix Makefiles'") else print("-GNinja") end}
%_mingw64_cmake %{_mingw64_env} ; \
mkdir -p %__builddir \
cd %__builddir \
%__cmake $OLDPWD/%__sourcedir \\\
%__cmake_generator \\\
-DCMAKE_SYSTEM_NAME="Windows" \\\
-DCMAKE_VERBOSE_MAKEFILE=ON \\\
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{_mingw64_prefix} \\\
-DCMAKE_INSTALL_LIBDIR:PATH=%{_mingw64_libdir} \\\
-DBIN_INSTALL_DIR=%{_mingw64_bindir} \\\
-DINCLUDE_INSTALL_DIR:PATH=%{_mingw64_includedir} \\\
-DLIB_INSTALL_DIR:PATH=%{_mingw64_libdir} \\\
-DSHARE_INSTALL_DIR:PATH=%{_mingw64_datadir} \\\
-DSYSCONF_INSTALL_DIR:PATH=%{_mingw64_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{_mingw64_datadir} \\\
-DBUILD_SHARED_LIBS:BOOL=ON \\\
-DCMAKE_C_COMPILER="%{_bindir}/%{_mingw64_cc}" \\\
-DCMAKE_CXX_COMPILER="%{_bindir}/%{_mingw64_cxx}" \\\
-DCMAKE_Fortran_COMPILER="%{_bindir}/%{_mingw64_fc}" \\\
-DCMAKE_RC_COMPILER="%{_bindir}/%{_mingw64_windres}" \\\
-DCMAKE_FIND_ROOT_PATH="%{_mingw64_prefix}" \\\
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \\\
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \\\
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
%__mingw64_cmake \
echo "Deprecated %%__mingw64_cmake macro used, please use %%_mingw64_cmake" \
%{_mingw64_cmake}
%_mingw64_cmake_build %cmake_build
%_mingw64_cmake_install %{_mingw64_env}; \
%cmake_install
%_mingw64_ctest(:-:) \
cd %__builddir \
%__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %** \
cd $OLDPWD