mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 02:34:26 +08:00
Use find_package when pkg_check_modules fails
Fixed the issue that when the cmake version was earlier than 3.6.0, the pkg_check_modules did not support IMPORTED_TARGET parameters, resulting in the SDL2 library not being found
This commit is contained in:
parent
a554fab5fb
commit
210894ed83
@ -21,8 +21,6 @@
|
||||
# SOFTWARE.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.6.0)
|
||||
|
||||
set(LINK_LIBRARIES ${MK_LINK_LIBRARIES})
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
@ -33,7 +31,9 @@ if(PKG_CONFIG_FOUND)
|
||||
list(APPEND LINK_LIBRARIES PkgConfig::SDL2)
|
||||
message(STATUS "found library: ${SDL2_LIBRARIES}")
|
||||
endif()
|
||||
else()
|
||||
endif()
|
||||
|
||||
if(NOT SDL2_FOUND)
|
||||
find_package(SDL2 QUIET)
|
||||
if(SDL2_FOUND)
|
||||
include_directories(SYSTEM ${SDL2_INCLUDE_DIR})
|
||||
|
Loading…
Reference in New Issue
Block a user