vcpkg/ports/openal-soft/portfile.cmake

95 lines
3.1 KiB
CMake
Raw Normal View History

2017-07-25 21:05:23 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO kcat/openal-soft
2022-07-07 04:52:09 +08:00
REF dc83d99c95a42c960150ddeee06c124134b52208 # openal-soft-1.22.2
SHA512 3fbbdfbb2609ef8187d20ce74b2fb8082037288f3fd80df71d360705d8efdadfe8f62811af1cd824cb6572c8c3479b370f8ae3819b8b8bb0b20c34f7a73cc530
2017-07-25 21:05:23 +08:00
HEAD_REF master
2018-04-04 08:02:40 +08:00
)
2017-07-25 21:05:23 +08:00
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(OPENAL_LIBTYPE "SHARED")
else()
set(OPENAL_LIBTYPE "STATIC")
endif()
2016-09-19 11:50:08 +08:00
set(ALSOFT_REQUIRE_LINUX OFF)
set(ALSOFT_REQUIRE_WINDOWS OFF)
set(ALSOFT_REQUIRE_APPLE OFF)
if(VCPKG_TARGET_IS_LINUX)
2018-04-27 18:15:17 +08:00
set(ALSOFT_REQUIRE_LINUX ON)
endif()
if(VCPKG_TARGET_IS_WINDOWS)
2018-04-27 18:15:17 +08:00
set(ALSOFT_REQUIRE_WINDOWS ON)
endif()
if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
set(ALSOFT_REQUIRE_APPLE ON)
2018-04-27 18:15:17 +08:00
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
2016-09-19 11:50:08 +08:00
OPTIONS
2017-07-25 21:05:23 +08:00
-DLIBTYPE=${OPENAL_LIBTYPE}
2016-09-19 11:50:08 +08:00
-DALSOFT_UTILS=OFF
-DALSOFT_NO_CONFIG_UTIL=ON
-DALSOFT_EXAMPLES=OFF
-DALSOFT_CONFIG=OFF
-DALSOFT_HRTF_DEFS=OFF
2017-07-25 21:05:23 +08:00
-DALSOFT_AMBDEC_PRESETS=OFF
2018-04-27 18:15:17 +08:00
-DALSOFT_BACKEND_ALSA=${ALSOFT_REQUIRE_LINUX}
2017-07-25 21:05:23 +08:00
-DALSOFT_BACKEND_OSS=OFF
-DALSOFT_BACKEND_SOLARIS=OFF
-DALSOFT_BACKEND_SNDIO=OFF
-DALSOFT_BACKEND_PORTAUDIO=OFF
-DALSOFT_BACKEND_PULSEAUDIO=OFF
-DALSOFT_BACKEND_COREAUDIO=${ALSOFT_REQUIRE_APPLE}
2017-07-25 21:05:23 +08:00
-DALSOFT_BACKEND_JACK=OFF
-DALSOFT_BACKEND_OPENSL=${VCPKG_TARGET_IS_ANDROID}
2017-07-25 21:05:23 +08:00
-DALSOFT_BACKEND_WAVE=ON
-DALSOFT_BACKEND_WINMM=OFF
-DALSOFT_BACKEND_DSOUND=OFF
-DALSOFT_REQUIRE_WASAPI=${ALSOFT_REQUIRE_WINDOWS}
-DALSOFT_CPUEXT_NEON=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_WindowsSDK=ON
MAYBE_UNUSED_VARIABLES
ALSOFT_AMBDEC_PRESETS
ALSOFT_BACKEND_ALSA
ALSOFT_BACKEND_COREAUDIO
ALSOFT_BACKEND_JACK
ALSOFT_BACKEND_OPENSL
ALSOFT_BACKEND_OSS
ALSOFT_BACKEND_PORTAUDIO
ALSOFT_BACKEND_PULSEAUDIO
ALSOFT_BACKEND_SNDIO
ALSOFT_BACKEND_SOLARIS
ALSOFT_CONFIG
ALSOFT_CPUEXT_NEON
ALSOFT_HRTF_DEFS
CMAKE_DISABLE_FIND_PACKAGE_WindowsSDK
2016-09-19 11:50:08 +08:00
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/OpenAL")
2017-07-25 21:05:23 +08:00
foreach(HEADER al.h alc.h)
file(READ "${CURRENT_PACKAGES_DIR}/include/AL/${HEADER}" AL_H)
2017-07-25 21:05:23 +08:00
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "defined(AL_LIBTYPE_STATIC)" "1" AL_H "${AL_H}")
else()
# Normally we would say:
# string(REPLACE "defined(AL_LIBTYPE_STATIC)" "0" AL_H "${AL_H}")
# but we are leaving these undefined macros alone in support of
# https://github.com/microsoft/vcpkg/issues/18098
2017-07-25 21:05:23 +08:00
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/AL/${HEADER}" "${AL_H}")
2017-07-25 21:05:23 +08:00
endforeach()
2016-09-19 11:50:08 +08:00
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
2016-09-19 11:50:08 +08:00
vcpkg_copy_pdbs()