Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ endif()
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)
cmake_dependent_option(ENABLE_GLES "Enable OpenGL ES support" OFF "NOT ENABLE_EMSCRIPTEN AND NOT CMAKE_SYSTEM_NAME STREQUAL Android" ON)
cmake_dependent_option(ENABLE_INSTALL "Enable installing projectM libraries and headers." OFF "NOT PROJECT_IS_TOP_LEVEL" ON)
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)

# Experimental/unsupported features
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)
Expand Down Expand Up @@ -268,6 +269,7 @@ if(ENABLE_SDL_UI)
message(STATUS " SDL2 version: ${SDL2_VERSION}")
endif()
message(STATUS " OpenGL ES: ${ENABLE_GLES}")
message(STATUS " macOS Framework: ${ENABLE_MACOS_FRAMEWORK}")
message(STATUS " Emscripten: ${ENABLE_EMSCRIPTEN}")
if(CMAKE_SYSTEM_NAME STREQUAL Emscripten)
message(STATUS " - PThreads: ${USE_PTHREADS}")
Expand Down
24 changes: 12 additions & 12 deletions src/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ generate_export_header(projectM_api
set(PROJECTM_PUBLIC_HEADERS
"${PROJECTM_EXPORT_HEADER}"
"${CMAKE_CURRENT_BINARY_DIR}/include/projectM-4/version.h"
include/projectM-4/audio.h
include/projectM-4/callbacks.h
include/projectM-4/core.h
include/projectM-4/debug.h
include/projectM-4/logging.h
include/projectM-4/memory.h
include/projectM-4/parameters.h
include/projectM-4/projectM.h
include/projectM-4/render_opengl.h
include/projectM-4/touch.h
include/projectM-4/types.h
include/projectM-4/user_sprites.h
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/audio.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/callbacks.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/core.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/debug.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/logging.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/memory.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/parameters.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/projectM.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/render_opengl.h"
Comment thread
revmischa marked this conversation as resolved.
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/touch.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/types.h"
"${CMAKE_CURRENT_SOURCE_DIR}/include/projectM-4/user_sprites.h"
)

if(ENABLE_CXX_INTERFACE)
Expand Down
32 changes: 31 additions & 1 deletion src/libprojectM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,35 @@ if(BUILD_SHARED_LIBS)
PUBLIC
${CMAKE_DL_LIBS}
)

if(ENABLE_MACOS_FRAMEWORK)
# Get C API headers from the API target
get_target_property(_framework_public_headers projectM_api PUBLIC_HEADER)

# Add C++ headers when the C++ interface is enabled
if(ENABLE_CXX_INTERFACE)
list(APPEND _framework_public_headers
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/AudioConstants.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/FrameAudioData.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/Loudness.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/MilkdropFFT.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/PCM.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Audio/WaveformAligner.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Renderer/RenderContext.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Logging.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ProjectM.hpp"
Comment thread
revmischa marked this conversation as resolved.
)
endif()

set_target_properties(projectM PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION A
MACOSX_FRAMEWORK_IDENTIFIER com.github.projectm-visualizer.projectM
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_VERSION}"
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PROJECT_VERSION}"
PUBLIC_HEADER "${_framework_public_headers}"
)
endif()
else()
target_compile_definitions(projectM_main
PUBLIC
Expand Down Expand Up @@ -158,7 +187,8 @@ if(ENABLE_INSTALL)
LIBRARY DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Runtime
RUNTIME DESTINATION "${PROJECTM_RUNTIME_DIR}" COMPONENT Runtime
ARCHIVE DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Devel
PUBLIC_HEADER DESTINATION "${PROJECTM_INCLUDE_DIR}/libprojectM" COMPONENT Devel
PUBLIC_HEADER DESTINATION "${PROJECTM_INCLUDE_DIR}/projectM-4" COMPONENT Devel
FRAMEWORK DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Runtime
)

if(ENABLE_CXX_INTERFACE)
Expand Down
11 changes: 11 additions & 0 deletions src/playlist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ if(BUILD_SHARED_LIBS)
PUBLIC
${CMAKE_DL_LIBS}
)

if(ENABLE_MACOS_FRAMEWORK)
set_target_properties(projectM_playlist PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION A
MACOSX_FRAMEWORK_IDENTIFIER com.github.projectm-visualizer.projectM-playlist
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_VERSION}"
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PROJECT_VERSION}"
)
endif()
else()
target_compile_definitions(projectM_playlist_main
PUBLIC
Expand Down Expand Up @@ -111,6 +121,7 @@ if(ENABLE_INSTALL)
RUNTIME DESTINATION "${PROJECTM_RUNTIME_DIR}" COMPONENT Runtime
ARCHIVE DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Devel
PUBLIC_HEADER DESTINATION "${PROJECTM_INCLUDE_DIR}/projectM-4" COMPONENT Devel
FRAMEWORK DESTINATION "${PROJECTM_LIB_DIR}" COMPONENT Runtime
)


Expand Down
Loading