Add Qt application module.
This commit is contained in:
		
							parent
							
								
									54657eb084
								
							
						
					
					
						commit
						be9045bd2a
					
				| 
						 | 
					@ -0,0 +1,13 @@
 | 
				
			||||||
 | 
					/* @P@/src/@NAME@/TopSource.cpp
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 *  (c)2006, @AUTHOR@, <@EMAIL@>.
 | 
				
			||||||
 | 
					 *  Released under the GNU GPLv2. See file COPYING or
 | 
				
			||||||
 | 
					 *  http://www.gnu.org/copyleft/gpl.html for details.
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Below are all the includes used throughout the application.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* options for text editors
 | 
				
			||||||
 | 
					kate: @KATE_MODELINE@
 | 
				
			||||||
 | 
					vim: @VIM_MODELINE@
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,42 @@
 | 
				
			||||||
 | 
					# These are external variables, and shouldn't clash with anything else
 | 
				
			||||||
 | 
					#  @CNAME@
 | 
				
			||||||
 | 
					#  @CNAME@_BUILT
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z ${@CNAME@_BUILT} ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					    @CNAME@="obj/@NAME@"
 | 
				
			||||||
 | 
					    [ -z "${QTSTUFF}" ] && QTSTUFF="-I${QTDIR}/include -L${QTDIR}/lib -lqt-mt"
 | 
				
			||||||
 | 
					    EXTRAS="${QTSTUFF}" # @TODO@ cflags, libs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    echo "Building application ${@CNAME@}..."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    do_cmd source src/@NAME@/build.monolithic || return 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    MODIFIED=0
 | 
				
			||||||
 | 
					    for test in ${MONOLITHIC_TESTS} ${SRC}
 | 
				
			||||||
 | 
					    do
 | 
				
			||||||
 | 
					        if [ ${test} -nt ${@CNAME@} ]
 | 
				
			||||||
 | 
					        then
 | 
				
			||||||
 | 
					            MODIFIED=1
 | 
				
			||||||
 | 
					            break
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					    done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if [ ${MODIFIED} -ne 0 ]
 | 
				
			||||||
 | 
					    then
 | 
				
			||||||
 | 
					        echo " Compiling..."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        do_cmd ${CXX} ${CFLAGS} -Iobj -o "${@CNAME@}" ${SRC} ${EXTRAS} || return 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        print_success "Application built"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        print_success "Application up to date"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @CNAME@_BUILT=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# kate: @KATE_MODELINE@
 | 
				
			||||||
 | 
					# vim: @VIM_MODELINE@
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					source src/@NAME@/build.app
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					source src/@NAME@/build.install-app
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					build_target @NAME@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# make paths (this is for Gentoo in particular)
 | 
				
			||||||
 | 
					build_dir_tree "${BINDIR}" || return 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# install binary
 | 
				
			||||||
 | 
					echo "Installing binaries into '${BINDIR}'"
 | 
				
			||||||
 | 
					install_file "${@CNAME@}" "${BINDIR}" 0755 || return 1
 | 
				
			||||||
 | 
					print_success "Done"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# kate: @KATE_MODELINE@
 | 
				
			||||||
 | 
					# vim: @VIM_MODELINE@
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,27 @@
 | 
				
			||||||
 | 
					# These are external variables, and shouldn't clash with anything else
 | 
				
			||||||
 | 
					#  @CNAME@_MONOLITHIC
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SRC="obj/@NAME@.cpp"
 | 
				
			||||||
 | 
					MONOLITHIC_TESTS="src/@NAME@/build.app src/@NAME@/build.monolithic"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z "${@CNAME@_MONOLITHIC}" ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					    PREMOC="${SRC}.premoc.cpp"
 | 
				
			||||||
 | 
					    MONOLITHIC_SOURCE="$(echo src/@NAME@/TopSource.cpp)"
 | 
				
			||||||
 | 
					    make_monolithic ${PREMOC} C || return 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if [ "${PREMOC}" -nt "${SRC}" ]
 | 
				
			||||||
 | 
					    then
 | 
				
			||||||
 | 
					        [ -z "${MOC}" ] && MOC="$QTDIR/bin/moc"
 | 
				
			||||||
 | 
					        do_cmd cp "${PREMOC}" "${SRC}" || return 1
 | 
				
			||||||
 | 
					        do_cmd_redir ${SRC} echo "#line 1 \"__generated_by_qt_moc__.cpp\"" || return 1
 | 
				
			||||||
 | 
					        do_cmd_redir ${SRC} ${MOC} <${PREMOC} || return 1
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @CNAME@_MONOLITHIC=1
 | 
				
			||||||
 | 
					    MONOLITHIC_DOC="${MONOLITHIC_DOC} ${SRC}"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# kate: @KATE_MODELINE@
 | 
				
			||||||
 | 
					# vim: @VIM_MODELINE@
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,11 @@
 | 
				
			||||||
 | 
					if [ $# -ne 0 ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					    print_failure "Too many arguments. None required for this module."
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					do_parameter_subst
 | 
				
			||||||
 | 
					true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
 | 
				
			||||||
 | 
					# vim: expandtab:ts=4:sw=4
 | 
				
			||||||
		Loading…
	
		Reference in New Issue