mirror of https://github.com/microsoft/vcpkg.git
[libadlmidi] Fix build with CMake 4.0; update to the latest (#45035)
This commit is contained in:
parent
be94504b99
commit
b65b643e56
|
|
@ -1,25 +0,0 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 271bb9b..37340f9 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -147,8 +147,18 @@ if(NOT EMSCRIPTEN
|
||||
AND NOT NINTENDO_WII
|
||||
AND NOT NINTENDO_WIIU
|
||||
AND NOT ADLMIDI_DOS)
|
||||
- option(libADLMIDI_STATIC "Build static library of libADLMIDI" ON)
|
||||
- option(libADLMIDI_SHARED "Build shared library of libADLMIDI" OFF)
|
||||
+
|
||||
+ set(libADLMIDI_STATIC_ENABLED_BY_DEFAULT ON)
|
||||
+ set(libADLMIDI_SHARED_ENABLED_BY_DEFAULT OFF)
|
||||
+
|
||||
+ # When defined, respect CMake's BUILD_SHARED_LIBS setting
|
||||
+ if (BUILD_SHARED_LIBS)
|
||||
+ set(libADLMIDI_SHARED_ENABLED_BY_DEFAULT ON)
|
||||
+ set(libADLMIDI_STATIC_ENABLED_BY_DEFAULT OFF)
|
||||
+ endif()
|
||||
+
|
||||
+ option(libADLMIDI_STATIC "Build static library of libADLMIDI" ${libADLMIDI_STATIC_ENABLED_BY_DEFAULT})
|
||||
+ option(libADLMIDI_SHARED "Build shared library of libADLMIDI" ${libADLMIDI_SHARED_ENABLED_BY_DEFAULT})
|
||||
else()
|
||||
set(libADLMIDI_STATIC ON)
|
||||
set(libADLMIDI_SHARED OFF)
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 271bb9b..1b6ba8f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -313,7 +313,7 @@ if(libADLMIDI_STATIC OR WITH_VLC_PLUGIN)
|
||||
else()
|
||||
set_target_properties(ADLMIDI_static PROPERTIES OUTPUT_NAME ADLMIDI)
|
||||
endif()
|
||||
- target_include_directories(ADLMIDI_static PUBLIC ${libADLMIDI_SOURCE_DIR}/include)
|
||||
+ target_include_directories(ADLMIDI_static PUBLIC $<BUILD_INTERFACE:${libADLMIDI_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
set_legacy_standard(ADLMIDI_static)
|
||||
set_visibility_hidden(ADLMIDI_static)
|
||||
handle_options(ADLMIDI_static)
|
||||
@@ -336,7 +336,7 @@ if(libADLMIDI_SHARED)
|
||||
VERSION ${libADLMIDI_VERSION}
|
||||
SOVERSION ${libADLMIDI_VERSION_MAJOR}
|
||||
)
|
||||
- target_include_directories(ADLMIDI_shared PUBLIC ${libADLMIDI_SOURCE_DIR}/include)
|
||||
+ target_include_directories(ADLMIDI_shared PUBLIC $<BUILD_INTERFACE:${libADLMIDI_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
set_legacy_standard(ADLMIDI_shared)
|
||||
set_visibility_hidden(ADLMIDI_shared)
|
||||
handle_options(ADLMIDI_shared)
|
||||
@@ -418,22 +418,44 @@ if(WIN32 AND WITH_WINMMDRV)
|
||||
add_subdirectory(utils/winmm_drv)
|
||||
endif()
|
||||
|
||||
-set(libADLMIDI_INSTALLS )
|
||||
-foreach(lib ADLMIDI_static ADLMIDI_shared)
|
||||
- if(TARGET ${lib})
|
||||
- list(APPEND libADLMIDI_INSTALLS ${lib})
|
||||
- endif()
|
||||
-endforeach()
|
||||
+if(libADLMIDI_STATIC)
|
||||
+ install(TARGETS ADLMIDI_static
|
||||
+ EXPORT libADLMIDIStaticTargets
|
||||
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
+
|
||||
+ install(EXPORT libADLMIDIStaticTargets
|
||||
+ FILE libADLMIDI-static-targets.cmake
|
||||
+ NAMESPACE libADLMIDI::
|
||||
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libADLMIDI")
|
||||
+endif()
|
||||
+
|
||||
+if(libADLMIDI_SHARED)
|
||||
+ install(TARGETS ADLMIDI_shared
|
||||
+ EXPORT libADLMIDISharedTargets
|
||||
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
-install(TARGETS ${libADLMIDI_INSTALLS}
|
||||
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
- INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
+ install(EXPORT libADLMIDISharedTargets
|
||||
+ FILE libADLMIDI-shared-targets.cmake
|
||||
+ NAMESPACE libADLMIDI::
|
||||
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libADLMIDI")
|
||||
+endif()
|
||||
|
||||
install(FILES
|
||||
include/adlmidi.h
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
+
|
||||
+include(CMakePackageConfigHelpers)
|
||||
+configure_package_config_file(libADLMIDIConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/libADLMIDIConfig.cmake"
|
||||
+ PATH_VARS CMAKE_INSTALL_PREFIX CMAKE_INSTALL_FULL_BINDIR CMAKE_INSTALL_FULL_INCLUDEDIR CMAKE_INSTALL_FULL_LIBDIR
|
||||
+ INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libADLMIDI"
|
||||
+)
|
||||
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libADLMIDIConfig.cmake
|
||||
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libADLMIDI"
|
||||
+)
|
||||
|
||||
file(GLOB DOCTXT_FILES
|
||||
"${libADLMIDI_SOURCE_DIR}/LICENSE*.txt"
|
||||
diff --git a/libADLMIDIConfig.cmake.in b/libADLMIDIConfig.cmake.in
|
||||
new file mode 100644
|
||||
index 0000000..bd875fc
|
||||
--- /dev/null
|
||||
+++ b/libADLMIDIConfig.cmake.in
|
||||
@@ -0,0 +1,30 @@
|
||||
+include(FeatureSummary)
|
||||
+set_package_properties(libADLMIDI PROPERTIES
|
||||
+ URL "https://github.com/Wohlstand/libADLMIDI"
|
||||
+ DESCRIPTION "libADLMIDI is a free Software MIDI synthesizer library with OPL3 emulation"
|
||||
+)
|
||||
+
|
||||
+@PACKAGE_INIT@
|
||||
+
|
||||
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/libADLMIDI-shared-targets.cmake")
|
||||
+ include("${CMAKE_CURRENT_LIST_DIR}/libADLMIDI-shared-targets.cmake")
|
||||
+endif()
|
||||
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/libADLMIDI-static-targets.cmake")
|
||||
+ include("${CMAKE_CURRENT_LIST_DIR}/libADLMIDI-static-targets.cmake")
|
||||
+endif()
|
||||
+
|
||||
+if(TARGET libADLMIDI::ADLMIDI_shared)
|
||||
+ if(CMAKE_VERSION VERSION_LESS "3.18")
|
||||
+ add_library(libADLMIDI::ADLMIDI INTERFACE IMPORTED)
|
||||
+ set_target_properties(libADLMIDI::ADLMIDI PROPERTIES INTERFACE_LINK_LIBRARIES "libADLMIDI::ADLMIDI_shared")
|
||||
+ else()
|
||||
+ add_library(libADLMIDI::ADLMIDI ALIAS libADLMIDI::ADLMIDI_shared)
|
||||
+ endif()
|
||||
+else()
|
||||
+ if(CMAKE_VERSION VERSION_LESS "3.18")
|
||||
+ add_library(libADLMIDI::ADLMIDI INTERFACE IMPORTED)
|
||||
+ set_target_properties(libADLMIDI::ADLMIDI PROPERTIES INTERFACE_LINK_LIBRARIES "libADLMIDI::ADLMIDI_static")
|
||||
+ else()
|
||||
+ add_library(libADLMIDI::ADLMIDI ALIAS libADLMIDI::ADLMIDI_static)
|
||||
+ endif()
|
||||
+endif()
|
||||
|
|
@ -1,30 +1,24 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO Wohlstand/libADLMIDI
|
||||
REF v${VERSION}
|
||||
SHA512 d827f13c60086b62bb4ffb098faeaa214fd83df52d3d5c19533b970d74b470c677e0aec76e91e05753574cf9bae1ccd02b77bd24d0ec1b2ad80b21cf541c7261
|
||||
PATCHES
|
||||
# patches from master, they should be removed when a new version is out
|
||||
cmake-package-export.patch
|
||||
cmake-build-shared-libs-support.patch
|
||||
REF 809f7e0021dbb7a0e5b2f67d54da2298f30a53c3
|
||||
SHA512 9b809ac96d1c1c9088073db3adc78ceb039974022a4937f32b7058bcba68fd3eaf5fb599176861f152cce9da7d079aa00dacdb3d61b66460d679c6d95a235a2f
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
midi-sequencer WITH_MIDI_SEQUENCER
|
||||
embedded-banks WITH_EMBEDDED_BANKS
|
||||
mus WITH_MUS_SUPPORT
|
||||
xmi WITH_XMI_SUPPORT
|
||||
dosbox-emulator USE_DOSBOX_EMULATOR
|
||||
nuked-emulator USE_NUKED_EMULATOR
|
||||
opal-emulator USE_OPAL_EMULATOR
|
||||
java-emulator USE_JAVA_EMULATOR
|
||||
hw-serial USE_HW_SERIAL
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-DUSE_NUKED_OPL2_LLE_EMULATOR=ON
|
||||
-DUSE_NUKED_OPL3_LLE_EMULATOR=ON
|
||||
-DUSE_HW_SERIAL=ON
|
||||
-DWITH_HQ_RESAMPLER=OFF # requires zita-resampler
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"name": "libadlmidi",
|
||||
"version": "1.5.1",
|
||||
"port-version": 1,
|
||||
"version-date": "2025-04-14",
|
||||
"description": "libADLMIDI is a free Software MIDI synthesizer library with OPL3 emulation",
|
||||
"homepage": "https://github.com/Wohlstand/libADLMIDI",
|
||||
"dependencies": [
|
||||
|
|
@ -13,41 +12,5 @@
|
|||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
"dosbox-emulator",
|
||||
"embedded-banks",
|
||||
"java-emulator",
|
||||
"midi-sequencer",
|
||||
"mus",
|
||||
"nuked-emulator",
|
||||
"opal-emulator",
|
||||
"xmi"
|
||||
],
|
||||
"features": {
|
||||
"dosbox-emulator": {
|
||||
"description": "Build with DosBox 0.74 OPL3 emulator (well-accurate and fast)"
|
||||
},
|
||||
"embedded-banks": {
|
||||
"description": "Build with embedded banks"
|
||||
},
|
||||
"java-emulator": {
|
||||
"description": "Build with Java OPL3 emulator (semi-accurate)"
|
||||
},
|
||||
"midi-sequencer": {
|
||||
"description": "Build with embedded MIDI sequencer"
|
||||
},
|
||||
"mus": {
|
||||
"description": "Support for DMX MUS files"
|
||||
},
|
||||
"nuked-emulator": {
|
||||
"description": "Build with Nuked OPL3 emulator (very-accurate, needs more CPU power)"
|
||||
},
|
||||
"opal-emulator": {
|
||||
"description": "Build with Opal OPL3 emulator (innacurate)"
|
||||
},
|
||||
"xmi": {
|
||||
"description": "Support for AIL XMI files"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2214,7 +2214,6 @@ kfr(uwp) = fail # CMake Error: try_run() invoked in cross-compiling mode
|
|||
kissfft[openmp](osx) = feature-fails # No openmp on osx
|
||||
ktx[tools](uwp) = feature-fails # build error. See https://github.com/microsoft/vcpkg/issues/33687
|
||||
lapack-reference[core,cblas,noblas] = options # Cannot built feature 'cblas' together with feature 'noblas'. cblas requires blas.
|
||||
libadlmidi[dosbox-emulator] = options # You have to select at least one emulator
|
||||
libalkimia[tools](linux) = feature-fails # link errors. See https://github.com/microsoft/vcpkg/issues/32361
|
||||
libcanberra[core] = combination-fails # configure: error: *** No backend enabled. ***
|
||||
libcanberra[core](osx) = combination-fails # see https://github.com/microsoft/vcpkg/issues/31032
|
||||
|
|
|
|||
|
|
@ -4369,8 +4369,8 @@
|
|||
"port-version": 1
|
||||
},
|
||||
"libadlmidi": {
|
||||
"baseline": "1.5.1",
|
||||
"port-version": 1
|
||||
"baseline": "2025-04-14",
|
||||
"port-version": 0
|
||||
},
|
||||
"libadwaita": {
|
||||
"baseline": "1.3.2",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "21f80fae357f6c6290b292cbbbadee245aa5c9c8",
|
||||
"version-date": "2025-04-14",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "5cbc0a9338616c735a4cf4d8ccc2b4c81ccc61c5",
|
||||
"version": "1.5.1",
|
||||
|
|
|
|||
Loading…
Reference in New Issue