cmake: search for miles import library

This commit is contained in:
Anonymous Maarten 2021-01-03 16:30:45 +01:00 committed by shfil
parent 8d0b4ede68
commit e9adfd8663
5 changed files with 46 additions and 11 deletions

34
cmake/FindMilesSDK.cmake Normal file
View file

@ -0,0 +1,34 @@
# - Find Miles SDK
# Find the Miles SDK header + import library
#
# MilesSDK_INCLUDE_DIR - Where to find mss.h
# MilesSDK_LIBRARIES - List of libraries when using MilesSDK.
# MilesSDK_FOUND - True if Miles SDK found.
# MilesSDK::MilesSDK - Imported library of Miles SDK
find_path(MilesSDK_INCLUDE_DIR mss.h
PATHS "${MilesSDK_DIR}"
PATH_SUFFIXES include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_miles_sdk_libname mss64)
else()
set(_miles_sdk_libname mss32)
endif()
find_library(MilesSDK_LIBRARIES NAMES ${_miles_sdk_libname}
PATHS "${MilesSDK_DIR}"
PATH_SUFFIXES lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MilesSDK DEFAULT_MSG MilesSDK_LIBRARIES MilesSDK_INCLUDE_DIR)
if(NOT TARGET MilesSDK::MilesSDK)
add_library(MilesSDK::MilesSDK UNKNOWN IMPORTED)
set_target_properties(MilesSDK::MilesSDK PROPERTIES
IMPORTED_LOCATION "${MilesSDK_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES "${MilesSDK_INCLUDE_DIR}"
)
endif()

View file

@ -53,11 +53,8 @@ set(SNDFILE_LIBRARIES "${SNDFILE_LIBRARY}")
if(SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
set(SNDFILE_FOUND TRUE)
endif (SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
endif()
# handle the QUIETLY and REQUIRED arguments and set SndFile_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SndFile DEFAULT_MSG SNDFILE_INCLUDE_DIRS SNDFILE_LIBRARIES)

View file

@ -26,8 +26,6 @@ find_library(mpg123_LIBRARIES NAMES mpg123 mpg123-0
set(mpg123_CFLAGS "${PKG_MPG123_CFLAGS_OTHER}" CACHE STRING "CFLAGS of mpg123")
# handle the QUIETLY and REQUIRED arguments and set mpg123_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(mpg123 DEFAULT_MSG mpg123_LIBRARIES mpg123_INCLUDE_DIR)

View file

@ -52,9 +52,6 @@ if (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES)
set(OPUSFILE_FOUND TRUE)
endif (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES)
# handle the QUIETLY and REQUIRED arguments and set Opusfile_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(opusfile DEFAULT_MSG OPUSFILE_INCLUDE_DIRS OPUSFILE_LIBRARIES)

View file

@ -36,6 +36,13 @@ target_compile_definitions(re3
RE3_NO_AUTOLINK
)
if(LIBRW_PLATFORM_D3D9)
target_compile_definitions(re3
PUBLIC
USE_D3D9
)
endif()
if(RE3_AUDIO STREQUAL "OAL")
find_package(OpenAL REQUIRED)
target_include_directories(re3 PRIVATE ${OPENAL_INCLUDE_DIR})
@ -43,7 +50,9 @@ if(RE3_AUDIO STREQUAL "OAL")
target_compile_definitions(re3 PRIVATE ${OPENAL_DEFINITIONS})
target_compile_definitions(re3 PRIVATE AUDIO_OAL)
elseif(RE3_AUDIO STREQUAL "MSS")
find_package(MilesSDK REQUIRED)
target_compile_definitions(re3 PRIVATE AUDIO_MSS)
target_link_libraries(re3 PRIVATE MilesSDK::MilesSDK)
endif()
if(RE3_WITH_OPUS)