cmake: delete unused code, cosmetic changes

This commit is contained in:
Roman Fomin 2023-04-29 10:21:44 +07:00
parent 4463f86dea
commit ab708171f3
5 changed files with 9 additions and 35 deletions

View File

@ -140,18 +140,4 @@ if(SDL2_FOUND)
set_target_properties(SDL2::SDL2main PROPERTIES set_target_properties(SDL2::SDL2main PROPERTIES
IMPORTED_LOCATION "${SDL2_MAIN_LIBRARY}") IMPORTED_LOCATION "${SDL2_MAIN_LIBRARY}")
endif() endif()
if(WIN32)
# On Windows, we need to figure out the location of our library files
# so we can copy and package them.
get_filename_component(SDL2_DLL_DIR "${SDL2_LIBRARY}" DIRECTORY)
if(EXISTS "${SDL2_DLL_DIR}/SDL2.dll")
set(SDL2_DLL_DIR "${SDL2_DLL_DIR}" CACHE INTERNAL "")
elseif(EXISTS "${SDL2_DLL_DIR}/../bin/SDL2.dll")
get_filename_component(SDL2_DLL_DIR "${SDL2_DLL_DIR}/../bin" REALPATH)
set(SDL2_DLL_DIR "${SDL2_DLL_DIR}" CACHE INTERNAL "")
else()
message(ERROR "Can't find SDL2 dynamic library directory.")
endif()
endif()
endif() endif()

View File

@ -106,18 +106,4 @@ if(SDL2_NET_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_NET_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${SDL2_NET_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES SDL2::SDL2 INTERFACE_LINK_LIBRARIES SDL2::SDL2
IMPORTED_LOCATION "${SDL2_NET_LIBRARY}") IMPORTED_LOCATION "${SDL2_NET_LIBRARY}")
if(WIN32)
# On Windows, we need to figure out the location of our library files
# so we can copy and package them.
get_filename_component(SDL2_NET_DLL_DIR "${SDL2_NET_LIBRARY}" DIRECTORY)
if(EXISTS "${SDL2_NET_DLL_DIR}/SDL2_net.dll")
set(SDL2_NET_DLL_DIR "${SDL2_NET_DLL_DIR}" CACHE INTERNAL "")
elseif(EXISTS "${SDL2_NET_DLL_DIR}/../bin/SDL2_net.dll")
get_filename_component(SDL2_NET_DLL_DIR "${SDL2_NET_DLL_DIR}/../bin" REALPATH)
set(SDL2_NET_DLL_DIR "${SDL2_NET_DLL_DIR}" CACHE INTERNAL "")
else()
message(ERROR "Can't find SDL2_net dynamic library directory.")
endif()
endif()
endif() endif()

View File

@ -4,7 +4,7 @@
# SNDFILE_LIBRARY # SNDFILE_LIBRARY
# #
# Environment variables used: # Environment variables used:
# SNDFILE_ROOT # SNDFILE_DIR
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(PC_SndFile QUIET sndfile) pkg_check_modules(PC_SndFile QUIET sndfile)
@ -15,7 +15,7 @@ find_path(SndFile_INCLUDE_DIR sndfile.h
HINTS HINTS
${PC_SndFile_INCLUDEDIR} ${PC_SndFile_INCLUDEDIR}
${PC_SndFile_INCLUDE_DIRS} ${PC_SndFile_INCLUDE_DIRS}
${SndFile_ROOT}) ${SNDFILE_DIR})
find_file(SndFile_DLL find_file(SndFile_DLL
NAMES sndfile.dll libsndfile.dll libsndfile-1.dll NAMES sndfile.dll libsndfile.dll libsndfile-1.dll
@ -27,7 +27,7 @@ find_library(SndFile_LIBRARY
HINTS HINTS
${PC_SndFile_LIBDIR} ${PC_SndFile_LIBDIR}
${PC_SndFile_LIBRARY_DIRS} ${PC_SndFile_LIBRARY_DIRS}
${SndFile_ROOT}) ${SNDFILE_DIR})
if(SndFile_DLL OR SndFile_LIBRARY MATCHES ".so|.dylib") if(SndFile_DLL OR SndFile_LIBRARY MATCHES ".so|.dylib")
set(_sndfile_library_type SHARED) set(_sndfile_library_type SHARED)

View File

@ -11,9 +11,9 @@ find_package_handle_standard_args(libxmp
) )
if(libxmp_FOUND) if(libxmp_FOUND)
if(NOT TARGET libxmp::xmp_shared) if(NOT TARGET libxmp::xmp)
add_library(libxmp::xmp_shared UNKNOWN IMPORTED) add_library(libxmp::xmp UNKNOWN IMPORTED)
set_target_properties(libxmp::xmp_shared PROPERTIES set_target_properties(libxmp::xmp PROPERTIES
IMPORTED_LOCATION "${libxmp_LIBRARY}" IMPORTED_LOCATION "${libxmp_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_INCLUDE_PATH}") INTERFACE_INCLUDE_DIRECTORIES "${libxmp_INCLUDE_PATH}")
endif() endif()

View File

@ -145,7 +145,9 @@ endif()
if(libxmp_FOUND) if(libxmp_FOUND)
list(APPEND WOOF_SOURCES i_xmp.c) list(APPEND WOOF_SOURCES i_xmp.c)
list(APPEND WOOF_LIBRARIES list(APPEND WOOF_LIBRARIES
$<IF:$<TARGET_EXISTS:libxmp::xmp_shared>,libxmp::xmp_shared,libxmp::xmp_static>) $<IF:$<TARGET_EXISTS:libxmp::xmp>,libxmp::xmp,
$<IF:$<TARGET_EXISTS:libxmp::xmp_shared>,libxmp::xmp_shared,
libxmp::xmp_static>>)
endif() endif()
# Standard target definition # Standard target definition