File tree Expand file tree Collapse file tree 6 files changed +59
-0
lines changed
Expand file tree Collapse file tree 6 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,7 @@ IF(WANT_SUIL)
267267 IF (SUIL_FOUND)
268268 SET (LMMS_HAVE_SUIL TRUE )
269269 SET (STATUS_SUIL "OK" )
270+ find_package (SuilModules)
270271 ELSE ()
271272 SET (STATUS_SUIL "not found, install it or set PKG_CONFIG_PATH appropriately" )
272273 ENDIF ()
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ set(CPACK_PROJECT_NAME "${PROJECT_NAME}" PARENT_SCOPE)
3030set (CPACK_PROJECT_VERSION "${VERSION} " PARENT_SCOPE)
3131set (CPACK_PROJECT_NAME_UCASE "${PROJECT_NAME_UCASE} " PARENT_SCOPE)
3232set (CPACK_PROJECT_URL "${PROJECT_URL} " PARENT_SCOPE)
33+ set (CPACK_SUIL_MODULES "${Suil_MODULES} " PARENT_SCOPE)
34+ set (CPACK_SUIL_MODULES_PREFIX "${Suil_MODULES_PREFIX} " PARENT_SCOPE)
3335
3436if (CMAKE_VERSION VERSION_LESS "3.19" )
3537 message (WARNING "DMG creation requires at least CMake 3.19" )
Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ file(COPY "${CPACK_CURRENT_SOURCE_DIR}/project.icns" DESTINATION "${APP}/Content
6060file (COPY "${CPACK_CURRENT_SOURCE_DIR} /icon.icns" DESTINATION "${APP} /Contents/Resources" )
6161file (RENAME "${APP} /Contents/Resources/icon.icns" "${APP} /Contents/Resources/${lmms} .icns" )
6262
63+ # Copy Suil modules
64+ if (CPACK_SUIL_MODULES)
65+ set (SUIL_MODULES_TARGET "${APP} /Contents/Frameworks/${CPACK_SUIL_MODULES_PREFIX} " )
66+ file (MAKE_DIRECTORY "${SUIL_MODULES_TARGET} " )
67+ file (COPY ${CPACK_SUIL_MODULES} DESTINATION "${SUIL_MODULES_TARGET} " )
68+ endif ()
69+
6370# Make all libraries writable for macdeployqt
6471file (CHMOD_RECURSE "${APP} /Contents" PERMISSIONS
6572 OWNER_EXECUTE OWNER_WRITE OWNER_READ
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ set(CPACK_PROJECT_NAME "${PROJECT_NAME}" PARENT_SCOPE)
3636set (CPACK_PROJECT_NAME_UCASE "${PROJECT_NAME_UCASE} " PARENT_SCOPE)
3737set (CPACK_PROJECT_VERSION "${VERSION} " PARENT_SCOPE)
3838set (CPACK_CMAKE_COMMAND "${CMAKE_COMMAND} " PARENT_SCOPE)
39+ set (CPACK_SUIL_MODULES "${Suil_MODULES} " PARENT_SCOPE)
40+ set (CPACK_SUIL_MODULES_PREFIX "${Suil_MODULES_PREFIX} " PARENT_SCOPE)
3941
4042# TODO: Canidate for DetectMachine.cmake
4143if (IS_X86_64)
Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ foreach(_file ${files})
5959 endif ()
6060endforeach ()
6161
62+ # Copy Suil modules
63+ if (CPACK_SUIL_MODULES)
64+ set (SUIL_MODULES_TARGET "${APP} /usr/lib/${CPACK_SUIL_MODULES_PREFIX} " )
65+ file (MAKE_DIRECTORY "${SUIL_MODULES_TARGET} " )
66+ file (COPY ${CPACK_SUIL_MODULES} DESTINATION "${SUIL_MODULES_TARGET} " )
67+ endif ()
68+
6269# Ensure project's "qmake" executable is first on the PATH
6370get_filename_component (QTBIN "${CPACK_QMAKE_EXECUTABLE} " DIRECTORY )
6471set (ENV{PATH } "${QTBIN} :$ENV{PATH} " )
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2024 Tres Finocchiaro
2+ #
3+ # Redistribution and use is allowed according to the terms of the New BSD license.
4+ # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
5+
6+ # This module defines
7+ # Suil_MODULES: List of full paths to Suil modules (e.g. "/usr/lib/suil-0/libsuil_x11.so;...")
8+ # Suil_MODULES_PREFIX: Only the directory name of the Suil_MODULES path (e.g. "suil-0")
9+
10+ pkg_check_modules(Suil QUIET suil-0)
11+
12+ if (Suil_FOUND)
13+ if (APPLE )
14+ set (_lib_ext "dylib" )
15+ elseif (WIN32 )
16+ set (_lib_ext "dll" )
17+ else ()
18+ set (_lib_ext "so" )
19+ endif ()
20+
21+ # Isolate -- if needed -- the first suil library path (e.g. "/usr/lib/libsuil-0.so")
22+ list (GET Suil_LINK_LIBRARIES 0 _lib)
23+ if (EXISTS "${_lib} " )
24+ # Isolate -- if needed -- the first suil library name (e.g. "suil-0")
25+ list (GET Suil_LIBRARIES 0 _modules_prefix)
26+ get_filename_component (_lib_dir "${_lib} " DIRECTORY )
27+ # Construct modules path (e.g. "/usr/lib/suil-0")
28+ set (_modules_dir "${_lib_dir} /${_modules_prefix} " )
29+ if (IS_DIRECTORY "${_modules_dir} " )
30+ set (Suil_MODULES_PREFIX "${_modules_prefix} " )
31+ file (GLOB Suil_MODULES "${_modules_dir} /*.${_lib_ext} " )
32+ list (SORT Suil_MODULES)
33+ endif ()
34+ endif ()
35+ endif ()
36+
37+ include (FindPackageHandleStandardArgs)
38+ find_package_handle_standard_args(SuilModules
39+ REQUIRED_VARS Suil_MODULES Suil_MODULES_PREFIX
40+ )
You can’t perform that action at this time.
0 commit comments