Skip to content

Commit

Permalink
Force qt55 macdeployqt if available
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Dec 4, 2016
1 parent 3ee60b2 commit fc89997
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 65 deletions.
38 changes: 27 additions & 11 deletions cmake/apple/install_apple.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
#=========================================================================================
# STK rawwaves directory
STK_RAWWAVE=$HOME/stk-*/rawwaves

if [ ! -d "$STK_RAWWAVE" ]; then
STK_RAWWAVE=$(brew --prefix stk)/share/stk/rawwaves

This comment has been minimized.

Copy link
@tresf

tresf Dec 4, 2016

Author Owner

Turns out we weren't copying these after the switch from MacPorts to Homebrew. Whoops. It'll now fallback to the homebrew copy, which should have automatically downloaded with brew install stk.

fi


# Place to create ".app" bundle
APP="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.app"
Expand All @@ -24,17 +29,28 @@ MSG_COLOR='\x1B[1;36m'
COLOR_RESET='\x1B[0m'
echo -e "$MSG_COLOR\n\nCreating App Bundle \"$APP\"...$COLOR_RESET"

# Locate macdeployqt, assume homebrew & Qt5
which macdeployqt > /dev/null 2>&1
if [ $? -ne 0 ]; then
brew --prefix qt55 > /dev/null 2>&1
if [ $? -eq 0 ]; then
# Prefer Qt 5.5 (QTBUG-53533)
export PATH=$PATH:$(brew --prefix qt55)/bin
else
# Fallback Qt 5.6+
export PATH=$PATH:$(brew --prefix qt5)/bin
fi
# Explicitly use qt55 macdeployqt if available
brew --prefix qt5 > /dev/null 2>&1 && brew --prefix qt55 > /dev/null 2>&1
if [ $? -eq 0 ]; then
# Capture exact library locations for qt5, qt55
prefix5=$(brew --prefix qt5)
prefix55=$(brew --prefix qt55)
# Force english locale for reliable parsing
export LANG=C
# Get exact Qt versions installed, e.g. "5.5.1", "5.7.0", etc.
ver5=$prefix5$($prefix5/bin/qmake --version |awk -F' ' 'NR==2{print $4}')
ver55=$prefix55$($prefix55/bin/qmake --version |awk -F' ' 'NR==2{print $4}')
# Copy and re-link qt55 macdeployqt tool
echo "Copying $prefix55/bin/macdeployqt to @CMAKE_BINARY_DIR@..."
\cp "$prefix55/bin/macdeployqt" "@CMAKE_BINARY_DIR@"
chmod u+w "@CMAKE_BINARY_DIR@/macdeployqt"
install_name_tool -change "$ver55/lib/QtGui.framework/Versions/5/QtGui" "$ver5/lib/QtGui.framework/Versions/5/QtGui" "@CMAKE_BINARY_DIR@/macdeployqt"
install_name_tool -change "$ver55/lib/QtCore.framework/Versions/5/QtCore" "$ver5/lib/QtCore.framework/Versions/5/QtCore" "@CMAKE_BINARY_DIR@/macdeployqt"
echo "Adding @CMAKE_BINARY_DIR@ to PATH for macdeployqt workaround"
export PATH=@CMAKE_BINARY_DIR@:$PATH
else
# Fallback qt5
brew --prefix qt5 && export PATH=$(brew --prefix qt5)/bin:$PATH > /dev/null 2>&1
fi

# MacPorts only - check for u+w permissions on libreadline
Expand Down
7 changes: 7 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

# Enable C++11

This comment has been minimized.

Copy link
@tresf

tresf Dec 4, 2016

Author Owner

This sets C++11 for all plugins by default. To remove it as a build directive, just use REMOVE_DEFINITIONS(-std=c++0x), which has already been done for LadspaEffect, opl2. Note, the entire project can have this defined one level higher at the root /CMakeLists.txt and then removed from plugins and src after some testing.

ADD_DEFINITIONS(-std=c++0x)

IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()

INCLUDE_DIRECTORIES(
${SAMPLERATE_INCLUDE_DIRS}
)
Expand Down
7 changes: 0 additions & 7 deletions plugins/GigPlayer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ if(LMMS_HAVE_GIG)
add_definitions(${GCC_GIG_COMPILE_FLAGS})
endif(LMMS_BUILD_WIN32)

# Enable C++11
ADD_DEFINITIONS(-std=c++0x)

IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()

LINK_DIRECTORIES(${GIG_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS})
LINK_LIBRARIES(${GIG_LIBRARIES} ${SAMPLERATE_LIBRARIES})
BUILD_PLUGIN(gigplayer GigPlayer.cpp GigPlayer.h PatchesDialog.cpp PatchesDialog.h PatchesDialog.ui MOCFILES GigPlayer.h PatchesDialog.h UICFILES PatchesDialog.ui EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
Expand Down
3 changes: 3 additions & 0 deletions plugins/LadspaEffect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
INCLUDE(BuildPlugin)

# Disable C++11
REMOVE_DEFINITIONS(-std=c++0x)

BUILD_PLUGIN(ladspaeffect LadspaEffect.cpp LadspaControls.cpp LadspaControlDialog.cpp LadspaSubPluginFeatures.cpp LadspaEffect.h LadspaControls.h LadspaControlDialog.h LadspaSubPluginFeatures.h MOCFILES LadspaEffect.h LadspaControls.h LadspaControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")

SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ladspa")
Expand Down
6 changes: 3 additions & 3 deletions plugins/LadspaEffect/calf/src/modules_eq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ float equalizerNband_audio_module<BaseClass, use_hplp>::freq_gain(int index, dou
return ret;
}

template class equalizerNband_audio_module<equalizer5band_metadata, false>;
template class equalizerNband_audio_module<equalizer8band_metadata, true>;
template class equalizerNband_audio_module<equalizer12band_metadata, true>;
template class calf_plugins::equalizerNband_audio_module<equalizer5band_metadata, false>;
template class calf_plugins::equalizerNband_audio_module<equalizer8band_metadata, true>;
template class calf_plugins::equalizerNband_audio_module<equalizer12band_metadata, true>;

7 changes: 0 additions & 7 deletions plugins/MidiExport/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
INCLUDE(BuildPlugin)

# Enable C++11
ADD_DEFINITIONS(-std=c++0x)

IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()

BUILD_PLUGIN(midiexport MidiExport.cpp MidiExport.h MidiFile.hpp
MOCFILES MidiExport.h)
7 changes: 0 additions & 7 deletions plugins/VstEffect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ ELSE()
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_DIR}")
ENDIF()

# Enable C++11
ADD_DEFINITIONS(-std=c++0x)

IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()

BUILD_PLUGIN(vsteffect VstEffect.cpp VstEffectControls.cpp VstEffectControlDialog.cpp VstSubPluginFeatures.cpp VstEffect.h VstEffectControls.h VstEffectControlDialog.h VstSubPluginFeatures.h MOCFILES VstEffectControlDialog.h VstEffectControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
SET_TARGET_PROPERTIES(vsteffect PROPERTIES COMPILE_FLAGS "-Wno-attributes")
TARGET_LINK_LIBRARIES(vsteffect -lvstbase)
Expand Down
3 changes: 0 additions & 3 deletions plugins/carlabase/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
if(LMMS_HAVE_CARLA)
# Enable C++11
ADD_DEFINITIONS(-std=c++0x)

INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS})
LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS})
Expand Down
7 changes: 0 additions & 7 deletions plugins/lb302/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
INCLUDE(BuildPlugin)

# Enable C++11
ADD_DEFINITIONS(-std=c++0x)

IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()

BUILD_PLUGIN(lb302 lb302.cpp lb302.h MOCFILES lb302.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
8 changes: 2 additions & 6 deletions plugins/opl2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
INCLUDE(BuildPlugin)

# Enable C++11
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")

IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()
# Disable C++11
REMOVE_DEFINITIONS(-std=c++0x)

BUILD_PLUGIN(OPL2 opl2instrument.cpp opl2instrument.h opl.h fmopl.c fmopl.h temuopl.cpp temuopl.h MOCFILES opl2instrument.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
3 changes: 0 additions & 3 deletions plugins/sf2_player/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
if(LMMS_HAVE_FLUIDSYNTH)
# Enable C++11
ADD_DEFINITIONS(-std=c++0x)

INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(${FLUIDSYNTH_INCLUDE_DIRS} ${SAMPLERATE_INCLUDE_DIRS})
LINK_DIRECTORIES(${FLUIDSYNTH_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS})
Expand Down
7 changes: 0 additions & 7 deletions plugins/vestige/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
IF(LMMS_SUPPORT_VST)
# Enable C++11
ADD_DEFINITIONS(-std=c++0x)

IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()

INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../vst_base")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/..")
Expand Down
4 changes: 0 additions & 4 deletions plugins/zynaddsubfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-d

# Enable C++11, but only for ZynAddSubFx.cpp
set_property(SOURCE ZynAddSubFx.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " -std=c++0x ")

IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()

# link system-libraries when on win32
IF(LMMS_BUILD_WIN32)
Expand Down

0 comments on commit fc89997

Please sign in to comment.