zdoom-macos-deps/deps/sdl2_mixer/lib/cmake/SDL2_mixer/Findmodplug.cmake

44 lines
1.5 KiB
CMake
Raw Normal View History

2022-07-09 14:01:49 +00:00
include(FindPackageHandleStandardArgs)
2024-01-24 11:34:08 +00:00
find_package(PkgConfig QUIET)
pkg_check_modules(PC_MODPLUG QUIET libmodplug)
2022-07-09 14:01:49 +00:00
find_library(modplug_LIBRARY
NAMES modplug
)
find_path(modplug_INCLUDE_PATH
NAMES libmodplug/modplug.h
)
2024-01-24 11:34:08 +00:00
if(PC_MODPLUG_FOUND)
get_flags_from_pkg_config("${modplug_LIBRARY}" "PC_MODPLUG" "_modplug")
endif()
set(modplug_COMPILE_OPTIONS "${_modplug_compile_options}" CACHE STRING "Extra compile options of modplug")
set(modplug_LINK_LIBRARIES "${_modplug_link_libraries}" CACHE STRING "Extra link libraries of modplug")
2022-07-09 14:01:49 +00:00
2024-01-24 11:34:08 +00:00
set(modplug_LINK_OPTIONS "${_modplug_link_options}" CACHE STRING "Extra link flags of modplug")
2022-07-09 14:01:49 +00:00
2024-01-24 11:34:08 +00:00
set(modplug_LINK_DIRECTORIES "${_modplug_link_directories}" CACHE PATH "Extra link directories of modplug")
2022-07-09 14:01:49 +00:00
find_package_handle_standard_args(modplug
REQUIRED_VARS modplug_LIBRARY modplug_INCLUDE_PATH
)
if (modplug_FOUND)
if (NOT TARGET modplug::modplug)
add_library(modplug::modplug UNKNOWN IMPORTED)
set_target_properties(modplug::modplug PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${modplug_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${modplug_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${modplug_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${modplug_LINK_LIBRARIES}"
2024-01-24 11:34:08 +00:00
INTERFACE_LINK_OPTIONS "${modplug_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${modplug_LINK_DIRECTORIES}"
2022-07-09 14:01:49 +00:00
)
endif()
endif()