mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Merge branch 'OP-438_os_Windows-installer' of git://git.openpilot.org/OpenPilot
This commit is contained in:
commit
a888e90819
@ -2,21 +2,20 @@
|
||||
# Top level Qt-Creator project file
|
||||
#
|
||||
|
||||
# This meta-project allows qt-creator users to open
|
||||
# and configure a single project and to build all
|
||||
# required software to produce a GCS. This includes
|
||||
# regenerating all uavobject output.
|
||||
# This meta-project allows qt-creator users to open and configure a
|
||||
# single project and to build all required software to produce a GCS.
|
||||
# This includes regenerating all uavobject output.
|
||||
#
|
||||
# NOTE: To use this meta-project, you MUST perform these
|
||||
# steps once for each SVN checkout:
|
||||
# NOTE: to use this meta-project, you MUST perform these steps once
|
||||
# for each source tree checkout:
|
||||
# - Open <top>/ground/ground.pro in qt-creator
|
||||
# - Select the "Projects" tab
|
||||
# - Under Build Settings/General heading, click "Show Details"
|
||||
# - Activate "Shadow Build"
|
||||
# - Set your Build Directory to <top>/build/ground
|
||||
#
|
||||
# <top> = The full path to the base of your svn tree which should
|
||||
# contain "flight", "ground", etc.
|
||||
# <top> = the full path to the base of your git source tree which
|
||||
# should contain "flight", "ground", etc.
|
||||
|
||||
# There is a small problem with dependencies. qmake needs synthetic
|
||||
# files when it generates GCS Makefiles. But we do not have
|
||||
|
86
ground/openpilotgcs/packaging/winx86/make_header.cmd
Normal file
86
ground/openpilotgcs/packaging/winx86/make_header.cmd
Normal file
@ -0,0 +1,86 @@
|
||||
@echo off
|
||||
rem
|
||||
rem make_header - a workaround to build NSIS version info header from
|
||||
rem Makefile using different environments (Windows cmd or Unix-like sh)
|
||||
rem still being more or less portable.
|
||||
rem
|
||||
rem This script tries to find any git command line utility on the system.
|
||||
rem First, it looks at the predefined location of git.exe installed by
|
||||
rem msysgit package available at http://code.google.com/p/msysgit/
|
||||
rem If not found, it searches for git executables in the system PATH.
|
||||
rem If also not found, then it gives up and no commit info will be available.
|
||||
rem
|
||||
rem Expected parameters:
|
||||
rem %1: repository source path
|
||||
rem %2: header file full path and name
|
||||
rem
|
||||
|
||||
rem FIXME: we should have product version info somewhere else
|
||||
set OUT_FILE=OpenPilotGCS-%%%%ad-%%%%h-install.exe
|
||||
set PRODUCT_VERSION=0.0.0.0
|
||||
set FILE_VERSION=%%%%ad %%BRANCH%%:%%%%h
|
||||
set BUILD_DESCRIPTION=Built using %%ORIGIN%% as origin, branch %%BRANCH%%, commit %%%%H, committed %%%%ci
|
||||
|
||||
set REPO=%1
|
||||
set HEADER=%2
|
||||
if "%REPO%" == "" goto NoRepo
|
||||
if "%HEADER%" == "" goto NoHeader
|
||||
goto OK
|
||||
|
||||
:NoRepo
|
||||
:NoHeader
|
||||
echo This script should be called from Makefile only
|
||||
goto :eof
|
||||
|
||||
:Ok
|
||||
rem Looking for git command line utility at the predefined msysgit location
|
||||
rem first, and in the PATH last. Also note that we use call command which is
|
||||
rem required if we execute a .cmd or .bat file instead of .exe
|
||||
|
||||
set GIT=%ProgramFiles%\Git\bin\git.exe
|
||||
if exist "%GIT%" goto Found
|
||||
|
||||
for %%G in (git.exe) do set GIT=%%~$PATH:G
|
||||
if exist "%GIT%" goto Found
|
||||
|
||||
for %%G in (git.cmd) do set GIT=%%~$PATH:G
|
||||
if exist "%GIT%" goto Found
|
||||
|
||||
for %%G in (git.bat) do set GIT=%%~$PATH:G
|
||||
if exist "%GIT%" goto Found
|
||||
|
||||
:NotFound
|
||||
echo git not found, no version info available
|
||||
goto :eof
|
||||
|
||||
:Found
|
||||
echo Using "%GIT%" to extract version info from "%REPO%"...
|
||||
|
||||
rem Getting remote origin name
|
||||
for /F "usebackq tokens=1-3" %%G in (`call "%GIT%" remote -v`) do (
|
||||
if "%%G" == "origin" if "%%I" == "(fetch)" set ORIGIN=%%H
|
||||
)
|
||||
|
||||
rem Getting branch name
|
||||
for /F "usebackq tokens=1,2" %%G in (`call "%GIT%" branch --no-color`) do (
|
||||
if "%%G" == "*" set BRANCH=%%H
|
||||
)
|
||||
|
||||
rem Getting commit info
|
||||
set OPTS=-1 --no-color --date=short
|
||||
set OPTS=%OPTS% "--format=format:
|
||||
set OPTS=%OPTS%;%%%%n
|
||||
set OPTS=%OPTS%; AUTOGENERATED HEADER FILE%%%%n
|
||||
set OPTS=%OPTS%;%%%%n
|
||||
set OPTS=%OPTS%%%%%n
|
||||
set OPTS=%OPTS%; Installer file name%%%%n
|
||||
set OPTS=%OPTS%!define OUT_FILE \"%OUT_FILE%\"%%%%n
|
||||
set OPTS=%OPTS%%%%%n
|
||||
set OPTS=%OPTS%; Installer version info%%%%n
|
||||
set OPTS=%OPTS%!define PRODUCT_VERSION \"%PRODUCT_VERSION%\"%%%%n
|
||||
set OPTS=%OPTS%!define FILE_VERSION \"%FILE_VERSION%\"%%%%n
|
||||
set OPTS=%OPTS%!define BUILD_DESCRIPTION \"%BUILD_DESCRIPTION%\"%%%%n"
|
||||
|
||||
pushd "%REPO%"
|
||||
call "%GIT%" log %OPTS% >%HEADER%
|
||||
popd
|
@ -1,16 +1,11 @@
|
||||
@echo off
|
||||
rem
|
||||
rem Project: OpenPilot
|
||||
rem NSIS installer script file for OpenPilot GCS
|
||||
rem The OpenPilot Team, http://www.openpilot.org, Copyright (C) 2010-2011.
|
||||
rem
|
||||
rem This script requires Unicode NSIS 2.46 or higher:
|
||||
rem http://www.scratchpaper.com/
|
||||
rem
|
||||
rem Optional SVN utility to get currently used SVN revision is SubWCRev.exe,
|
||||
rem it is a part of TortoiseSVN package or is available separately:
|
||||
rem http://sourceforge.net/projects/tortoisesvn/files/Tools/1.6.7/SubWCRev-1.6.7.18415.msi/download
|
||||
rem
|
||||
|
||||
rem Set path to NSIS compiler
|
||||
set NSIS=%ProgramFiles%/NSIS/Unicode
|
@ -1,11 +1,11 @@
|
||||
#
|
||||
# SubWCRev not found, default values used instead.
|
||||
# git not found, default values used instead.
|
||||
#
|
||||
|
||||
; Installer file name
|
||||
!define OUT_FILE "OpenPilotGCS-XXXX-install.exe"
|
||||
!define OUT_FILE "OpenPilotGCS-unreleased-install.exe"
|
||||
|
||||
; Installer version info
|
||||
!define PRODUCT_VERSION "0.0.0.0"
|
||||
!define FILE_VERSION "0.0.0.0"
|
||||
!define BUILD_DESCRIPTION "Unknown revision."
|
||||
!define BUILD_DESCRIPTION "Unreleased version."
|
||||
|
@ -20,16 +20,9 @@
|
||||
|
||||
# This script requires Unicode NSIS 2.46 or higher:
|
||||
# http://www.scratchpaper.com/
|
||||
#
|
||||
# Optionally used SubWCRev utility to extract SVN info from working copy.
|
||||
# SubWCRev is a part of TortoiseSVN client distribution:
|
||||
# http://tortoisesvn.net/
|
||||
# SubWCRev is also available separately:
|
||||
# http://sourceforge.net/projects/tortoisesvn/files/Tools/1.6.7/SubWCRev-1.6.7.18415.msi/download
|
||||
|
||||
# Features:
|
||||
# - Installs to the user local appdata path, no admin rights required.
|
||||
# - Multilingual, needs translations for custom installer strings.
|
||||
#
|
||||
# TODO:
|
||||
# - optionally install for all users (to Program Files with admin rights on Vista/7).
|
||||
@ -69,7 +62,7 @@
|
||||
|
||||
VIProductVersion ${PRODUCT_VERSION}
|
||||
VIAddVersionKey "ProductName" "${INSTALLER_NAME}"
|
||||
VIAddVersionKey "FileVersion" ${FILE_VERSION}
|
||||
VIAddVersionKey "FileVersion" "${FILE_VERSION}"
|
||||
VIAddVersionKey "Comments" "${INSTALLER_NAME}. ${BUILD_DESCRIPTION}"
|
||||
VIAddVersionKey "CompanyName" "The OpenPilot Team, http://www.openpilot.org"
|
||||
VIAddVersionKey "LegalTrademarks" "${PRODUCT_NAME} is a trademark of The OpenPilot Team"
|
||||
|
@ -1,12 +0,0 @@
|
||||
#
|
||||
# SubWCRev autogenerated file, do not modify.
|
||||
# Generated using nsis.tpl template.
|
||||
#
|
||||
|
||||
; Installer file name
|
||||
!define OUT_FILE "OpenPilotGCS-$WCREV$-install.exe"
|
||||
|
||||
; Installer version info
|
||||
!define PRODUCT_VERSION "0.0.0.$WCREV$"
|
||||
!define FILE_VERSION "0.0.0.$WCREV$"
|
||||
!define BUILD_DESCRIPTION "Last committed revision $WCREV$ ($WCDATE$) using$WCMIXED? mixed:$ SVN revision range $WCRANGE$$WCMODS? (locally modified):$. Built from $WCURL$ ($WCNOW$)."
|
@ -1,37 +0,0 @@
|
||||
#
|
||||
# SubWCRev not found, default values used instead.
|
||||
# Generated using svninfo.tpl template.
|
||||
#
|
||||
|
||||
# Highest committed revision number
|
||||
WCREV = NA
|
||||
|
||||
# Date of highest committed revision
|
||||
WCDATE = NA
|
||||
|
||||
# Mixed update revision state and revision range
|
||||
WCMIXED = 0
|
||||
WCMIXED_TXT = NA
|
||||
WCRANGE = NA
|
||||
|
||||
# Repository URL of the working copy
|
||||
WCURL = NA
|
||||
|
||||
# Current system date & time
|
||||
WCNOW = NA
|
||||
|
||||
# Lock status, date, owner, and comment for this item
|
||||
WCISLOCKED = 0
|
||||
WCLOCKDATE = NA
|
||||
WCLOCKOWNER = NA
|
||||
WCLOCKCOMMENT = NA
|
||||
|
||||
# True if local modifications found
|
||||
WCMODS = 0
|
||||
WCMODS_TXT = NA
|
||||
|
||||
# True if the item is versioned
|
||||
WCINSVN = 0
|
||||
|
||||
# True if the svn:needs-lock property is set
|
||||
WCNEEDSLOCK = 0
|
@ -1,37 +0,0 @@
|
||||
#
|
||||
# SubWCRev autogenerated file, do not modify.
|
||||
# Generated using svninfo.tpl template.
|
||||
#
|
||||
|
||||
# Highest committed revision number
|
||||
WCREV = $WCREV$
|
||||
|
||||
# Date of highest committed revision
|
||||
WCDATE = $WCDATE=%Y/%m/%d %H:%M:%S$
|
||||
|
||||
# Mixed update revision state and revision range
|
||||
WCMIXED = $WCMIXED?1:0$
|
||||
WCMIXED_TXT = $WCMIXED?(mixed):$
|
||||
WCRANGE = $WCRANGE$
|
||||
|
||||
# Repository URL of the working copy
|
||||
WCURL = $WCURL$
|
||||
|
||||
# Current system date & time
|
||||
WCNOW = $WCNOW=%Y/%m/%d %H:%M:%S$
|
||||
|
||||
# Lock status, date, owner, and comment for this item
|
||||
WCISLOCKED = $WCISLOCKED?1:0$
|
||||
WCLOCKDATE = $WCLOCKDATE=%Y/%m/%d %H:%M:%S$
|
||||
WCLOCKOWNER = $WCLOCKOWNER$
|
||||
WCLOCKCOMMENT = $WCLOCKCOMMENT$
|
||||
|
||||
# True if local modifications found
|
||||
WCMODS = $WCMODS?1:0$
|
||||
WCMODS_TXT = $WCMODS?(modified):$
|
||||
|
||||
# True if the item is versioned
|
||||
WCINSVN = $WCINSVN?1:0$
|
||||
|
||||
# True if the svn:needs-lock property is set
|
||||
WCNEEDSLOCK = $WCNEEDSLOCK?1:0$
|
@ -5,67 +5,46 @@ TEMPLATE = subdirs
|
||||
# Some Windows packaging magic (for release build only)
|
||||
equals(copydata, 1):win32:CONFIG(release, debug|release) {
|
||||
|
||||
WINX86_PATH = packaging/winx86
|
||||
SVN_INFO_TEMPLATE = svninfo.tpl
|
||||
SVN_INFO_MAKEFILE = svninfo.mk
|
||||
NSIS_TEMPLATE = openpilotgcs.tpl
|
||||
NSIS_HEADER = openpilotgcs.nsh
|
||||
|
||||
# Check for SubWCRev.exe executable required to get some useful SVN repository info.
|
||||
# For example, currently checked out SVN revision (highest for the working copy).
|
||||
# SubWCRev is a part of TortoiseSVN client distribution:
|
||||
# http://tortoisesvn.net/
|
||||
# SubWCRev is also available separately:
|
||||
# http://sourceforge.net/projects/tortoisesvn/files/Tools/1.6.7/SubWCRev-1.6.7.18415.msi/download
|
||||
|
||||
# Default location is TortoiseSVN bin folder.
|
||||
# FIXME: it should try to find in the PATH first, and use hardcoded reference last
|
||||
SUBWCREV_EXE = $$targetPath(\"$$(ProgramFiles)/TortoiseSVN/bin/SubWCRev.exe\")
|
||||
|
||||
exists($$SUBWCREV_EXE) {
|
||||
message("SubWCRev found: $${SUBWCREV_EXE}")
|
||||
svninfo.commands += @echo Copying stubs... $$addNewline()
|
||||
svninfo.commands += $(COPY_FILE)
|
||||
svninfo.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$SVN_INFO_MAKEFILE)
|
||||
svninfo.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$SVN_INFO_MAKEFILE)
|
||||
svninfo.commands += $$addNewline()
|
||||
svninfo.commands += $(COPY_FILE)
|
||||
svninfo.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
svninfo.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
svninfo.commands += $$addNewline()
|
||||
svninfo.commands += @echo Executing $${SUBWCREV_EXE} $$SVN_INFO_TEMPLATE $$SVN_INFO_MAKEFILE $$addNewline()
|
||||
svninfo.commands += -@$$SUBWCREV_EXE $$targetPath($$GCS_SOURCE_TREE)
|
||||
svninfo.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$SVN_INFO_TEMPLATE)
|
||||
svninfo.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$SVN_INFO_MAKEFILE)
|
||||
svninfo.commands += $$addNewline()
|
||||
svninfo.commands += @echo Executing $${SUBWCREV_EXE} $$NSIS_TEMPLATE $$NSIS_HEADER $$addNewline()
|
||||
svninfo.commands += -@$$SUBWCREV_EXE $$targetPath($$GCS_SOURCE_TREE)
|
||||
svninfo.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$NSIS_TEMPLATE)
|
||||
svninfo.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
svninfo.commands += $$addNewline()
|
||||
} else {
|
||||
message("SubWCRev not found, SVN info is not available")
|
||||
svninfo.commands += $(COPY_FILE)
|
||||
svninfo.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$SVN_INFO_MAKEFILE)
|
||||
svninfo.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$SVN_INFO_MAKEFILE)
|
||||
svninfo.commands += $$addNewline()
|
||||
svninfo.commands += $(COPY_FILE)
|
||||
svninfo.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
svninfo.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
svninfo.commands += $$addNewline()
|
||||
# We need this Windows macro since building under Unix-like shell the top level
|
||||
# targetPath macro will use forward slashes which don't work for such Windows
|
||||
# commands like pushd, etc. But note that we still use targetPath for $(COPY_FILE)
|
||||
# parameters because this command is different under native Windows and Unix-like
|
||||
# build environments.
|
||||
defineReplace(winTargetPath) {
|
||||
return($$replace(1, /, \\))
|
||||
}
|
||||
svninfo.target = svninfo.dummy
|
||||
QMAKE_EXTRA_TARGETS += svninfo
|
||||
force.depends += svninfo
|
||||
|
||||
# Some file locations
|
||||
WINX86_PATH = packaging/winx86
|
||||
NSIS_HEADER = openpilotgcs.nsh
|
||||
HEADER_MAKER = make_header.cmd
|
||||
INSTALLER_MAKER = make_installer.cmd
|
||||
|
||||
# copy defaults first (will be used if no git available)
|
||||
git.commands += @echo Copying default version info... $$addNewline()
|
||||
git.commands += $(COPY_FILE)
|
||||
git.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
git.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
git.commands += $$addNewline()
|
||||
|
||||
# extract repository info if command line git is available
|
||||
git.commands += $$winTargetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$HEADER_MAKER)
|
||||
git.commands += $$winTargetPath($$GCS_SOURCE_TREE)
|
||||
git.commands += $$winTargetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
git.commands += $$addNewline()
|
||||
|
||||
git.target = git.dummy
|
||||
QMAKE_EXTRA_TARGETS += git
|
||||
force.depends += git
|
||||
|
||||
# Redefine FORCE target to collect data every time
|
||||
force.target = FORCE
|
||||
QMAKE_EXTRA_TARGETS += force
|
||||
|
||||
# Create installer build target - this WILL NOT run during build, run it by hand
|
||||
message("Run \"make installer\" in $$GCS_BUILD_TREE/$$WINX86_PATH to build Windows installer (Unicode NSIS 2.46+ required)")
|
||||
nsis.target = installer
|
||||
nsis.depends = svninfo
|
||||
nsis.commands += @$$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/Makefile.cmd)
|
||||
message("Run \"make gcs_installer\" in $$GCS_BUILD_TREE/$$WINX86_PATH to build Windows installer (Unicode NSIS 2.46+ required)")
|
||||
nsis.target = gcs_installer
|
||||
nsis.depends = git
|
||||
nsis.commands += @$$winTargetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$INSTALLER_MAKER)
|
||||
QMAKE_EXTRA_TARGETS += nsis
|
||||
}
|
||||
|
@ -8,14 +8,8 @@ DATACOLLECTIONS = dials models pfd sounds diagrams mapicons
|
||||
equals(copydata, 1) {
|
||||
for(dir, DATACOLLECTIONS) {
|
||||
exists($$GCS_SOURCE_TREE/share/openpilotgcs/$$dir) {
|
||||
# remove r/o and hidden attributes from .svn/* files from old build: they prevent copy over with cp -rp
|
||||
win32:data_copy.commands += -@attrib -R -S -H $$targetPath(\"$$GCS_DATA_PATH/$$dir/*\") /S /D >nul 2>&1 $$addNewline()
|
||||
|
||||
macx:data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/\") $$addNewline()
|
||||
!macx:data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline()
|
||||
|
||||
# remove r/o and hidden attributes from .svn/* files: they prevent cleaning with rm -rf
|
||||
win32:data_copy.commands += attrib -R -S -H $$targetPath(\"$$GCS_DATA_PATH/$$dir/*\") /S /D $$addNewline()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user