Skip to content

Commit

Permalink
Fix STK rawwave installation in Windows builds (#6705)
Browse files Browse the repository at this point in the history
* Fix STK rawwave path detection and installation
* Use the CMake logic for rawwave installation on Win and Mac
  • Loading branch information
PhysSong authored Jun 24, 2023
1 parent c854663 commit 405738f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
5 changes: 0 additions & 5 deletions cmake/apple/install_apple.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

set -e

# STK rawwaves directory
STK_RAWWAVE=$(brew --prefix stk)/share/stk/rawwaves

# Place to create ".app" bundle
APP="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.app"

Expand All @@ -29,11 +26,9 @@ command cp "@CMAKE_BINARY_DIR@/Info.plist" "@CMAKE_INSTALL_PREFIX@/"
mkdir -p "$APP/Contents/MacOS"
mkdir -p "$APP/Contents/Frameworks"
mkdir -p "$APP/Contents/Resources"
mkdir -p "$APP/Contents/share/stk/rawwaves"
cd "@CMAKE_INSTALL_PREFIX@"
cp -R ./* "$APP/Contents"
cp "@CMAKE_SOURCE_DIR@/cmake/apple/"*.icns "$APP/Contents/Resources/"
cp "$STK_RAWWAVE"/*.raw "$APP/Contents/share/stk/rawwaves" > /dev/null 2>&1

# Make all libraries writable for macdeployqt
cd "$APP"
Expand Down
10 changes: 10 additions & 0 deletions cmake/install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ IF(LMMS_BUILD_WIN32 OR LMMS_INSTALL_DEPENDENCIES)
)
ENDIF()

# Install STK rawwaves
if(LMMS_HAVE_STK AND (LMMS_BUILD_WIN32 OR LMMS_BUILD_APPLE))
if(STK_RAWWAVE_ROOT)
file(GLOB RAWWAVES "${STK_RAWWAVE_ROOT}/*.raw")
install(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves")
else()
message(WARNING "Can't find STK rawwave root!")
endif()
endif()

IF(LMMS_BUILD_APPLE)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND chmod u+x ${CMAKE_BINARY_DIR}/install_apple.sh)")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_BINARY_DIR}/install_apple.sh)")
Expand Down
7 changes: 7 additions & 0 deletions cmake/modules/FindSTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ else()
endif()
endif()

# find STK rawwave path
find_path(STK_RAWWAVE_ROOT
NAMES silence.raw sinewave.raw
HINTS "${STK_INCLUDE_DIR}/.."
PATH_SUFFIXES share/stk/rawwaves share/libstk/rawwaves
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(STK
REQUIRED_VARS STK_LIBRARY STK_INCLUDE_DIR
Expand Down
6 changes: 0 additions & 6 deletions cmake/nsis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ SET(CPACK_NSIS_MUI_ICON "${CPACK_NSIS_MUI_ICON}" PARENT_SCOPE)
CONFIGURE_FILE("lmms.rc.in" "${CMAKE_BINARY_DIR}/lmms.rc")
CONFIGURE_FILE("zynaddsubfx.rc.in" "${CMAKE_BINARY_DIR}/plugins/ZynAddSubFx/zynaddsubfx.rc")

IF(LMMS_HAVE_STK)
FILE(GLOB RAWWAVES "${MINGW_PREFIX}/share/stk/rawwaves/*.raw")
LIST(SORT RAWWAVES)
INSTALL(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves")
ENDIF()

INSTALL(FILES "lmms.exe.manifest" DESTINATION .)
INSTALL(FILES "lmms.VisualElementsManifest.xml" DESTINATION .)
INSTALL(DIRECTORY "assets" DESTINATION .)

0 comments on commit 405738f

Please sign in to comment.