-
Notifications
You must be signed in to change notification settings - Fork 161
/
CMakeLists.txt
44 lines (32 loc) · 1.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
endif()
project(MediaWriter)
cmake_minimum_required(VERSION 3.17)
set(MEDIAWRITER_MAJOR_VERSION "5")
set(MEDIAWRITER_MINOR_VERSION "0")
# MICRO_VERSION >= 50 means a development version
set(MEDIAWRITER_MICRO_VERSION "50")
set(MEDIAWRITER_VERSION "${MEDIAWRITER_MAJOR_VERSION}.${MEDIAWRITER_MINOR_VERSION}.${MEDIAWRITER_MICRO_VERSION}")
set(QT_MIN_VERSION "6.6.0")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_AUTOMOC ON)
if (WIN32)
cmake_policy(SET CMP0020 NEW) # to use winmain to avoid opening a console window when starting
endif()
include(GNUInstallDirs)
include(FeatureSummary)
if (${MEDIAWRITER_MICRO_VERSION} GREATER_EQUAL 50)
execute_process(COMMAND git rev-parse --short HEAD OUTPUT_VARIABLE MEDIAWRITER_LAST_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
add_definitions(-DMEDIAWRITER_VERSION="${MEDIAWRITER_VERSION}-${MEDIAWRITER_LAST_COMMIT}")
else()
add_definitions(-DMEDIAWRITER_VERSION="${MEDIAWRITER_VERSION}")
endif()
if (UNIX AND NOT APPLE)
# FIXME: this is not ideal
add_definitions(-DLIBEXECDIR="${CMAKE_INSTALL_FULL_LIBEXECDIR}/mediawriter")
endif()
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Gui Network Svg Qml Quick QuickControls2 Widgets)
add_subdirectory(src)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)