forked from pixsperdavid/libltc_cmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (31 loc) · 1.02 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
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
project(libltc LANGUAGES C)
option(BUILD_SHARED_LIBS "Build shared libaries" ON)
option(LIBLTC_USE_STATIC_MSVC_RUNTIME "Link against the static MSVC runtime" ON)
include_directories(src)
set(HEADER_FILES
src/decoder.h
src/encoder.h
src/ltc.h)
source_group("include" FILES ${HEADER_FILES})
set(SOURCE_FILES
src/decoder.c
src/encoder.c
src/ltc.c
src/timecode.c)
source_group("src" FILES ${SOURCE_FILES})
if(BUILD_SHARED_LIBS)
add_library(libltc SHARED ${HEADER_FILES} ${SOURCE_FILES})
else()
add_library(libltc STATIC ${HEADER_FILES} ${SOURCE_FILES})
target_compile_definitions(libltc PUBLIC "libltc_STATIC")
endif()
target_include_directories(libltc PUBLIC src)
if (LIBLTC_USE_STATIC_MSVC_RUNTIME)
set_property(TARGET ${PROJECT_NAME} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
else()
set_property(TARGET ${PROJECT_NAME} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()