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
86 changes: 56 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,34 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# General build options
option(ENABLE_SYSTEM_GLM "Enable use of system-install GLM library" OFF)
option(ENABLE_SYSTEM_PROJECTM_EVAL "Enable use of a system-installed/external projectM-eval library" ON)
option(ENABLE_DEBUG_POSTFIX "Add \"d\" (by default) after library names for debug builds." ON)
option(ENABLE_PLAYLIST "Enable building the playlist management library" ON)
option(ENABLE_BOOST_FILESYSTEM "Force the use of boost::filesystem, even if the compiler supports C++17." OFF)
option(ENABLE_SDL_UI "Build the SDL2-based developer test UI. Ignored when building with Emscripten or for Android." OFF)

option(BUILD_TESTING "Build the libprojectM test suite" OFF)
option(BUILD_DOCS "Build documentation" OFF)

# Enable vcpkg manifest features according to the build options set
if(ENABLE_SYSTEM_GLM)
list(APPEND VCPKG_MANIFEST_FEATURES external-glm)
endif()
if(ENABLE_SYSTEM_PROJECTM_EVAL)
list(APPEND VCPKG_MANIFEST_FEATURES external-evallib)
endif()
if(ENABLE_BOOST_FILESYSTEM)
list(APPEND VCPKG_MANIFEST_FEATURES boost-filesystem)
endif()
if(ENABLE_SDL_UI)
list(APPEND VCPKG_MANIFEST_FEATURES gui)
endif()
if(BUILD_TESTING)
list(APPEND VCPKG_MANIFEST_FEATURES test)
endif()

if(ENABLE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Output file debug postfix. Default is \"d\".")
endif()
Expand Down Expand Up @@ -65,16 +92,10 @@ else()
set(ENABLE_EMSCRIPTEN OFF CACHE BOOL "Build for web with emscripten. Requires emscripten toolset for building." FORCE)
endif()

# Feature options, including dependencies.
option(BUILD_TESTING "Build the libprojectM test suite" OFF)
# Compiler-/system-dependent options, including dependencies.
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)
option(ENABLE_PLAYLIST "Enable building the playlist management library" ON)
cmake_dependent_option(ENABLE_SDL_UI "Build the SDL2-based developer test UI" OFF "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)
option(ENABLE_BOOST_FILESYSTEM "Force the use of boost::filesystem, even if the compiler supports C++17." OFF)
cmake_dependent_option(ENABLE_INSTALL "Enable installing projectM libraries and headers." OFF "NOT PROJECT_IS_TOP_LEVEL" ON)
option(ENABLE_SYSTEM_GLM "Enable use of system-install GLM library" OFF)
option(BUILD_DOCS "Build documentation" 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 All @@ -83,6 +104,10 @@ if(ENABLE_SYSTEM_GLM)
find_package(GLM REQUIRED)
endif()

if(ENABLE_SYSTEM_PROJECTM_EVAL)
find_package(projectM-Eval)
endif()

if(NOT BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Add "lib" in front of static library files to allow installing both shared and static libs in the same dir.
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
Expand Down Expand Up @@ -217,46 +242,47 @@ message(STATUS "")
message(STATUS "libprojectM v${PROJECT_VERSION}")
message(STATUS "==============================================")
message(STATUS "")
message(STATUS " prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS " libdir: ${PROJECTM_LIB_DIR}")
message(STATUS " includedir: ${PROJECTM_INCLUDE_DIR}")
message(STATUS " bindir: ${PROJECTM_BIN_DIR}")
message(STATUS " prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS " libdir: ${PROJECTM_LIB_DIR}")
message(STATUS " includedir: ${PROJECTM_INCLUDE_DIR}")
message(STATUS " bindir: ${PROJECTM_BIN_DIR}")
message(STATUS "")
message(STATUS " compiler: ${CMAKE_CXX_COMPILER}")
message(STATUS " cflags: ${CMAKE_C_FLAGS}")
message(STATUS " cxxflags: ${CMAKE_CXX_FLAGS}")
message(STATUS " ldflags: ${CMAKE_SHARED_LINKER_FLAGS}")
message(STATUS " compiler: ${CMAKE_CXX_COMPILER}")
message(STATUS " cflags: ${CMAKE_C_FLAGS}")
message(STATUS " cxxflags: ${CMAKE_CXX_FLAGS}")
message(STATUS " ldflags: ${CMAKE_SHARED_LINKER_FLAGS}")
message(STATUS "")
message(STATUS "Features:")
message(STATUS "==============================================")
message(STATUS "")
message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}")
message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}")
if(ENABLE_BOOST_FILESYSTEM)
message(STATUS " Filesystem support: Boost")
message(STATUS " Boost version: ${Boost_VERSION}")
message(STATUS " Filesystem support: Boost")
message(STATUS " Boost version: ${Boost_VERSION}")
else()
message(STATUS " Filesystem support: C++17 STL")
message(STATUS " Filesystem support: C++17 STL")
endif()
message(STATUS " SDL2: ${ENABLE_SDL_UI}")
message(STATUS " SDL2: ${ENABLE_SDL_UI}")
if(ENABLE_SDL_UI)
message(STATUS " SDL2 version: ${SDL2_VERSION}")
message(STATUS " SDL2 version: ${SDL2_VERSION}")
endif()
message(STATUS " OpenGL ES: ${ENABLE_GLES}")
message(STATUS " Emscripten: ${ENABLE_EMSCRIPTEN}")
message(STATUS " OpenGL ES: ${ENABLE_GLES}")
message(STATUS " Emscripten: ${ENABLE_EMSCRIPTEN}")
if(CMAKE_SYSTEM_NAME STREQUAL Emscripten)
message(STATUS " - PThreads: ${USE_PTHREADS}")
endif()
message(STATUS " Use system GLM: ${ENABLE_SYSTEM_GLM}")
message(STATUS " Link UI with shared lib: ${ENABLE_SHARED_LINKING}")
message(STATUS " Use system GLM: ${ENABLE_SYSTEM_GLM}")
message(STATUS " Use system projectM-eval: ${ENABLE_SYSTEM_PROJECTM_EVAL}")
message(STATUS " Link UI with shared lib: ${ENABLE_SHARED_LINKING}")
message(STATUS "")
message(STATUS "Targets and applications:")
message(STATUS "==============================================")
message(STATUS "")
message(STATUS " libprojectM: (always built)")
message(STATUS " Playlist library: ${ENABLE_PLAYLIST}")
message(STATUS " SDL2 Test UI: ${ENABLE_SDL_UI}")
message(STATUS " Tests: ${BUILD_TESTING}")
message(STATUS " Documentation: ${BUILD_DOCS}")
message(STATUS " libprojectM: (always built)")
message(STATUS " Playlist library: ${ENABLE_PLAYLIST}")
message(STATUS " SDL2 Test UI: ${ENABLE_SDL_UI}")
message(STATUS " Tests: ${BUILD_TESTING}")
message(STATUS " Documentation: ${BUILD_DOCS}")
message(STATUS "")

if(ENABLE_CXX_INTERFACE)
Expand Down
2 changes: 1 addition & 1 deletion src/sdl-test-ui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(NOT ENABLE_SDL_UI)
if(NOT ENABLE_SDL_UI OR ENABLE_EMSCRIPTEN OR CMAKE_SYSTEM_NAME STREQUAL Android)
return()
endif()

Expand Down
13 changes: 6 additions & 7 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json",
"default-registry": {
"kind": "git",
"baseline": "638b1588be3a265a9c7ad5b212cef72a1cad336a",
"repository": "https://github.com/microsoft/vcpkg"
}
}
"default-registry": {
"kind": "git",
"baseline": "a0f7f5379aa39d638efb1b89ac88a39c1011e4aa",
"repository": "https://github.com/microsoft/vcpkg"
}
}
51 changes: 46 additions & 5 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,49 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"dependencies": [
"glew",
"gtest",
"name": "projectm",
"version": "4.1.2",
"description": "projectM is an open-source project that reimplements the esteemed Winamp Milkdrop by Geiss in a more modern, cross-platform reusable library.",
"homepage": "https://github.com/projectM-visualizer/projectm",
"license": "LGPL-2.1-only",
"dependencies": [
{
"name": "glew",
"platform": "windows"
}
],
"default-features": [
"external-glm",
"external-evallib"
],
"features": {
"external-glm": {
"description": "Use external GLM headers instead of the built-in ones",
"dependencies": [
"glm"
]
},
"external-evallib": {
"description": "Use external projectm-eval library instead of the Git submodule",
"dependencies": [
"projectm-eval"
]
},
"gui": {
"description": "Build a simple, SDL2-based development test UI",
"dependencies": [
"sdl2"
]
]
},
"boost-filesystem": {
"description": "Force using boost::filesystem instead of std::filesystem",
"dependencies": [
"boost-filesystem"
]
},
"test": {
"description": "Build unit tests",
"dependencies": [
"gtest"
]
}
}
}
2 changes: 2 additions & 0 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ if(NOT ENABLE_SYSTEM_GLM)
add_subdirectory(glm)
endif()
add_subdirectory(hlslparser)
if(NOT TARGET projectM::Eval)
add_subdirectory(projectm-eval)
endif()
add_subdirectory(SOIL2)