-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 1.07 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
cmake_minimum_required(VERSION 3.30)
project(BlackMagicDecklinkAPIExample LANGUAGES CXX)
set(CMAKE_BUILD_TYPE Debug)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(BUILD_FOR_WIN TRUE)
message("Windows platform detected..")
else()
message("Linux platform detected..")
endif()
option(STATIC_BUILD "Build a static binary." ${BUILD_FOR_WIN})
if (STATIC_BUILD)
set(CMAKE_EXE_LINKER_FLAGS "-static")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" CONFIG)
set(BUILD_SHARED_LIBS OFF)
endif()
if (BUILD_FOR_WIN)
message("Building for Windows..")
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
set(CMAKE_RANLIB i686-w64-mingw32-ranlib)
include_directories(${CMAKE_SOURCE_DIR}/win_includes)
else()
message("Building for Linux..")
# Add the include directory for headers
include_directories(${CMAKE_SOURCE_DIR}/linux_includes)
endif()
# Add the executable target
add_executable(decklinkInfo main.cpp)