Skip to content

Commit

Permalink
vcpkg improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 authored and coelckers committed Aug 23, 2023
1 parent 0a7dc86 commit 1d5e344
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
cmake_minimum_required(VERSION 3.13...3.19)

if (VCPKG_LIBSNDFILE)
list(APPEND VCPKG_MANIFEST_FEATURES "vcpkg-libsndfile")
endif()

project(ZMusic
VERSION 1.1.12
LANGUAGES C CXX
Expand All @@ -8,6 +13,8 @@ if (VCPKG_TOOLCHAIN)
if(VCPKG_TARGET_TRIPLET MATCHES "-static$")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

option(VCPKG_LIBSNDFILE "Import libsndfile from vcpkg" OFF)
endif()

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
Expand Down
4 changes: 4 additions & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
)

if (VCPKG_TOOLCHAIN)
x_vcpkg_install_local_dependencies(TARGETS zmusic zmusiclite DESTINATION ".")
endif()

if(ZMUSIC_INSTALL)
install(TARGETS zmusic EXPORT ZMusicFullTargets
PUBLIC_HEADER
Expand Down
6 changes: 5 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
"description": "GZDoom's music system as a standalone library",
"features":
{
"vcpkg-libsndfile":
{
"description": "Use libsndfile provided by vcpkg.",
"dependencies": [
"dependencies":
[
{
"name": "libsndfile",
"default-features": false,
"features": [ "mpeg", "external-libs" ]
}
]
}
},
"dependencies": [
{
Expand Down

0 comments on commit 1d5e344

Please sign in to comment.