/[gentoo-x86]/eclass/cmake-utils.eclass
Gentoo

Diff of /eclass/cmake-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.102 Revision 1.103
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.102 2014/01/25 04:07:04 floppym Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.103 2014/02/08 01:42:44 vapier Exp $
4 4
5# @ECLASS: cmake-utils.eclass 5# @ECLASS: cmake-utils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @AUTHOR: 8# @AUTHOR:
370} 370}
371 371
372enable_cmake-utils_src_prepare() { 372enable_cmake-utils_src_prepare() {
373 debug-print-function ${FUNCNAME} "$@" 373 debug-print-function ${FUNCNAME} "$@"
374 374
375 debug-print "$FUNCNAME: PATCHES=$PATCHES" 375 debug-print "$FUNCNAME: PATCHES=$PATCHES"
376 376
377 pushd "${S}" > /dev/null 377 pushd "${S}" >/dev/null
378 [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" 378 [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
379 379
380 debug-print "$FUNCNAME: applying user patches" 380 debug-print "$FUNCNAME: applying user patches"
381 epatch_user 381 epatch_user
382 382
383 popd > /dev/null 383 popd >/dev/null
384
385} 384}
386 385
387# @VARIABLE: mycmakeargs 386# @VARIABLE: mycmakeargs
388# @DEFAULT_UNSET 387# @DEFAULT_UNSET
389# @DESCRIPTION: 388# @DESCRIPTION:
507 -DCMAKE_INSTALL_DO_STRIP=OFF 506 -DCMAKE_INSTALL_DO_STRIP=OFF
508 -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}" 507 -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}"
509 "${MYCMAKEARGS}" 508 "${MYCMAKEARGS}"
510 ) 509 )
511 510
512 pushd "${BUILD_DIR}" > /dev/null 511 pushd "${BUILD_DIR}" >/dev/null
513 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" 512 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
514 echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" 513 echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
515 "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed" 514 "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
516 popd > /dev/null 515 popd >/dev/null
517} 516}
518 517
519enable_cmake-utils_src_compile() { 518enable_cmake-utils_src_compile() {
520 debug-print-function ${FUNCNAME} "$@" 519 debug-print-function ${FUNCNAME} "$@"
521 520
589# All arguments are passed to emake. 588# All arguments are passed to emake.
590cmake-utils_src_make() { 589cmake-utils_src_make() {
591 debug-print-function ${FUNCNAME} "$@" 590 debug-print-function ${FUNCNAME} "$@"
592 591
593 _check_build_dir 592 _check_build_dir
594 pushd "${BUILD_DIR}" > /dev/null 593 pushd "${BUILD_DIR}" >/dev/null
595 594
596 ${CMAKE_MAKEFILE_GENERATOR}_src_make $@ 595 ${CMAKE_MAKEFILE_GENERATOR}_src_make $@
597 596
598 popd > /dev/null 597 popd >/dev/null
599} 598}
600 599
601enable_cmake-utils_src_install() { 600enable_cmake-utils_src_install() {
602 debug-print-function ${FUNCNAME} "$@" 601 debug-print-function ${FUNCNAME} "$@"
603 602
604 _check_build_dir 603 _check_build_dir
605 pushd "${BUILD_DIR}" > /dev/null 604 pushd "${BUILD_DIR}" >/dev/null
606 DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" || die "died running ${CMAKE_MAKEFILE_GENERATOR} install" 605 DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" || die "died running ${CMAKE_MAKEFILE_GENERATOR} install"
607 popd > /dev/null 606 popd >/dev/null
608 607
609 pushd "${S}" > /dev/null 608 pushd "${S}" >/dev/null
610 #Install docs, copied from base_src_install_docs 609 # Install docs, copied from base_src_install_docs
611 local x 610 local x
612 611
613 if [[ "$(declare -p DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then 612 if [[ "$(declare -p DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then
614 for x in "${DOCS[@]}"; do 613 for x in "${DOCS[@]}"; do
615 debug-print "$FUNCNAME: docs: creating document from ${x}" 614 debug-print "$FUNCNAME: docs: creating document from ${x}"
616 dodoc "${x}" || die "dodoc failed" 615 dodoc "${x}" || die "dodoc failed"
617 done 616 done
618 fi 617 fi
619 if [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then 618 if [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then
620 for x in "${HTML_DOCS[@]}"; do 619 for x in "${HTML_DOCS[@]}"; do
621 debug-print "$FUNCNAME: docs: creating html document from ${x}" 620 debug-print "$FUNCNAME: docs: creating html document from ${x}"
622 dohtml -r "${x}" || die "dohtml failed" 621 dohtml -r "${x}" || die "dohtml failed"
623 done 622 done
624 fi 623 fi
625 624
626 # Backward compatibility, for non-array variables 625 # Backward compatibility, for non-array variables
627 if [[ -n "${DOCS}" ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then 626 if [[ -n "${DOCS}" ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
628 dodoc ${DOCS} || die "dodoc failed" 627 dodoc ${DOCS} || die "dodoc failed"
629 fi 628 fi
630 if [[ -n "${HTML_DOCS}" ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then 629 if [[ -n "${HTML_DOCS}" ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
631 dohtml -r ${HTML_DOCS} || die "dohtml failed" 630 dohtml -r ${HTML_DOCS} || die "dohtml failed"
632 fi 631 fi
633 632
634 popd > /dev/null 633 popd >/dev/null
635} 634}
636 635
637enable_cmake-utils_src_test() { 636enable_cmake-utils_src_test() {
638 debug-print-function ${FUNCNAME} "$@" 637 debug-print-function ${FUNCNAME} "$@"
639 638
640 _check_build_dir 639 _check_build_dir
641 pushd "${BUILD_DIR}" > /dev/null 640 pushd "${BUILD_DIR}" >/dev/null
642 [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; } 641 [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
643 642
644 [[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure ) 643 [[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure )
645 644
646 if ctest "${myctestargs[@]}" "$@" ; then 645 if ctest "${myctestargs[@]}" "$@" ; then
647 einfo "Tests succeeded." 646 einfo "Tests succeeded."
648 popd > /dev/null 647 popd >/dev/null
649 return 0 648 return 0
650 else 649 else
651 if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then 650 if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then
652 # on request from Diego 651 # on request from Diego
653 eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:" 652 eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:"
658 else 657 else
659 die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log" 658 die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log"
660 fi 659 fi
661 660
662 # die might not die due to nonfatal 661 # die might not die due to nonfatal
663 popd > /dev/null 662 popd >/dev/null
664 return 1 663 return 1
665 fi 664 fi
666} 665}
667 666
668# @FUNCTION: cmake-utils_src_prepare 667# @FUNCTION: cmake-utils_src_prepare

Legend:
Removed from v.1.102  
changed lines
  Added in v.1.103

  ViewVC Help
Powered by ViewVC 1.1.20