summaryrefslogtreecommitdiff
path: root/dev-util/cmake/files
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/cmake/files')
-rw-r--r--dev-util/cmake/files/50cmake-gentoo.el4
-rw-r--r--dev-util/cmake/files/cmake-2.6.3-darwin-bundle.patch23
-rw-r--r--dev-util/cmake/files/cmake-2.6.3-fix_broken_lfs_on_aix.patch39
-rw-r--r--dev-util/cmake/files/cmake-2.6.3-no-duplicates-in-rpath.patch19
-rw-r--r--dev-util/cmake/files/cmake-2.8.0-darwin-default-install_name.patch20
-rw-r--r--dev-util/cmake/files/cmake-2.8.1-libform.patch50
-rw-r--r--dev-util/cmake/files/cmake-2.8.10-FindPythonLibs.patch13
-rw-r--r--dev-util/cmake/files/cmake-2.8.10-darwin-bundle.patch23
-rw-r--r--dev-util/cmake/files/cmake-2.8.10-desktop.patch13
-rw-r--r--dev-util/cmake/files/cmake-2.8.10-libform.patch51
-rw-r--r--dev-util/cmake/files/cmake-2.8.10-more-no_host_paths.patch134
-rw-r--r--dev-util/cmake/files/cmake-2.8.10-tests.patch83
-rw-r--r--dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch24
-rw-r--r--dev-util/cmake/files/cmake-2.8.10.2-implicit-include.patch139
-rw-r--r--dev-util/cmake/files/cmake-2.8.10.2-qt5.patch16
-rw-r--r--dev-util/cmake/files/cmake-2.8.4-FindPythonLibs.patch12
-rw-r--r--dev-util/cmake/files/cmake-2.8.7-FindBLAS.patch45
-rw-r--r--dev-util/cmake/files/cmake-2.8.7-FindBoost-python.patch73
-rw-r--r--dev-util/cmake/files/cmake-2.8.7-FindLAPACK.patch44
-rw-r--r--dev-util/cmake/files/cmake-2.8.8-FindPkgConfig.patch18
-rw-r--r--dev-util/cmake/files/cmake-2.8.8-tests.patch58
-rw-r--r--dev-util/cmake/files/cmake-2.8.9-more-no_host_paths.patch133
-rw-r--r--dev-util/cmake/files/cmake.vim3
23 files changed, 1037 insertions, 0 deletions
diff --git a/dev-util/cmake/files/50cmake-gentoo.el b/dev-util/cmake/files/50cmake-gentoo.el
new file mode 100644
index 00000000000..e4a1a6d47cb
--- /dev/null
+++ b/dev-util/cmake/files/50cmake-gentoo.el
@@ -0,0 +1,4 @@
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'cmake-mode "cmake-mode" "Major mode for editing CMake files." t)
+(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode))
+(add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-mode))
diff --git a/dev-util/cmake/files/cmake-2.6.3-darwin-bundle.patch b/dev-util/cmake/files/cmake-2.6.3-darwin-bundle.patch
new file mode 100644
index 00000000000..6ee9b709dff
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.6.3-darwin-bundle.patch
@@ -0,0 +1,23 @@
+Don't use .so for modules on darwin/macos. Use .bundle instead.
+Patch by Heiko Przybyl
+
+--- Modules/Platform/Darwin.cmake
++++ Modules/Platform/Darwin.cmake
+@@ -23,7 +23,7 @@
+ SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+ SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+ SET(CMAKE_SHARED_MODULE_PREFIX "lib")
+-SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
++SET(CMAKE_SHARED_MODULE_SUFFIX ".bundle")
+ SET(CMAKE_MODULE_EXISTS 1)
+ SET(CMAKE_DL_LIBS "")
+
+@@ -45,7 +45,7 @@
+ SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
+ SET(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
+ SET(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
+-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
++SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".bundle" ".a")
+
+ # hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
+ # (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
diff --git a/dev-util/cmake/files/cmake-2.6.3-fix_broken_lfs_on_aix.patch b/dev-util/cmake/files/cmake-2.6.3-fix_broken_lfs_on_aix.patch
new file mode 100644
index 00000000000..02c3011c8f7
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.6.3-fix_broken_lfs_on_aix.patch
@@ -0,0 +1,39 @@
+http://public.kitware.com/Bug/view.php?id=7933
+
+diff -ur cmake-2.6.2/Source/kwsys/kwsysPlatformTestsCXX.cxx cmake-2.6.2-p/Source/kwsys/kwsysPlatformTestsCXX.cxx
+--- cmake-2.6.2/Source/kwsys/kwsysPlatformTestsCXX.cxx Wed Sep 24 20:34:37 2008
++++ cmake-2.6.2-p/Source/kwsys/kwsysPlatformTestsCXX.cxx Tue Nov 4 11:18:32 2008
+@@ -38,6 +38,13 @@
+ int main() { return 0; }
+ #endif
+
++#ifdef TEST_KWSYS_LFS_SUPPORT
++#define _LARGE_FILES
++#include <iostream>
++int main() { return 0; }
++#endif
++
++
+ #ifdef TEST_KWSYS_IOS_HAVE_STD
+ #include <iosfwd>
+ void f(std ::ostream*) {}
+diff -ur cmake-2.6.2/bootstrap cmake-2.6.2-p/bootstrap
+--- cmake-2.6.2/bootstrap Wed Sep 24 20:34:33 2008
++++ cmake-2.6.2-p/bootstrap Tue Nov 4 11:17:11 2008
+@@ -1005,6 +1005,16 @@
+ echo "${cmake_cxx_compiler} does not have stl iterator_traits"
+ fi
+
++if cmake_try_run "${cmake_cxx_compiler}" \
++ "${cmake_cxx_flags} -DTEST_KWSYS_LFS_SUPPORT" \
++ "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
++ KWSYS_LFS_AVAILABLE=1
++ echo "LFS support available"
++else
++ KWSYS_LFS_AVAILABLE=0
++ echo "LFS support unavailable, disabled"
++fi
++
+ if [ "x${KWSYS_STL_HAS_ITERATOR_TRAITS}" = "x0" ]; then
+ if cmake_try_run "${cmake_cxx_compiler}" \
+ "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
diff --git a/dev-util/cmake/files/cmake-2.6.3-no-duplicates-in-rpath.patch b/dev-util/cmake/files/cmake-2.6.3-no-duplicates-in-rpath.patch
new file mode 100644
index 00000000000..ceb205ff586
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.6.3-no-duplicates-in-rpath.patch
@@ -0,0 +1,19 @@
+Patch by Heiko Przybyl
+
+--- Source/cmComputeLinkInformation.cxx
++++ Source/cmComputeLinkInformation.cxx
+@@ -1686,6 +1686,14 @@ std::string cmComputeLinkInformation::Ge
+ for(std::vector<std::string>::const_iterator ri = runtimeDirs.begin();
+ ri != runtimeDirs.end(); ++ri)
+ {
++ // Do not add duplicates.
++ // I'd like to have that check already in the list generation code
++ // but that would need lots of more changes, even in ExpandListArgument().
++ if(*sep != '\0' && (rpath + sep).find(*ri + sep) != std::string::npos)
++ {
++ //std::cerr << "ignoring duplicate: '" << *ri << "' in '" << rpath << "'" << std::endl;
++ continue;
++ }
+ // Separate from previous path.
+ rpath += sep;
+ sep = this->GetRuntimeSep().c_str();
diff --git a/dev-util/cmake/files/cmake-2.8.0-darwin-default-install_name.patch b/dev-util/cmake/files/cmake-2.8.0-darwin-default-install_name.patch
new file mode 100644
index 00000000000..4ef0c7b4b6f
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.0-darwin-default-install_name.patch
@@ -0,0 +1,20 @@
+The install_name of a library can be compared to the ELF soname, setting
+it to just the library name (libx.1.dylib) is not sufficient on Mach-O,
+as it uses full paths. Most apps have no clue about that, so they don't
+do something like http://www.cmake.org/pipermail/cmake/2006-June/009758.html
+
+Provide a sane default that will allow merging most cmake-based
+packages. If this location is not correct, Portage's QA checks will
+catch that.
+
+--- Source/cmTarget.cxx
++++ Source/cmTarget.cxx
+@@ -974,7 +974,7 @@
+ this->Makefile->IsOn("MINGW"));
+
+ // Setup default property values.
+- this->SetPropertyDefault("INSTALL_NAME_DIR", "");
++ this->SetPropertyDefault("INSTALL_NAME_DIR", "${CMAKE_INSTALL_PREFIX}/lib");
+ this->SetPropertyDefault("INSTALL_RPATH", "");
+ this->SetPropertyDefault("INSTALL_RPATH_USE_LINK_PATH", "OFF");
+ this->SetPropertyDefault("SKIP_BUILD_RPATH", "OFF");
diff --git a/dev-util/cmake/files/cmake-2.8.1-libform.patch b/dev-util/cmake/files/cmake-2.8.1-libform.patch
new file mode 100644
index 00000000000..87c724776e5
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.1-libform.patch
@@ -0,0 +1,50 @@
+diff -u -r cmake-2.8.1.medium/CMakeLists.txt cmake-2.8.1/CMakeLists.txt
+--- cmake-2.8.1.medium/CMakeLists.txt 2010-03-16 21:29:28.000000000 +0100
++++ cmake-2.8.1/CMakeLists.txt 2010-04-04 20:04:47.000000000 +0200
+@@ -314,9 +314,6 @@
+ ELSE (UNIX)
+ SET(BUILD_CursesDialog 0)
+ ENDIF (UNIX)
+- IF(BUILD_CursesDialog)
+- ADD_SUBDIRECTORY(Source/CursesDialog/form)
+- ENDIF(BUILD_CursesDialog)
+ ENDMACRO (CMAKE_BUILD_UTILITIES)
+
+
+diff -u -r cmake-2.8.1.medium/Source/CursesDialog/CMakeLists.txt cmake-2.8.1/Source/CursesDialog/CMakeLists.txt
+--- cmake-2.8.1.medium/Source/CursesDialog/CMakeLists.txt 2010-03-16 21:29:34.000000000 +0100
++++ cmake-2.8.1/Source/CursesDialog/CMakeLists.txt 2010-04-04 20:01:38.000000000 +0200
+@@ -25,13 +25,18 @@
+ CursesDialog/ccmake
+ )
+
+-INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source/CursesDialog/form
+- ${CMake_BINARY_DIR}/Source/CursesDialog/form)
+ INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
+
+
+ ADD_EXECUTABLE(ccmake ${CURSES_SRCS} )
+ TARGET_LINK_LIBRARIES(ccmake CMakeLib)
+-TARGET_LINK_LIBRARIES(ccmake cmForm)
++TARGET_LINK_LIBRARIES(ccmake form)
++TARGET_LINK_LIBRARIES(ccmake ${CURSES_LIBRARY})
++IF(CURSES_EXTRA_LIBRARY)
++ TARGET_LINK_LIBRARIES(ccmake ${CURSES_EXTRA_LIBRARY})
++ENDIF(CURSES_EXTRA_LIBRARY)
++
+
+ INSTALL_TARGETS(/bin ccmake)
++
++
+diff -u -r cmake-2.8.1.medium/Source/CursesDialog/cmCursesStandardIncludes.h cmake-2.8.1/Source/CursesDialog/cmCursesStandardIncludes.h
+--- cmake-2.8.1.medium/Source/CursesDialog/cmCursesStandardIncludes.h 2010-03-16 21:29:35.000000000 +0100
++++ cmake-2.8.1/Source/CursesDialog/cmCursesStandardIncludes.h 2010-04-04 20:01:38.000000000 +0200
+@@ -15,8 +15,6 @@
+ #define _MSE_INT_H
+ #endif
+
+-#include <cmFormConfigure.h>
+-
+ #if defined(__hpux)
+ # define _BOOL_DEFINED
+ # include <sys/time.h>
diff --git a/dev-util/cmake/files/cmake-2.8.10-FindPythonLibs.patch b/dev-util/cmake/files/cmake-2.8.10-FindPythonLibs.patch
new file mode 100644
index 00000000000..d4f18ff50f8
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10-FindPythonLibs.patch
@@ -0,0 +1,13 @@
+diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
+index 0a9a990..6a13d22 100644
+--- a/Modules/FindPythonLibs.cmake
++++ b/Modules/FindPythonLibs.cmake
+@@ -79,6 +79,8 @@ unset(_PYTHON1_VERSIONS)
+ unset(_PYTHON2_VERSIONS)
+ unset(_PYTHON3_VERSIONS)
+
++EXECUTE_PROCESS(COMMAND python -c "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))"
++ OUTPUT_VARIABLE _Python_VERSIONS)
+ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
+ string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
+ if(WIN32)
diff --git a/dev-util/cmake/files/cmake-2.8.10-darwin-bundle.patch b/dev-util/cmake/files/cmake-2.8.10-darwin-bundle.patch
new file mode 100644
index 00000000000..9cb4777cc9b
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10-darwin-bundle.patch
@@ -0,0 +1,23 @@
+Don't use .so for modules on darwin/macos. Use .bundle instead.
+Patch by Heiko Przybyl
+
+--- Modules/Platform/Darwin.cmake
++++ Modules/Platform/Darwin.cmake
+@@ -26,7 +26,7 @@
+ set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+ set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+ set(CMAKE_SHARED_MODULE_PREFIX "lib")
+-set(CMAKE_SHARED_MODULE_SUFFIX ".so")
++set(CMAKE_SHARED_MODULE_SUFFIX ".bundle")
+ set(CMAKE_MODULE_EXISTS 1)
+ set(CMAKE_DL_LIBS "")
+
+@@ -48,7 +48,7 @@
+ set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
+ set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
+ set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
+-set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
++set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".bundle" ".a")
+
+ # hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
+ # (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
diff --git a/dev-util/cmake/files/cmake-2.8.10-desktop.patch b/dev-util/cmake/files/cmake-2.8.10-desktop.patch
new file mode 100644
index 00000000000..e0cefa9ceaf
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10-desktop.patch
@@ -0,0 +1,13 @@
+diff --git a/Source/QtDialog/CMake.desktop b/Source/QtDialog/CMake.desktop
+index 645eb76..7be495f 100644
+--- a/Source/QtDialog/CMake.desktop
++++ b/Source/QtDialog/CMake.desktop
+@@ -3,7 +3,7 @@ Version=1.0
+ Name=CMake
+ Comment=Cross-platform buildsystem
+ Exec=cmake-gui %f
+-Icon=CMakeSetup32.png
++Icon=CMakeSetup32
+ Terminal=false
+ X-MultipleArgs=false
+ Type=Application
diff --git a/dev-util/cmake/files/cmake-2.8.10-libform.patch b/dev-util/cmake/files/cmake-2.8.10-libform.patch
new file mode 100644
index 00000000000..052cc30699f
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10-libform.patch
@@ -0,0 +1,51 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ea1c033..ae479ce 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -395,9 +395,6 @@ macro (CMAKE_BUILD_UTILITIES)
+ else ()
+ set(BUILD_CursesDialog 0)
+ endif ()
+- if(BUILD_CursesDialog)
+- add_subdirectory(Source/CursesDialog/form)
+- endif()
+ endmacro ()
+
+ #-----------------------------------------------------------------------
+diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt
+index 96e28b4..4102379 100644
+--- a/Source/CursesDialog/CMakeLists.txt
++++ b/Source/CursesDialog/CMakeLists.txt
+@@ -25,13 +25,16 @@ set( CURSES_SRCS
+ CursesDialog/ccmake
+ )
+
+-include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form
+- ${CMake_BINARY_DIR}/Source/CursesDialog/form)
+ include_directories(${CURSES_INCLUDE_PATH})
+
+
+ add_executable(ccmake ${CURSES_SRCS} )
+ target_link_libraries(ccmake CMakeLib)
+-target_link_libraries(ccmake cmForm)
++TARGET_LINK_LIBRARIES(ccmake form)
++TARGET_LINK_LIBRARIES(ccmake ${CURSES_LIBRARY})
++IF(CURSES_EXTRA_LIBRARY)
++ TARGET_LINK_LIBRARIES(ccmake ${CURSES_EXTRA_LIBRARY})
++ENDIF(CURSES_EXTRA_LIBRARY)
++
+
+ install_targets(/bin ccmake)
+diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h
+index b157a28..f131ea4 100644
+--- a/Source/CursesDialog/cmCursesStandardIncludes.h
++++ b/Source/CursesDialog/cmCursesStandardIncludes.h
+@@ -15,8 +15,6 @@
+ #define _MSE_INT_H
+ #endif
+
+-#include <cmFormConfigure.h>
+-
+ #if defined(__hpux)
+ # define _BOOL_DEFINED
+ # include <sys/time.h>
diff --git a/dev-util/cmake/files/cmake-2.8.10-more-no_host_paths.patch b/dev-util/cmake/files/cmake-2.8.10-more-no_host_paths.patch
new file mode 100644
index 00000000000..88927a3238b
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10-more-no_host_paths.patch
@@ -0,0 +1,134 @@
+From 65571942d4f19d508174f6f89aeaac5ffe380a6e Mon Sep 17 00:00:00 2001
+From: Michael Palimaka <kensington@gentoo.org>
+Date: Tue, 6 Nov 2012 23:35:34 +1100
+Subject: [PATCH] Set some proper paths to make cmake find our tools.
+
+The ebuild now adds an extra / at the end of $EPREFIX so that it is
+never the empty string (so that CMAKE_SYSTEM_PREFIX_PATH remains
+correct)
+
+Original patch by Heiko Przybyl.
+Updated by Chris Reffett (cmake-2.8.8)
+Updated by Johannes Huber (cmake-2.8.9)
+Updated by Michael Palimaka (cmake-2.8.10)
+---
+ Modules/Platform/Darwin.cmake | 12 +++++++----
+ Modules/Platform/UnixPaths.cmake | 43 ++++++++++++++++++++--------------------
+ 2 files changed, 29 insertions(+), 26 deletions(-)
+
+diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
+index a401762..775e547 100644
+--- a/Modules/Platform/Darwin.cmake
++++ b/Modules/Platform/Darwin.cmake
+@@ -251,24 +251,28 @@ set(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK
+ "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
+
+
+-# default to searching for frameworks first
++# default to searching for frameworks last
+ if(NOT DEFINED CMAKE_FIND_FRAMEWORK)
+- set(CMAKE_FIND_FRAMEWORK FIRST)
++ set(CMAKE_FIND_FRAMEWORK LAST)
+ endif()
+ # set up the default search directories for frameworks
+ set(CMAKE_SYSTEM_FRAMEWORK_PATH
++ @GENTOO_PORTAGE_EPREFIX@Frameworks
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /Network/Library/Frameworks
+ /System/Library/Frameworks)
+
+-# default to searching for application bundles first
++# default to searching for application bundles last
+ if(NOT DEFINED CMAKE_FIND_APPBUNDLE)
+- set(CMAKE_FIND_APPBUNDLE FIRST)
++ set(CMAKE_FIND_APPBUNDLE LAST)
+ endif()
+ # set up the default search directories for application bundles
+ set(_apps_paths)
+ foreach(_path
++ @GENTOO_PORTAGE_EPREFIX@Applications
++ @GENTOO_PORTAGE_EPREFIX@usr/bin
+ "~/Applications"
+ "/Applications"
+ "${OSX_DEVELOPER_ROOT}/../Applications" # Xcode 4.3+
+diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
+index ccb2663..0501d53 100644
+--- a/Modules/Platform/UnixPaths.cmake
++++ b/Modules/Platform/UnixPaths.cmake
+@@ -33,6 +33,7 @@ get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
+ # search types.
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ # Standard
++ @GENTOO_PORTAGE_EPREFIX@usr/local @GENTOO_PORTAGE_EPREFIX@usr @GENTOO_PORTAGE_EPREFIX@
+ /usr/local /usr /
+
+ # CMake install location
+@@ -44,43 +45,41 @@ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+
+ # List common include file locations not under the common prefixes.
+ list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+- # Windows API on Cygwin
+- /usr/include/w32api
+-
+- # X11
+- /usr/X11R6/include /usr/include/X11
+-
+- # Other
+- /usr/pkg/include
+- /opt/csw/include /opt/include
+- /usr/openwin/include
++ @GENTOO_PORTAGE_EPREFIX@usr/include
+ )
+
+ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+- # Windows API on Cygwin
+- /usr/lib/w32api
+-
+- # X11
+- /usr/X11R6/lib /usr/lib/X11
+-
+- # Other
+- /usr/pkg/lib
+- /opt/csw/lib /opt/lib
+- /usr/openwin/lib
++ @GENTOO_PORTAGE_GCCLIBDIR@/gcc
++ @GENTOO_PORTAGE_GCCLIBDIR@
++ @GENTOO_PORTAGE_EPREFIX@usr/lib64
++ @GENTOO_PORTAGE_EPREFIX@usr/libx32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
++ @GENTOO_PORTAGE_EPREFIX@lib
+ )
+
+ list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+- /usr/pkg/bin
++ @GENTOO_PORTAGE_EPREFIX@usr/bin
++ @GENTOO_PORTAGE_EPREFIX@bin
+ )
+
+ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+- /lib /usr/lib /usr/lib32 /usr/lib64
++ @GENTOO_PORTAGE_GCCLIBDIR@/gcc
++ @GENTOO_PORTAGE_GCCLIBDIR@
++ @GENTOO_PORTAGE_EPREFIX@usr/lib64
++ @GENTOO_PORTAGE_EPREFIX@usr/libx32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib32
++ @GENTOO_PORTAGE_EPREFIX@usr/lib
++ @GENTOO_PORTAGE_EPREFIX@lib
++ /lib /usr/lib /usr/lib32 /usr/lib64 /usr/libx32
+ )
+
+ list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
++ @GENTOO_PORTAGE_EPREFIX@usr/include
+ /usr/include
+ )
+ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
++ @GENTOO_PORTAGE_EPREFIX@usr/include
+ /usr/include
+ )
+
+--
+1.8.0
+
diff --git a/dev-util/cmake/files/cmake-2.8.10-tests.patch b/dev-util/cmake/files/cmake-2.8.10-tests.patch
new file mode 100644
index 00000000000..944e3c56a78
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10-tests.patch
@@ -0,0 +1,83 @@
+Removes the following tests:
+
+- DeployQt4, which tries to break sandbox and ignores prefix
+- CTest.updatecvs, which fails to commit as root
+- TestUpload, which requires network access
+
+diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
+index b404333..50f4292 100644
+--- a/Tests/CMakeLists.txt
++++ b/Tests/CMakeLists.txt
+@@ -271,23 +271,6 @@ if(BUILD_TESTING)
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities")
+
+- # run test for DeployQt4 on supported platforms/compilers (which depends on BundleUtilities)
+- # this test also depends on the existence of the standard qtiff plugin
+- if(QT4_WORKS AND QT_QTSQL_FOUND)
+- add_test(Qt4Deploy ${CMAKE_CTEST_COMMAND}
+- --build-and-test
+- "${CMake_SOURCE_DIR}/Tests/Qt4Deploy"
+- "${CMake_BINARY_DIR}/Tests/Qt4Deploy"
+- --build-generator ${CMAKE_TEST_GENERATOR}
+- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+- --build-project Qt4Deploy
+- --build-options
+- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+- -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+- )
+- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy")
+- endif()
+-
+ endif()
+ endif()
+
+@@ -1587,30 +1570,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}")
+ endif()
+
+- # Test CTest Update with CVS
+- if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
+- find_package(CVS QUIET)
+- else()
+- find_program(CVS_EXECUTABLE NAMES cvs)
+- set(CVS_FOUND ${CVS_EXECUTABLE})
+- endif()
+- set(CTEST_TEST_UPDATE_CVS ${CVS_FOUND})
+- if(CTEST_TEST_UPDATE_CVS AND NOT UNIX)
+- if("${CVS_EXECUTABLE}" MATCHES "cygwin")
+- message(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!")
+- set(CTEST_TEST_UPDATE_CVS 0)
+- endif()
+- endif()
+- if(CTEST_TEST_UPDATE_CVS)
+- set(CTestUpdateCVS_DIR "CTest UpdateCVS")
+- configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in"
+- "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" @ONLY)
+- add_test(CTest.UpdateCVS ${CMAKE_CMAKE_COMMAND}
+- -P "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake"
+- )
+- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}")
+- endif()
+-
+ # Test CTest Update with BZR
+ find_program(BZR_EXECUTABLE NAMES bzr)
+ mark_as_advanced(BZR_EXECUTABLE)
+@@ -1706,17 +1665,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
+ FAIL_REGULAR_EXPRESSION "SegFault")
+
+ configure_file(
+- "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in"
+- "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake"
+- @ONLY ESCAPE_QUOTES)
+- add_test(CTestTestUpload ${CMAKE_CTEST_COMMAND}
+- -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V
+- --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log"
+- )
+- set_tests_properties(CTestTestUpload PROPERTIES
+- PASS_REGULAR_EXPRESSION "Upload\\.xml")
+-
+- configure_file(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake"
+ @ONLY ESCAPE_QUOTES)
diff --git a/dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch b/dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch
new file mode 100644
index 00000000000..53b395c35b2
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch
@@ -0,0 +1,24 @@
+diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
+index bffa9fb..8fc90ee 100644
+--- a/Modules/FindPythonLibs.cmake
++++ b/Modules/FindPythonLibs.cmake
+@@ -74,6 +74,19 @@ set(_Python_VERSIONS
+ ${_PYTHON_FIND_OTHER_VERSIONS}
+ )
+
++# Gentoo portage requries that you use exactly the given python version
++if (CMAKE_BUILD_TYPE STREQUAL Gentoo)
++ execute_process(COMMAND python -c "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))"
++ OUTPUT_VARIABLE _Gentoo_Python_VERSION)
++ list(FIND _Python_VERSIONS "${_Gentoo_Python_VERSION}" _Gentoo_Python_INDEX)
++ if (_Gentoo_Python_INDEX EQUAL -1)
++ # the current Gentoo python version is not compatible with what is requested
++ set(_Python_VERSIONS)
++ else ()
++ set(_Python_VERSIONS "${_Gentoo_Python_VERSION}")
++ endif ()
++endif()
++
+ unset(_PYTHON_FIND_OTHER_VERSIONS)
+ unset(_PYTHON1_VERSIONS)
+ unset(_PYTHON2_VERSIONS)
diff --git a/dev-util/cmake/files/cmake-2.8.10.2-implicit-include.patch b/dev-util/cmake/files/cmake-2.8.10.2-implicit-include.patch
new file mode 100644
index 00000000000..f0ea5e81461
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10.2-implicit-include.patch
@@ -0,0 +1,139 @@
+--- a/Source/cmLocalGenerator.cxx
++++ b/Source/cmLocalGenerator.cxx
+@@ -1329,7 +1329,9 @@ std::string cmLocalGenerator::GetIncludeFlags(
+ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
+ cmGeneratorTarget* target,
+ const char* lang,
+- const char *config)
++ const char *config,
++ bool stripImplicitInclDirs
++ )
+ {
+ // Need to decide whether to automatically include the source and
+ // binary directories at the beginning of the include path.
+@@ -1404,18 +1406,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
+ return;
+ }
+
+- // Load implicit include directories for this language.
+- std::string impDirVar = "CMAKE_";
+- impDirVar += lang;
+- impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
+- if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str()))
++ if (stripImplicitInclDirs)
+ {
+- std::vector<std::string> impDirVec;
+- cmSystemTools::ExpandListArgument(value, impDirVec);
+- for(std::vector<std::string>::const_iterator i = impDirVec.begin();
+- i != impDirVec.end(); ++i)
++ // Load implicit include directories for this language.
++ std::string impDirVar = "CMAKE_";
++ impDirVar += lang;
++ impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
++ if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str()))
+ {
+- emitted.insert(*i);
++ std::vector<std::string> impDirVec;
++ cmSystemTools::ExpandListArgument(value, impDirVec);
++ for(std::vector<std::string>::const_iterator i = impDirVec.begin();
++ i != impDirVec.end(); ++i)
++ {
++ emitted.insert(*i);
++ }
+ }
+ }
+
+--- a/Source/cmLocalGenerator.h
++++ b/Source/cmLocalGenerator.h
+@@ -212,7 +212,8 @@ public:
+ /** Get the include flags for the current makefile and language. */
+ void GetIncludeDirectories(std::vector<std::string>& dirs,
+ cmGeneratorTarget* target,
+- const char* lang = "C", const char *config = 0);
++ const char* lang = "C", const char *config = 0,
++ bool stripImplicitInclDirs = true);
+
+ /** Compute the language used to compile the given source file. */
+ const char* GetSourceFileLanguage(const cmSourceFile& source);
+--- a/Source/cmQtAutomoc.cxx
++++ b/Source/cmQtAutomoc.cxx
+@@ -212,36 +212,11 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
+ }
+
+
+- const char* qtIncDir = 0;
+- const char* qtCoreIncDir = 0;
+-
+- // check whether ${QT_INCLUDE_DIR} is part of the implicit include dirs,
+- // see http://public.kitware.com/Bug/view.php?id=13667
+- bool qtIncludeDirMayHaveBeenRemoved = false;
+- if (makefile->IsSet("QT_INCLUDE_DIR"))
+- {
+- qtIncDir = makefile->GetDefinition("QT_INCLUDE_DIR");
+- std::string s =
+- makefile->GetSafeDefinition("CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES");
+- std::vector<std::string> implIncDirs;
+- cmSystemTools::ExpandListArgument(s, implIncDirs);
+- if (std::find(implIncDirs.begin(), implIncDirs.end(),std::string(qtIncDir))
+- != implIncDirs.end())
+- {
+- qtIncludeDirMayHaveBeenRemoved = true;
+- if (makefile->IsSet("QT_QTCORE_INCLUDE_DIR"))
+- {
+- qtCoreIncDir = makefile->GetDefinition("QT_QTCORE_INCLUDE_DIR");
+- }
+- }
+- }
+-
+- bool haveQtCoreIncDir = false;
+- bool haveQtIncDir = false;
+-
+ std::vector<std::string> includeDirs;
+ cmGeneratorTarget gtgt(target);
+- localGen->GetIncludeDirectories(includeDirs, &gtgt, "CXX");
++ // Get the include dirs for this target, without stripping the implicit
++ // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
++ localGen->GetIncludeDirectories(includeDirs, &gtgt, "CXX", 0, false);
+ std::string _moc_incs = "";
+ const char* sep = "";
+ for(std::vector<std::string>::const_iterator incDirIt = includeDirs.begin();
+@@ -251,37 +226,6 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
+ _moc_incs += sep;
+ sep = ";";
+ _moc_incs += *incDirIt;
+-
+- if (qtIncludeDirMayHaveBeenRemoved && qtCoreIncDir && qtIncDir) // #13667
+- {
+- if (*incDirIt == qtIncDir)
+- {
+- haveQtIncDir = true;
+- qtIncludeDirMayHaveBeenRemoved = false; // it's here, i.e. not removed
+- }
+- if (*incDirIt == qtCoreIncDir)
+- {
+- haveQtCoreIncDir = true;
+- }
+- }
+- }
+-
+- // Some projects (kdelibs, phonon) query the compiler for its default
+- // include search dirs, and add those to
+- // CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES.
+- // These may include e.g./usr/lib/qt/include . This is typically also part
+- // of ${QT_INCLUDES}. If this directory is then contained in the implicit
+- // include dirs, it is removed from the include dirs returned from the
+- // target above. So we add ${QT_INCLUDE_DIR} manually for moc if we detected
+- // that ${QT_QTCORE_INCLUDE_DIR} is among the include dirs (there shouldn't
+- // be a way to use Qt4 without using ${QT_QTCORE_INCLUDE_DIR} I think.
+- // See #13646 and #13667.
+- if (qtIncludeDirMayHaveBeenRemoved && qtCoreIncDir && qtIncDir
+- && (haveQtCoreIncDir == true) && (haveQtIncDir == false))
+- {
+- _moc_incs += sep;
+- sep = ";";
+- _moc_incs += qtIncDir;
+ }
+
+ const char* tmp = target->GetProperty("COMPILE_DEFINITIONS");
+--
+1.7.0
diff --git a/dev-util/cmake/files/cmake-2.8.10.2-qt5.patch b/dev-util/cmake/files/cmake-2.8.10.2-qt5.patch
new file mode 100644
index 00000000000..1f2bef0cec1
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.10.2-qt5.patch
@@ -0,0 +1,16 @@
+--- Source/QtDoalog/CMakeLists.txt
++++ Source/QtDialog/CMakeLists.txt
+@@ -11,7 +11,12 @@
+ #=============================================================================
+
+ project(QtDialog)
+-find_package(Qt5Widgets QUIET)
++option(WITH_Qt5 ON)
++
++if(WITH_Qt5)
++ find_package(Qt5Widgets QUIET)
++endif()
++
+ if (Qt5Widgets_FOUND)
+ include_directories(${Qt5Widgets_INCLUDE_DIRS})
+ add_definitions(${Qt5Widgets_DEFINITONS})
diff --git a/dev-util/cmake/files/cmake-2.8.4-FindPythonLibs.patch b/dev-util/cmake/files/cmake-2.8.4-FindPythonLibs.patch
new file mode 100644
index 00000000000..28d2e4f8790
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.4-FindPythonLibs.patch
@@ -0,0 +1,12 @@
+diff -urN cmake-2.8.4.old/Modules/FindPythonLibs.cmake cmake-2.8.4/Modules/FindPythonLibs.cmake
+--- cmake-2.8.4.old/Modules/FindPythonLibs.cmake 2011-02-20 19:32:16.363655002 +0100
++++ cmake-2.8.4/Modules/FindPythonLibs.cmake 2011-02-20 19:33:51.905655001 +0100
+@@ -33,6 +33,8 @@
+ ${Python_ADDITIONAL_VERSIONS}
+ 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+
++EXECUTE_PROCESS(COMMAND python -c "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))"
++ OUTPUT_VARIABLE _Python_VERSIONS)
+ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
+ STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
+ IF(WIN32)
diff --git a/dev-util/cmake/files/cmake-2.8.7-FindBLAS.patch b/dev-util/cmake/files/cmake-2.8.7-FindBLAS.patch
new file mode 100644
index 00000000000..a91214c1a90
--- /dev/null
+++ b/dev-util/cmake/files/cmake-2.8.7-FindBLAS.patch
@@ -0,0 +1,45 @@
+diff -ruN cmake-2.8.7.orig/Modules/FindBLAS.cmake cmake-2.8.7/Modules/FindBLAS.cmake
+--- cmake-2.8.7.orig/Modules/FindBLAS.cm