Skip to content

Commit 39ab12c

Browse files
authored
Merge branch 'master' into feature/texture-callback-870
2 parents 241c279 + 67c7564 commit 39ab12c

4 files changed

Lines changed: 56 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ endif()
9797
cmake_dependent_option(BUILD_SHARED_LIBS "Build and install libprojectM as a shared libraries. If OFF, builds as static libraries." ON "NOT ENABLE_EMSCRIPTEN" OFF)
9898
cmake_dependent_option(ENABLE_GLES "Enable OpenGL ES support" OFF "NOT ENABLE_EMSCRIPTEN AND NOT CMAKE_SYSTEM_NAME STREQUAL Android" ON)
9999
cmake_dependent_option(ENABLE_INSTALL "Enable installing projectM libraries and headers." OFF "NOT PROJECT_IS_TOP_LEVEL" ON)
100+
cmake_dependent_option(ENABLE_MACOS_FRAMEWORK "Build as macOS Framework bundles instead of plain shared libraries." OFF "CMAKE_SYSTEM_NAME STREQUAL Darwin AND BUILD_SHARED_LIBS" OFF)
100101

101102
# Experimental/unsupported features
102103
option(ENABLE_CXX_INTERFACE "Enable exporting C++ symbols for ProjectM and PCM classes, not only the C API. Warning: This is not very portable." OFF)
@@ -268,6 +269,7 @@ if(ENABLE_SDL_UI)
268269
message(STATUS " SDL2 version: ${SDL2_VERSION}")
269270
endif()
270271
message(STATUS " OpenGL ES: ${ENABLE_GLES}")
272+
message(STATUS " macOS Framework: ${ENABLE_MACOS_FRAMEWORK}")
271273
message(STATUS " Emscripten: ${ENABLE_EMSCRIPTEN}")
272274
if(CMAKE_SYSTEM_NAME STREQUAL Emscripten)
273275
message(STATUS " - PThreads: ${USE_PTHREADS}")

src/api/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ generate_export_header(projectM_api
2222
set(PROJECTM_PUBLIC_HEADERS
2323
"${PROJECTM_EXPORT_HEADER}"
2424
"${CMAKE_CURRENT_BINARY_DIR}/include/projectM-4/version.h"
25-
include/projectM-4/audio.h
26-
include/projectM-4/callbacks.h
27-
include/projectM-4/core.h
28-
include/projectM-4/debug.h
29-
include/projectM-4/logging.h
30-
include/projectM-4/memory.h
31-
include/projectM-4/parameters.h
32-
include/projectM-4/projectM.h
33-
include/projectM-4/render_opengl.h
34-
include/projectM-4/touch.h
35-
include/projectM-4/types.h
36-
include/projectM-4/user_sprites.h
25+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/audio.h"
26+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/callbacks.h"
27+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/core.h"
28+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/debug.h"
29+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/logging.h"
30+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/memory.h"
31+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/parameters.h"
32+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/projectM.h"
33+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/render_opengl.h"
34+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/touch.h"
35+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/types.h"
36+
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/user_sprites.h"
3737
)
3838

3939
if(ENABLE_CXX_INTERFACE)

src/libprojectM/CMakeLists.txt

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,35 @@ if(BUILD_SHARED_LIBS)
130130
PUBLIC
131131
${CMAKE_DL_LIBS}
132132
)
133+
134+
if(ENABLE_MACOS_FRAMEWORK)
135+
# Get C API headers from the API target
136+
get_target_property(_framework_public_headers projectM_api PUBLIC_HEADER)
137+
138+
# Add C++ headers when the C++ interface is enabled
139+
if(ENABLE_CXX_INTERFACE)
140+
list(APPEND _framework_public_headers
141+
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/AudioConstants.hpp"
142+
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/FrameAudioData.hpp"
143+
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/Loudness.hpp"
144+
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/MilkdropFFT.hpp"
145+
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/PCM.hpp"
146+
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/WaveformAligner.hpp"
147+
"${CMAKE_CURRENT_SOURCE_DIR}/Renderer/RenderContext.hpp"
148+
"${CMAKE_CURRENT_SOURCE_DIR}/Logging.hpp"
149+
"${CMAKE_CURRENT_SOURCE_DIR}/ProjectM.hpp"
150+
)
151+
endif()
152+
153+
set_target_properties(projectM PROPERTIES
154+
FRAMEWORK TRUE
155+
FRAMEWORK_VERSION A
156+
MACOSX_FRAMEWORK_IDENTIFIER com.github.projectm-visualizer.projectM
157+
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_VERSION}"
158+
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PROJECT_VERSION}"
159+
PUBLIC_HEADER "${_framework_public_headers}"
160+
)
161+
endif()
133162
else()
134163
target_compile_definitions(projectM_main
135164
PUBLIC
@@ -158,7 +187,8 @@ if(ENABLE_INSTALL)
158187
LIBRARY DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Runtime
159188
RUNTIME DESTINATION "${PROJECTM_RUNTIME_DIR}" COMPONENT Runtime
160189
ARCHIVE DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Devel
161-
PUBLIC_HEADER DESTINATION "${PROJECTM_INCLUDE_DIR}/libprojectM" COMPONENT Devel
190+
PUBLIC_HEADER DESTINATION "${PROJECTM_INCLUDE_DIR}/projectM-4" COMPONENT Devel
191+
FRAMEWORK DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Runtime
162192
)
163193

164194
if(ENABLE_CXX_INTERFACE)

src/playlist/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ if(BUILD_SHARED_LIBS)
7878
PUBLIC
7979
${CMAKE_DL_LIBS}
8080
)
81+
82+
if(ENABLE_MACOS_FRAMEWORK)
83+
set_target_properties(projectM_playlist PROPERTIES
84+
FRAMEWORK TRUE
85+
FRAMEWORK_VERSION A
86+
MACOSX_FRAMEWORK_IDENTIFIER com.github.projectm-visualizer.projectM-playlist
87+
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_VERSION}"
88+
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PROJECT_VERSION}"
89+
)
90+
endif()
8191
else()
8292
target_compile_definitions(projectM_playlist_main
8393
PUBLIC
@@ -111,6 +121,7 @@ if(ENABLE_INSTALL)
111121
RUNTIME DESTINATION "${PROJECTM_RUNTIME_DIR}" COMPONENT Runtime
112122
ARCHIVE DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Devel
113123
PUBLIC_HEADER DESTINATION "${PROJECTM_INCLUDE_DIR}/projectM-4" COMPONENT Devel
124+
FRAMEWORK DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Runtime
114125
)
115126

116127

0 commit comments

Comments
 (0)