Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 5e76e7a52888d6fd1deb0ada965656bf54a05e98
  • develop par défaut protégée
  • upgrade-appservice
  • baguette-custom-fixes
  • fix-discord-reply-edited
  • update-readme-badges
6 résultats

pyproject.toml

Blame
  • CMakeLists.txt 4,90 Kio
    cmake_minimum_required(VERSION 3.17)
    
    # Alpho Vivy, CXX only
    project(Vivy VERSION 0.1 LANGUAGES CXX)
    cmake_policy(SET CMP0100 NEW) # Let cmake use moc and uic for .hh files
    cmake_policy(SET CMP0009 NEW) # Do not follow symlinks with GLOB_RECURSE
    
    # Don't forget for specific things
    if(WIN32)
        message(STATUS "You are building on windows, pay attenion to the dependencies")
    endif()
    if(MSVC OR MSYS OR MINGW)
        message(STATUS "You are building with a windows compiler")
    endif()
    if(APPLE)
        message(STATUS "You are building on MacOS X")
    endif()
    if(UNIX AND NOT APPLE)
        message(STATUS "You are building on Linux, FreeBSD or any other toaster OS")
    endif()
    
    # Pass -fPIC
    set(CMAKE_POSITION_INDEPENDENT_CODE ON)
    
    # For Qt
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    
    # Pthread ftw
    set(THREADS_PREFER_PTHREAD_FLAG ON)
    
    # Find Qt dependencies
    find_package(QT NAMES Qt6 Qt5      COMPONENTS Widgets REQUIRED)
    find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
    
    # Find others dependencies
    find_library(AVCODEC_LIBRARY    avcodec     4.0 REQUIRED)
    find_library(AVUTIL_LIBRARY     avutil      4.0 REQUIRED)
    find_library(SWRESAMPLE_LIBRARY swresample      REQUIRED)
    find_library(AVFORMAT_LIBRARY   avformat        REQUIRED)
    find_library(MPV_LIBRARY        mpv             REQUIRED)
    
    # Add the lua dependency
    add_subdirectory(
        "${CMAKE_CURRENT_SOURCE_DIR}/vendor/lua-5.4.3"
        "${CMAKE_BINARY_DIR}/vendor/lua-5.4.3"
    )
    
    # Grab all files
    file(GLOB_RECURSE Vivy_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc")
    file(GLOB_RECURSE Vivy_INC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hh")
    if(APPLE)
        file(GLOB_RECURSE Vivy_APPLE_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.mm")
    endif()
    set(PROJECT_SOURCES ${Vivy_SRC} ${Vivy_INC} ${Vivy_APPLE_SRC})
    
    # Add the Vivy executable
    if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
        qt_add_executable(Vivy
            MANUAL_FINALIZATION
            ${PROJECT_SOURCES}
            rsc/VivyRessources.qrc
        )
    else()
        add_executable(Vivy
            ${PROJECT_SOURCES}
            rsc/VivyRessources.qrc
        )
    endif()