-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (34 loc) · 1.23 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
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
set(PROJECT_NAME "TS-PARSER")
project(${PROJECT_NAME})
# force static runtime libraries for msvc builds
if(MSVC)
set(variables CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL)
foreach(variable ${variables})
if(${variable} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
endif()
endforeach()
endif()
# set c++17
set (CMAKE_CXX_STANDARD 17)
set( CMAKE_CXX_STANDARD_REQUIRED ON )
# compile everything position independent (even static libraries)
set( CMAKE_POSITION_INDEPENDENT_CODE TRUE )
# set verbose compile options
#set( CMAKE_VERBOSE_MAKEFILE ON )
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /PROFILE")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()
set(PROJECT_SOURCES
tsCommon.h
tsPacketHeader.h tsPacketHeader.cpp
tsAdaptationField.h tsAdaptationField.cpp
pesPacketHeader.h pesPacketHeader.cpp
pesAssembler.h pesAssembler.cpp
TS_parser.cpp)
source_group("Source Files" FILES ${PROJECT_SOURCES})
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})