Improved Mac OS packaging + fixed compiler warnings

- Generated Mac OS compatible icon
  - ```sips -s format icns CasterSoundboard.png --out CasterSoundboard.icns```
- Updated CasterSoundboard.pro
  - App bundle installs in ~/Applications by default
  - Use previously generated icon in bundle
- Fix "using integer absolute value function 'abs' when argument is of floating point type"
  - switched to cmath lib and import abs function
- Fix "variable 'h' is used uninitialized whenever switch default is taken"
  - switch default sets h to 0
This commit is contained in:
Stephen J Radachy 2017-05-28 19:19:09 -05:00
parent d9fb86bae6
commit 20b9701b60
3 changed files with 22 additions and 5 deletions

View File

@ -21,9 +21,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "CSS.h"
#include <math.h>
#include <cmath>
#include <QString>
using std::abs;
QString Generate_CSS(HSL_C hsl_color)
{
RGB_C rgb_color = RGB_C(0,0,0);
@ -270,6 +272,7 @@ HSL_C::HSL_C(RGB_C rgb_color)
h = 60 * ( ( r - g ) / d + 4.0 );
break;
default:
h = 0.0;
break;
}
}

View File

@ -4,11 +4,21 @@
#
#-------------------------------------------------
isEmpty(PREFIX) {
PREFIX = /usr/local
linux {
isEmpty(PREFIX) {
PREFIX = /usr/local
}
BINDIR = $$PREFIX/bin
DATADIR = $$PREFIX/share
}
macx {
isEmpty(PREFIX) {
PREFIX = ~
}
BINDIR = $$PREFIX/Applications
DATADIR = $$PREFIX/Library/Application\ Support/CasterSoundboard
}
BINDIR = $$PREFIX/bin
DATADIR = $$PREFIX/share
CONFIG += c++11
QT += core gui multimedia network
@ -144,5 +154,9 @@ linux {
INSTALLS += appdata desktop pixmap
}
macx {
ICON = ../dist/macos/CasterSoundboard.icns
}
target.path = $$BINDIR
INSTALLS += target

BIN
dist/macos/CasterSoundboard.icns vendored Normal file

Binary file not shown.