Skip to content

Commit c4a7f26

Browse files
authored
Merge pull request #25 from Tom94/better-deployment
Improve deployment process
2 parents 802f909 + cfe2af8 commit c4a7f26

File tree

5 files changed

+63
-11
lines changed

5 files changed

+63
-11
lines changed

CMakeLists.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@
33
cmake_minimum_required(VERSION 2.8.3)
44

55
project(tev)
6-
set(VERSION "1.5.dev")
6+
set(TEV_VERSION "1.5")
7+
8+
if (NOT TEV_DEPLOY)
9+
set(TEV_VERSION "${TEV_VERSION}dev")
10+
endif()
11+
12+
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
13+
set(TEV_VERSION "${TEV_VERSION} (64 bit)")
14+
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
15+
set(TEV_VERSION "${TEV_VERSION} (32 bit)")
16+
endif()
717

818
# Set ourselves as the startup project in visual studio.
919
# Not available until cmake 3.6, but doesn't break older versions.
@@ -111,9 +121,9 @@ if (APPLE)
111121
set_target_properties(tev PROPERTIES
112122
MACOSX_BUNDLE TRUE
113123
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist"
114-
MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION}
115-
MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION}
116-
MACOSX_BUNDLE_LONG_VERSION_STRING ${VERSION}
124+
MACOSX_BUNDLE_BUNDLE_VERSION ${TEV_VERSION}
125+
MACOSX_BUNDLE_SHORT_VERSION_STRING ${TEV_VERSION}
126+
MACOSX_BUNDLE_LONG_VERSION_STRING ${TEV_VERSION}
117127
RESOURCE "${RESOURCE_FILES}"
118128
)
119129
endif()
@@ -130,7 +140,7 @@ include_directories(
130140
"${CMAKE_CURRENT_SOURCE_DIR}/include"
131141
)
132142

133-
add_definitions(${NANOGUI_EXTRA_DEFS})
143+
add_definitions(-DTEV_VERSION="${TEV_VERSION}" ${NANOGUI_EXTRA_DEFS})
134144

135145
target_link_libraries(tev ${TEV_LIBS})
136146

resources/screenshot.png

43.2 KB
Loading

scripts/create-dmg.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,23 @@
33
cd "$(dirname ${BASH_SOURCE[0]})"
44

55
echo "Building backwards-compatible tev..."
6-
mkdir build-dmg && cd build-dmg
6+
7+
BUILD_DIR="build-dmg"
8+
9+
mkdir $BUILD_DIR && cd $BUILD_DIR
710
MACOSX_DEPLOYMENT_TARGET=10.9
811
cmake \
912
-DCMAKE_OSX_SYSROOT=/Users/tom94/Projects/MacOSX-SDKs/MacOSX10.9.sdk/ \
1013
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
14+
-DTEV_DEPLOY=1 \
1115
../..
1216
make -j
1317
cd ..
1418

1519
echo "Creating dmg..."
1620
RESULT="../tev.dmg"
1721
test -f $RESULT && rm $RESULT
18-
./create-dmg/create-dmg --window-size 500 300 --icon-size 96 --volname "tev Installer" --app-drop-link 360 105 --icon tev.app 130 105 $RESULT ./build-dmg/tev.app
22+
./create-dmg/create-dmg --window-size 500 300 --icon-size 96 --volname "tev Installer" --app-drop-link 360 105 --icon tev.app 130 105 $RESULT $BUILD_DIR/tev.app
1923

2024
echo "Removing temporary build dir..."
21-
rm -rf build-dmg
25+
rm -rf $BUILD_DIR

scripts/create-exe.bat

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@echo off
2+
3+
set cwd=%cd%
4+
cd /D %~dp0
5+
6+
set DevCmd="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
7+
set MSBuildOptions=/v:m /p:Configuration=Release
8+
set BuildDir64="build-exe-64"
9+
set BuildDir32="build-exe-32"
10+
11+
call %DevCmd%
12+
13+
echo Building 64-bit tev...
14+
mkdir %BuildDir64%
15+
cd %BuildDir64%
16+
cmake -DTEV_DEPLOY=1 -G "Visual Studio 15 2017 Win64" ..\..
17+
msbuild %MSBuildOptions% tev.sln
18+
move "Release\tev.exe" "..\..\tev.exe"
19+
cd ..
20+
rmdir /S /Q %BuildDir64%
21+
22+
echo Building 32-bit tev...
23+
mkdir %BuildDir32%
24+
cd %BuildDir32%
25+
cmake -DTEV_DEPLOY=1 -G "Visual Studio 15 2017" ..\..
26+
msbuild %MSBuildOptions% tev.sln
27+
move "Release\tev.exe" "..\..\tev-32bit.exe"
28+
cd ..
29+
rmdir /S /Q %BuildDir32%
30+
31+
echo Returning to original directory.
32+
cd /D %cwd%
33+
pause

src/HelpWindow.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ HelpWindow::HelpWindow(Widget *parent, function<void()> closeCallback)
126126
Widget* about = tabWidget->createTab("About");
127127
about->setLayout(new GroupLayout{});
128128

129-
auto addText = [](Widget* current, string text) {
129+
auto addText = [](Widget* current, string text, string font = "sans", int fontSize = 18) {
130130
auto row = new Widget{current};
131131
row->setLayout(new BoxLayout{Orientation::Vertical, Alignment::Middle, 0, 10});
132-
new Label{row, text, "sans", 18};
132+
new Label{row, text, font, fontSize };
133133
};
134134

135135
auto addLibrary = [](Widget* current, string name, string license, string desc) {
@@ -148,7 +148,12 @@ HelpWindow::HelpWindow(Widget *parent, function<void()> closeCallback)
148148
row->setHeight(space);
149149
};
150150

151-
addSpacer(about, 20);
151+
addSpacer(about, 15);
152+
153+
addText(about, "tev — The EXR Viewer", "sans-bold", 46);
154+
addText(about, "version " TEV_VERSION, "sans", 26);
155+
156+
addSpacer(about, 60);
152157

153158
addText(about, "tev was developed by Thomas Müller and is released under the BSD 3-Clause License.");
154159
addText(about, "It was built directly or indirectly upon the following amazing third-party libraries.");

0 commit comments

Comments
 (0)