mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 14:08:19 +00:00
a9da26d0dc
dyld[41859]: Library not loaded: @rpath/libpng16.16.dylib Referenced from: /Users/deen/Library/Application Support/Steam/steamapps/common/DDraceNetwork/ddnet/DDNet Reason: tried: '/Users/deen/Library/Application Support/Steam/steamapps/common/DDraceNetwork/ddnet/../Frameworks/libpng16.16.dylib' (no such file), '/Users/deen/Library/Application Support/Steam/steamapps/common/DDraceNetwork/ddnet/../Frameworks/libpng16.16.dylib' (no such file), '/usr/local/lib/libpng16.16.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libpng16.16.dylib' (no such file)
50 lines
1.4 KiB
CMake
50 lines
1.4 KiB
CMake
if(NOT PREFER_BUNDLED_LIBS)
|
|
set(CMAKE_MODULE_PATH ${ORIGINAL_CMAKE_MODULE_PATH})
|
|
find_package(PNG)
|
|
set(CMAKE_MODULE_PATH ${OWN_CMAKE_MODULE_PATH})
|
|
if(PNG_FOUND)
|
|
set(PNG_BUNDLED OFF)
|
|
set(PNG_DEP)
|
|
endif()
|
|
endif()
|
|
|
|
if(NOT PNG_FOUND)
|
|
set_extra_dirs_lib(PNG png)
|
|
find_library(PNG_LIBRARY
|
|
NAMES libpng16.16 png16.16 libpng16-16 png16-16 libpng16 png16
|
|
HINTS ${HINTS_PNG_LIBDIR} ${PC_PNG_LIBDIR} ${PC_PNG_LIBRARY_DIRS}
|
|
PATHS ${PATHS_PNG_LIBDIR}
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
|
)
|
|
|
|
set_extra_dirs_include(PNG png "${PNG_LIBRARY}")
|
|
find_path(PNG_INCLUDEDIR
|
|
NAMES png.h
|
|
HINTS ${HINTS_PNG_INCLUDEDIR} ${PC_PNG_INCLUDEDIR} ${PC_PNG_INCLUDE_DIRS}
|
|
PATHS ${PATHS_PNG_INCLUDEDIR}
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
|
)
|
|
|
|
mark_as_advanced(PNG_LIBRARY PNG_INCLUDEDIR)
|
|
|
|
if(PNG_LIBRARY AND PNG_INCLUDEDIR)
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(PNG DEFAULT_MSG PNG_LIBRARY PNG_INCLUDEDIR)
|
|
|
|
set(PNG_LIBRARIES ${PNG_LIBRARY})
|
|
set(PNG_INCLUDE_DIRS ${PNG_INCLUDEDIR})
|
|
endif()
|
|
endif()
|
|
|
|
set(PNG_COPY_FILES)
|
|
if(PNG_FOUND)
|
|
is_bundled(PNG_BUNDLED "${PNG_LIBRARY}")
|
|
if(PNG_BUNDLED)
|
|
if(TARGET_OS STREQUAL "windows")
|
|
set(PNG_COPY_FILES "${EXTRA_PNG_LIBDIR}/libpng16-16.dll")
|
|
elseif(TARGET_OS STREQUAL "mac")
|
|
set(PNG_COPY_FILES "${EXTRA_PNG_LIBDIR}/libpng16.16.dylib")
|
|
endif()
|
|
endif()
|
|
endif()
|