mirror of https://github.com/mgba-emu/mgba.git
All: Add Debian-style dependencies for CPack
This commit is contained in:
parent
a8a9f31eea
commit
3fdf8fe316
|
@ -126,6 +126,7 @@ endif()
|
|||
|
||||
# Features
|
||||
set(DEBUGGER_SRC ${CMAKE_SOURCE_DIR}/src/debugger/debugger.c ${CMAKE_SOURCE_DIR}/src/debugger/memory-debugger.c)
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6")
|
||||
|
||||
if(USE_CLI_DEBUGGER)
|
||||
add_definitions(-DUSE_CLI_DEBUGGER)
|
||||
|
@ -135,6 +136,7 @@ if(USE_CLI_DEBUGGER)
|
|||
include_directories(AFTER ${LIBEDIT_INCLUDE_DIRS})
|
||||
link_directories(${LIBEDIT_LIBRARY_DIRS})
|
||||
set(DEBUGGER_LIB ${LIBEDIT_LIBRARIES})
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libedit2")
|
||||
else()
|
||||
set(DEBUGGER_LIB "")
|
||||
endif()
|
||||
|
@ -154,7 +156,14 @@ if(USE_FFMPEG)
|
|||
include_directories(AFTER ${LIBAVCODEC_INCLUDE_DIRS} ${LIBAVFORMAT_INCLUDE_DIRS} ${LIBAVRESAMPLE_INCLUDE_DIRS} ${LIBAVUTIL_INCLUDE_DIRS} ${LIBSWSCALE_INCLUDE_DIRS})
|
||||
link_directories(${LIBAVCODEC_LIBRARY_DIRS} ${LIBAVFORMAT_LIBRARY_DIRS} ${LIBAVRESAMPLE_LIBRARY_DIRS} ${LIBAVUTIL_LIBRARY_DIRS} ${LIBSWSCALE_LIBRARY_DIRS})
|
||||
list(APPEND UTIL_SRC "${CMAKE_SOURCE_DIR}/src/platform/ffmpeg/ffmpeg-encoder.c")
|
||||
string(REGEX MATCH "^[0-9]+" LIBAVCODEC_VERSION_MAJOR ${libavcodec_VERSION})
|
||||
string(REGEX MATCH "^[0-9]+" LIBAVFORMAT_VERSION_MAJOR ${libavformat_VERSION})
|
||||
string(REGEX MATCH "^[0-9]+" LIBAVRESAMPLE_VERSION_MAJOR ${libavresample_VERSION})
|
||||
string(REGEX MATCH "^[0-9]+" LIBAVUTIL_VERSION_MAJOR ${libavutil_VERSION})
|
||||
string(REGEX MATCH "^[0-9]+" LIBSWSCALE_VERSION_MAJOR ${libswscale_VERSION})
|
||||
list(APPEND DEPENDENCY_LIB ${LIBAVCODEC_LIBRARIES} ${LIBAVFORMAT_LIBRARIES} ${LIBAVRESAMPLE_LIBRARIES} ${LIBAVUTIL_LIBRARIES} ${LIBSWSCALE_LIBRARIES})
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libavcodec${LIBAVCODEC_VERSION_MAJOR},libavformat${LIBAVFORMAT_VERSION_MAJOR},libavresample${LIBAVRESAMPLE_VERSION_MAJOR},libavutil${LIBAVUTIL_VERSION_MAJOR},libswscale${LIBSWSCALE_VERSION_MAJOR}")
|
||||
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "libavcodec-extra")
|
||||
endif()
|
||||
|
||||
if(USE_MAGICK)
|
||||
|
@ -163,12 +172,20 @@ if(USE_MAGICK)
|
|||
link_directories(${MAGICKWAND_LIBRARY_DIRS})
|
||||
list(APPEND UTIL_SRC "${CMAKE_SOURCE_DIR}/src/platform/imagemagick/imagemagick-gif-encoder.c")
|
||||
list(APPEND DEPENDENCY_LIB ${MAGICKWAND_LIBRARIES})
|
||||
string(REGEX MATCH "^[0-9]+\\.[0-9]+" MAGICKWAND_VERSION_PARTIAL ${MagickWand_VERSION})
|
||||
if(${MAGICKWAND_VERSION_PARTIAL} EQUAL "6.7")
|
||||
set(MAGICKWAND_DEB_VERSION "5")
|
||||
else()
|
||||
set(MAGICKWAND_DEB_VERSION "-6.q16-2")
|
||||
endif()
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libmagickwand${MAGICKWAND_DEB_VERSION}")
|
||||
endif()
|
||||
|
||||
if(USE_PNG)
|
||||
add_definitions(-DUSE_PNG)
|
||||
include_directories(AFTER ${PNG_INCLUDE_DIRS})
|
||||
list(APPEND DEPENDENCY_LIB ${PNG_LIBRARIES} ${ZLIB_LIBRARIES})
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libpng12-0,zlib1g")
|
||||
endif()
|
||||
|
||||
if(USE_LIBZIP)
|
||||
|
@ -176,6 +193,7 @@ if(USE_LIBZIP)
|
|||
link_directories(${LIBZIP_LIBRARY_DIRS})
|
||||
list(APPEND DEPENDENCY_LIB ${LIBZIP_LIBRARIES})
|
||||
add_definitions(-DENABLE_LIBZIP)
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libzip2")
|
||||
endif()
|
||||
|
||||
# Binaries
|
||||
|
|
|
@ -52,12 +52,15 @@ qt5_wrap_ui(UI_FILES
|
|||
LogView.ui
|
||||
VideoView.ui)
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libqt5widgets5,libqt5opengl5" PARENT_SCOPE)
|
||||
if(BUILD_SDL)
|
||||
list(APPEND SOURCE_FILES AudioProcessorSDL.cpp)
|
||||
elseif(Qt5Multimedia_FOUND)
|
||||
list(APPEND SOURCE_FILES
|
||||
AudioProcessorQt.cpp
|
||||
AudioDevice.cpp)
|
||||
list(APPEND QT_LIBRARIES Qt5::Multimedia)
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libqt5multimedia5" PARENT_SCOPE)
|
||||
else()
|
||||
message(WARNING "No supported audio modules found")
|
||||
set(BUILD_QT OFF PARENT_SCOPE)
|
||||
|
@ -81,9 +84,6 @@ add_executable(${BINARY_NAME}-qt WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR
|
|||
set_target_properties(${BINARY_NAME}-qt PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/info.plist.in)
|
||||
|
||||
set(QT_LIBRARIES Qt5::Widgets Qt5::OpenGL)
|
||||
if(Qt5Multimedia_FOUND)
|
||||
list(APPEND QT_LIBRARIES Qt5::Multimedia)
|
||||
endif()
|
||||
target_link_libraries(${BINARY_NAME}-qt ${PLATFORM_LIBRARY} ${OPENGL_LIBRARY} ${BINARY_NAME} ${QT_LIBRARIES})
|
||||
|
||||
install(TARGETS ${BINARY_NAME}-qt RUNTIME DESTINATION bin BUNDLE DESTINATION /Applications)
|
||||
|
|
|
@ -9,12 +9,14 @@ if (SDL_VERSION EQUAL "2")
|
|||
set(SDL_LIBRARY ${SDL2_LIBRARIES} CACHE INTERNAL "")
|
||||
set(SDLMAIN_LIBRARY "" CACHE INTERNAL "")
|
||||
link_directories(${SDL2_LIBDIR})
|
||||
set(SDL_VERSION_DEBIAN "2-2.0-0")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_VERSION EQUAL "1.2" OR NOT SDL2_FOUND)
|
||||
find_package(SDL 1.2)
|
||||
set(SDL_VERSION "1.2" PARENT_SCOPE)
|
||||
set(SDL_VERSION_DEBIAN "1.2debian")
|
||||
endif()
|
||||
|
||||
if (NOT SDL2_FOUND AND NOT SDL_FOUND)
|
||||
|
@ -22,6 +24,8 @@ if (NOT SDL2_FOUND AND NOT SDL_FOUND)
|
|||
return()
|
||||
endif()
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libsdl${SDL_VERSION_DEBIAN}" PARENT_SCOPE)
|
||||
|
||||
file(GLOB PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-*.c)
|
||||
set(PLATFORM_LIBRARY ${SDL_LIBRARY} ${SDLMAIN_LIBRARY})
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/platform/sdl ${SDL_INCLUDE_DIR})
|
||||
|
|
Loading…
Reference in New Issue