pkgsrc/devel/cmake/patches
chuck dfb93e88b9 add CMAKE_PKGSRC_BUILD_FLAGS for pkgsrc build to set opts
With pkgsrc built packages, the goal is to have the user's compiler
optimization flags set by the user using CFLAGS, etc.   To that end,
the cmake Makefile has subst.mk code to "sed -e 's,-O.,,'" out opt.
flags in Modules/Compiler/*.cmake for cmake compiles with the
CMAKE_BUILD_TYPE set (e.g. to Release).

Unfortunately, this sed-based approach has two drawbacks: First, it
gets applied to packages build with cmake outside of pkgsrc (changing
the semantics of -DCMAKE_BUILD_TYPE=Release in an unexpected way by
remove -O flags from it).   Second, the sed expression damages some
of the Modules/Compiler/*.cmake as not all opt flags match the "-O."
regular expression.

To address this we:
  1. remove the subst.mk sed operation on Modules/Compiler/*.cmake
  2. add a new config variable CMAKE_PKGSRC_BUILD_FLAGS that should
     be set for pkgsrc-based cmake builds (e.g. in mk/configure/cmake.mk)
  3. we add a patch for Modules/Compiler/GNU.cmake to look for
     CMAKE_PKGSRC_BUILD_FLAGS and choose a set of non-opt compiler
     flags when this is set (to provide the desired behavior under pksrc).
     note that the GNU.cmake file is also used by clang.   We can
     make the corresponding changes to other compilers if desired.

The result is that cmake compiles under pkgsrc set CMAKE_PKGSRC_BUILD_FLAGS
and follow CFLAGS, etc. (bypassing CMAKE_BUILD_TYPE), but cmake compiles
outside of pkgsrc follow the standard cmake semantics for CMAKE_BUILD_TYPE.
Also, we no longer damage Modules/Compiler/*.cmake with sed.
2018-04-08 19:09:45 +00:00
..
patch-bootstrap cmake: updated to 3.10.1 2017-12-14 22:13:34 +00:00
patch-CMakeLists.txt
patch-Modules_Compiler_GNU.cmake add CMAKE_PKGSRC_BUILD_FLAGS for pkgsrc build to set opts 2018-04-08 19:09:45 +00:00
patch-Modules_FindCurses.cmake
patch-Modules_FindPythonInterp.cmake 3.9.0: 2017-07-19 17:44:34 +00:00
patch-Modules_FindPythonLibs.cmake 3.9.0: 2017-07-19 17:44:34 +00:00
patch-Modules_FindX11.cmake
patch-Modules_Platform_UnixPaths.cmake 3.9.0: 2017-07-19 17:44:34 +00:00
patch-Source_CursesDialog_ccmake.cxx 3.9.0: 2017-07-19 17:44:34 +00:00
patch-Utilities_KWIML_CMakeLists.txt