Set additional compile flag
Fix FindLdap.cmake for OSX
Fix DMG creation (sometimes fails if no volume size is provided)
Closes GH-304.
sudo: required
dist: trusty
sudo: required
dist: trusty
+ include:
+ - os: osx
+ compiler: gcc
+ env: QT_VERSION=qt5
exclude:
- compiler: clang
env: QT_VERSION=qt4
exclude:
- compiler: clang
env: QT_VERSION=qt4
- - os: osx
- compiler: clang
- - os: osx
- env: QT_VERSION=qt4
install: |-
if [ "$TRAVIS_OS_NAME" == "linux" ]
install: |-
if [ "$TRAVIS_OS_NAME" == "linux" ]
make
elif [ "$TRAVIS_OS_NAME" == "osx" ]
then
make
elif [ "$TRAVIS_OS_NAME" == "osx" ]
then
+ PATH=$PATH:/usr/local/opt/qt5/bin
if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]
then
if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]
then
- PATH=$PATH:/usr/local/opt/qt5/bin
- # The LDAP headers found in OSX Frameworks seem to be broken
- cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DDEPLOY=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DLDAP_INCLUDE_DIR=/usr/include/
+ cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DDEPLOY=ON
- cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 -DLDAP_INCLUDE_DIR=/usr/include/
+ cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release
# Attempt to link against ldap.h regardless of platform!
FIND_PATH(LDAP_INCLUDE_DIR ldap.h)
# Attempt to link against ldap.h regardless of platform!
FIND_PATH(LDAP_INCLUDE_DIR ldap.h)
+
+# If we detect path to invalid ldap.h on osx, try /usr/include/
+# This might also be achievable with additional parameters to FIND_PATH.
+string(TOLOWER ${LDAP_INCLUDE_DIR} ldapincludelower)
+if("${ldapincludelower}" MATCHES "\\/system\\/library\\/frameworks\\/ldap\\.framework\\/headers")
+ set(LDAP_INCLUDE_DIR "/usr/include/")
+endif()
+
FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap)
FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap)
+
+# On osx remove invalid ldap.h
+string(TOLOWER ${LDAP_LIBRARIES} ldaplower)
+if("${ldaplower}" MATCHES "\\/system\\/library\\/frameworks\\/ldap\\.framework")
+ set(LDAP_LIBRARIES FALSE)
+endif()
+
FIND_LIBRARY(LBER_LIBRARIES NAMES lber)
# It'd be nice to link against winldap on Windows, unfortunately
FIND_LIBRARY(LBER_LIBRARIES NAMES lber)
# It'd be nice to link against winldap on Windows, unfortunately
# Mac build stuff
if (APPLE AND DEPLOY)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
# Mac build stuff
if (APPLE AND DEPLOY)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9")
- set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9 -stdlib=libc++")
-hdiutil create -srcfolder ${PACKAGETMPDIR} -format UDBZ -volname "Quassel ${BUILDTYPE} - ${QUASSEL_VERSION}" "${WORKINGDIR}${QUASSEL_DMG}" >/dev/null
+PACKAGESIZE=$(echo "$(du -ms ${PACKAGETMPDIR} | cut -f1) * 1.1" | bc)
+hdiutil create -srcfolder ${PACKAGETMPDIR} -format UDBZ -size ${PACKAGESIZE}M -volname "Quassel ${BUILDTYPE} - ${QUASSEL_VERSION}" "${WORKINGDIR}${QUASSEL_DMG}" >/dev/null