dev-util/cmake: Support indicating Gentoo build via CMAKE_GENTOO_BUILD
authorMichał Górny <mgorny@gentoo.org>
Sun, 27 Nov 2016 12:30:35 +0000 (13:30 +0100)
committerMichał Górny <mgorny@gentoo.org>
Wed, 30 Nov 2016 09:42:07 +0000 (10:42 +0100)
Support indicating Gentoo package build using a new CMAKE_GENTOO_BUILD
CMake variable, as an alternative to relying on CMAKE_BUILD_TYPE being
equal to Gentoo. This makes it possible to reduce reliance on a custom
build type in the future.

dev-util/cmake/cmake-3.7.0-r1.ebuild [moved from dev-util/cmake/cmake-3.7.0.ebuild with 100% similarity]
dev-util/cmake/files/cmake-2.8.10.2-FindPythonLibs.patch
dev-util/cmake/files/cmake-3.1.0-FindPythonInterp.patch
dev-util/cmake/files/cmake-3.5.2-FindQt4.patch

index 2a83ff7abb69de8dcf1472c1e8c4bbac03354c1c..5f9c26658f31ff942aa39ce26cc12407dc026cbf 100644 (file)
@@ -7,7 +7,7 @@ index bffa9fb..8fc90ee 100644
    )
  
 +# Gentoo portage requires that you use exactly the given python version
-+if (CMAKE_BUILD_TYPE STREQUAL Gentoo)
++if (CMAKE_GENTOO_BUILD OR 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)
index 3abb2e4065e87aa06dbc9c23c0b3960c2902db31..bb3ca9580ad9272ce9a86b98b5b5e00ae2d3fe81 100644 (file)
@@ -5,7 +5,7 @@
      set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
  endif()
 +
-+if (CMAKE_BUILD_TYPE STREQUAL Gentoo)
++if (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo)
 +    set(_Python_NAMES python)
 +endif()
 +
@@ -17,7 +17,7 @@
  
  # Search for newest python version if python executable isn't found
 -if(NOT PYTHON_EXECUTABLE)
-+if(NOT PYTHON_EXECUTABLE AND NOT CMAKE_BUILD_TYPE STREQUAL Gentoo)
++if(NOT PYTHON_EXECUTABLE AND NOT (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo))
      foreach(_CURRENT_VERSION IN LISTS _Python_VERSIONS)
        set(_Python_NAMES python${_CURRENT_VERSION})
        if(WIN32)
index 845fc6e75d8547dda8bf7c345c8b8d58bbe80a04..2f2764d30cf6aa94553c3227f79bfc2c1f436657 100644 (file)
@@ -23,7 +23,7 @@ Gentoo-bug: 547222
 -    PATH_SUFFIXES bin
 -    DOC "The qmake executable for the Qt installation to use"
 -  )
-+  if(CMAKE_BUILD_TYPE STREQUAL Gentoo)
++  if(CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo)
 +    find_program(QT_QMAKE_EXECUTABLE NAMES ${QMAKE_NAME}
 +      PATHS
 +        $ENV{EPREFIX}/usr/${CMAKE_INSTALL_LIBDIR}/qt4/bin