zdoom-macos-deps/deps/sdl2_mixer/lib/cmake/SDL2_mixer/Findlibxmp-lite.cmake

46 lines
1.6 KiB
CMake
Raw Normal View History

2024-01-24 11:34:08 +00:00
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_XMPLITE QUIET libxmp-lite)
2022-07-09 14:01:49 +00:00
find_library(libxmp_lite_LIBRARY
2024-01-24 11:34:08 +00:00
NAMES xmp-lite libxmp-lite
HINTS ${PC_XMPLITE_LIBDIR}
2022-07-09 14:01:49 +00:00
)
find_path(libxmp_lite_INCLUDE_PATH
NAMES xmp.h
2024-01-24 11:34:08 +00:00
PATH_SUFFIXES libxmp-lite
HINTS ${PC_XMPLITE_INCLUDEDIR}
2022-07-09 14:01:49 +00:00
)
2024-01-24 11:34:08 +00:00
if(PC_XMPLITE_FOUND)
get_flags_from_pkg_config("${libxmp_lite_LIBRARY}" "PC_XMPLITE" "_libxmp_lite")
endif()
set(libxmp_lite_COMPILE_OPTIONS "${_libxmp_lite_compile_options}" CACHE STRING "Extra compile options of libxmp_lite")
set(libxmp_lite_LINK_LIBRARIES "${_libxmp_lite_link_libraries}" CACHE STRING "Extra link libraries of libxmp_lite")
2022-07-09 14:01:49 +00:00
2024-01-24 11:34:08 +00:00
set(libxmp_lite_LINK_OPTIONS "${_libxmp_lite_link_options}" CACHE STRING "Extra link flags of libxmp_lite")
2022-07-09 14:01:49 +00:00
2024-01-24 11:34:08 +00:00
set(libxmp_lite_LINK_DIRECTORIES "${_libxmp_lite_link_directories}" CACHE PATH "Extra link directories of libxmp_lite")
2022-07-09 14:01:49 +00:00
2024-01-24 11:34:08 +00:00
find_package_handle_standard_args(libxmp-lite
2022-07-09 14:01:49 +00:00
REQUIRED_VARS libxmp_lite_LIBRARY libxmp_lite_INCLUDE_PATH
)
2024-01-24 11:34:08 +00:00
if(libxmp-lite_FOUND)
2022-07-09 14:01:49 +00:00
if(NOT TARGET libxmp-lite::libxmp-lite)
add_library(libxmp-lite::libxmp-lite UNKNOWN IMPORTED)
2024-01-24 11:34:08 +00:00
set_target_properties(libxmp-lite::libxmp-lite PROPERTIES
2022-07-09 14:01:49 +00:00
IMPORTED_LOCATION "${libxmp_lite_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_lite_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${libxmp_lite_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${libxmp_lite_LINK_LIBRARIES}"
2024-01-24 11:34:08 +00:00
INTERFACE_LINK_OPTIONS "${libxmp_lite_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${libxmp_lite_LINK_DIRECTORIES}"
2022-07-09 14:01:49 +00:00
)
endif()
endif()