cmake-utils.eclass: Override CMAKE_INSTALL_DOCDIR in EAPI 7
authorMichał Górny <mgorny@gentoo.org>
Thu, 29 Mar 2018 19:05:54 +0000 (21:05 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sat, 2 Jun 2018 10:47:09 +0000 (12:47 +0200)
Pass the correct docdir for GNUInstallDirs in EAPIs starting with 7.
We do not need add it retroactively to avoid breaking something
accidentally.

eclass/cmake-utils.eclass

index 558ff3a1ef9bde99b46158d6824674a43c155760..e64502b3b9b04ae7f2e8593b4c82e41036bdf4bf 100644 (file)
@@ -614,6 +614,12 @@ cmake-utils_src_configure() {
        _EOF_
        [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
 
+       if [[ ${EAPI} != [56] ]]; then
+               cat >> "${common_config}" <<- _EOF_ || die
+                       SET (CMAKE_INSTALL_DOCDIR "${EPREFIX}/usr/share/doc/${PF}" CACHE PATH "")
+               _EOF_
+       fi
+
        # Wipe the default optimization flags out of CMake
        if [[ ${CMAKE_BUILD_TYPE} != Gentoo && ${EAPI} != 5 ]]; then
                cat >> ${common_config} <<- _EOF_ || die