-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
85 lines (65 loc) · 1.66 KB
/
Copy pathCMakeLists.txt
File metadata and controls
85 lines (65 loc) · 1.66 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 3.16)
project(enc_preset_file)
set (target enc_preset_file)
add_executable(${target})
# Operating System
string(TOLOWER ${CMAKE_SYSTEM_NAME} OS)
# output
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../../../bin/${PLATFORM})
# debug definitions
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${target} PUBLIC _DEBUG)
endif()
# release definitions
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_definitions(${target} PUBLIC NDEBUG)
endif()
# Linux
if(OS STREQUAL "linux")
# common compile options
target_compile_options(${target} PRIVATE -std=c++17 -MMD -MP -MF)
# x64 compile options
if (PLATFORM STREQUAL "x64")
target_compile_options(${target} PRIVATE -m64 -fPIC)
endif()
# x86 compile options
if (PLATFORM STREQUAL "x86")
target_compile_options(${target} PRIVATE -m32)
endif()
# debug compile options
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(${target} PRIVATE -g)
endif()
# release compile options
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(${target} PRIVATE -O2 -s)
endif()
endif()
# include dirs
target_include_directories(${target}
PUBLIC
../../../sdk/include
)
# sources
file(GLOB source "./*.cpp")
target_sources(${target}
PRIVATE
${source}
)
# lib dirs
target_link_directories(${target}
PRIVATE
# avblocks
${PROJECT_SOURCE_DIR}/../../../sdk/lib/${PLATFORM}
)
# libs
if(OS STREQUAL "linux")
target_link_libraries(
${target}
# primo-avblocks
libAVBlocks64.so
# os
# pthread
# rt
)
endif()