2019-10-25 17:28:31 +02:00
|
|
|
cmake_minimum_required (VERSION 3.1)
|
2020-12-27 13:53:53 -06:00
|
|
|
project (tsmuxer_main CXX)
|
2019-08-11 14:58:13 -04:00
|
|
|
|
2021-09-22 21:33:14 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2019-10-25 17:28:31 +02:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS FALSE)
|
2019-08-11 14:58:13 -04:00
|
|
|
|
2020-01-17 17:58:23 +01:00
|
|
|
execute_process(
|
|
|
|
COMMAND git rev-parse --short HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
RESULT_VARIABLE GIT_REV_SHORT_RV
|
|
|
|
OUTPUT_VARIABLE GIT_REV_SHORT
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
set(TSMUXER_RELEASE FALSE)
|
|
|
|
set(VERSION_NUMBER "2.6.16")
|
|
|
|
if(${TSMUXER_RELEASE})
|
|
|
|
set(TSMUXER_VERSION ${VERSION_NUMBER})
|
2020-01-17 18:18:44 +01:00
|
|
|
elseif(${GIT_REV_SHORT_RV} EQUAL 0)
|
|
|
|
set(TSMUXER_VERSION "git-${GIT_REV_SHORT}")
|
2020-01-17 17:58:23 +01:00
|
|
|
else()
|
|
|
|
set(TSMUXER_VERSION "${VERSION_NUMBER}-dev")
|
|
|
|
endif()
|
|
|
|
add_definitions("-DTSMUXER_VERSION=\"${TSMUXER_VERSION}\"")
|
|
|
|
|
2021-11-14 02:06:30 +01:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
2020-12-27 13:53:53 -06:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
mark_as_advanced(CLEAR
|
|
|
|
CMAKE_INSTALL_BINDIR
|
2021-11-14 02:06:30 +01:00
|
|
|
CMAKE_INSTALL_DATADIR
|
2020-12-27 13:53:53 -06:00
|
|
|
)
|
2021-11-14 02:06:30 +01:00
|
|
|
else()
|
2020-12-27 13:53:53 -06:00
|
|
|
set(CMAKE_INSTALL_BINDIR bin)
|
2021-11-14 02:06:30 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
add_compile_options("/utf-8")
|
2022-01-23 18:13:00 +01:00
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
2021-11-14 02:06:30 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
add_definitions(-DUNICODE -D_UNICODE)
|
|
|
|
endif()
|
|
|
|
|
2022-01-12 12:39:40 +01:00
|
|
|
if(TSMUXER_STATIC_BUILD AND UNIX)
|
|
|
|
list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .a)
|
|
|
|
list(REMOVE_DUPLICATES CMAKE_FIND_LIBRARY_SUFFIXES)
|
|
|
|
endif()
|
|
|
|
|
2021-11-14 02:06:30 +01:00
|
|
|
set(TSMUXER_COVERAGE FALSE CACHE BOOL "Enable collecting coverage information")
|
|
|
|
if(${TSMUXER_COVERAGE})
|
|
|
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
|
|
|
add_compile_options("--coverage")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
|
|
|
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
|
|
|
add_compile_options("-fprofile-instr-generate" "-fcoverage-mapping")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-instr-generate")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Coverage not supported for compiler ${CMAKE_CXX_COMPILER_ID}")
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-12-27 13:53:53 -06:00
|
|
|
|
2021-11-14 02:06:30 +01:00
|
|
|
add_subdirectory(libmediation)
|
|
|
|
add_subdirectory(tsMuxer)
|
2019-10-30 09:13:51 +00:00
|
|
|
if(TSMUXER_GUI)
|
2021-11-14 02:06:30 +01:00
|
|
|
add_subdirectory(tsMuxerGUI)
|
2019-10-30 09:13:51 +00:00
|
|
|
endif()
|