Skip to content

Commit

Permalink
Updated support for windows build + installer (#396)
Browse files Browse the repository at this point in the history
Added win32build.bat batch file for easy windows builds (need to update QT path variables inside to correct ones in case it does not work)
  • Loading branch information
alkaes authored Jan 31, 2021
1 parent b7369c4 commit 8b0a24d
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ endif()

IF (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
else()
set(CMAKE_WIN32_EXECUTABLE ON)
set(GUI_TYPE WIN32)
set(CMAKE_BUILD_TYPE "Release")
### Embedd Icon to Plotjuggler.exe
set(BACKWARD_ENABLE ${BACKWARD_ENABLE} ../../Plotjuggler.rc)
ENDIF()

find_package(ZMQ)
Expand Down
1 change: 1 addition & 0 deletions Plotjuggler.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "plotjuggler.ico"
14 changes: 8 additions & 6 deletions installer/config.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>PlotJuggler</Name>
<Version>2.1.4</Version>
<Title>PlotJuggler installer</Title>
<Publisher>Davide Faconti</Publisher>
<StartMenuDir>Applications</StartMenuDir>
<TargetDir>@ApplicationsDir@/PlotJuggler</TargetDir>
<Name>PlotJuggler</Name>
<Version>3.0.7</Version>
<Title>PlotJuggler installer</Title>
<Publisher>Davide Faconti</Publisher>
<StartMenuDir>PlotJuggler</StartMenuDir>
<TargetDir>@ApplicationsDirX64@/PlotJuggler</TargetDir>
<DependsOnLocalInstallerBinary>true</DependsOnLocalInstallerBinary>
<RunProgram>@TargetDir@/PlotJuggler</RunProgram>
</Installer>

6 changes: 6 additions & 0 deletions installer/io.plotjuggler.application/meta/installscript.qs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ Component.prototype.createOperations = function()
try {
// call the base create operations function
component.createOperations();
if (systemInfo.productType === "windows") {
component.addOperation("CreateShortcut", "@TargetDir@/PlotJuggler.exe", "@StartMenuDir@/PlotJuggler.lnk",
"workingDirectory=@TargetDir@", "iconId=0", "description=Launch PlotJuggler");
component.addOperation("CreateShortcut", "@TargetDir@/PlotJuggler.exe", "@DesktopDir@/PlotJuggler.lnk",
"workingDirectory=@TargetDir@", "iconId=0", "description=Launch PlotJuggler");
}
} catch (e) {
console.log(e);
}
Expand Down
4 changes: 2 additions & 2 deletions installer/io.plotjuggler.application/meta/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Package>
<DisplayName>PlotJuggler Main App</DisplayName>
<Description>Install PlotJuggler with basic plugins.</Description>
<Version>2.1.5</Version>
<ReleaseDate>2019-02-25</ReleaseDate>
<Version>3.0.7</Version>
<ReleaseDate>2021-01-28</ReleaseDate>
<Licenses>
<License name="LGPL" file="license.txt" />
</Licenses>
Expand Down
Binary file added plotjuggler.ico
Binary file not shown.
63 changes: 63 additions & 0 deletions win32build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@echo off
cd %~dp0
SET MINGW_PATH=C:/Qt/Tools/mingw730_64/bin
SET CMAKE_PATH=C:/Qt/Tools/CMake_64/bin
SET CMAKE_PREFIX_PATH=C:/Qt/5.12.10/mingw73_64
SET PATH=%MINGW_PATH%;%CMAKE_PATH%;%PATH%
SET CMAKE_C_COMPILER=%MINGW_PATH%/gcc.exe
SET CMAKE_CXX_COMPILER=%MINGW_PATH%/g++.exe

CLS
:MENU
CLS

ECHO == PLOTJUGGLER BUILDER FOR WINDOWS ==
ECHO -------------------------------------
ECHO 1. COMPILE
ECHO 2. CREATE INSTALLER
ECHO 3. CLEAR BULD FOLDER
ECHO -------------------------------------
ECHO ==========PRESS 'Q' TO QUIT==========
ECHO.

SET INPUT=
SET /P INPUT=Please select a number:

IF /I '%INPUT%'=='1' GOTO Selection1
IF /I '%INPUT%'=='2' GOTO Selection2
IF /I '%INPUT%'=='3' GOTO Selection3
IF /I '%INPUT%'=='Q' GOTO Quit

CLS
GOTO MENU

:Selection1
mkdir build
cd build
cmake -S ".." -G "MinGW Makefiles"
make -j -l 8
PAUSE
GOTO MENU

:Selection2
RMDIR /S /Q %~dp0\installer\io.plotjuggler.application\data
%CMAKE_PREFIX_PATH%\bin\windeployqt.exe --release --dir %~dp0\installer\io.plotjuggler.application\data %~dp0\build\bin\PlotJuggler.exe
xcopy %~dp0\build\bin\*.* %~dp0\installer\io.plotjuggler.application\data /Y /S /f /z
C:\Qt\Tools\QtInstallerFramework\4.0\bin\binarycreator.exe --offline-only -c %~dp0\installer\config.xml -p %~dp0\installer %~dp0\PlotJugglerInstaller.exe
PAUSE
GOTO MENU

:Selection3
RMDIR /S /Q build
PAUSE
GOTO MENU

:Quit
CLS

ECHO ==============THANKYOU===============
ECHO -------------------------------------
ECHO ======PRESS ANY KEY TO CONTINUE======

PAUSE>NUL
EXIT

0 comments on commit 8b0a24d

Please sign in to comment.