This repository has been archived by the owner on May 15, 2019. It is now read-only.
forked from stream-labs/obs-studio-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
94 lines (80 loc) · 2.21 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
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
86
87
88
89
90
91
92
93
94
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
# Automatic Versioning
SET(VERSION_FULL 0.3.21)
SET(VERSION_BUILD 0)
IF(EXISTS "${CMAKE_SOURCE_DIR}/.git")
SET(GIT_RESULT "")
SET(GIT_OUTPUT "")
EXECUTE_PROCESS(
COMMAND git rev-list --count --topo-order v${VERSION_FULL}..HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE GIT_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE ERROR_QUIET
)
IF(GIT_RESULT EQUAL 0)
SET(VERSION_BUILD "${GIT_OUTPUT}")
ENDIF()
ENDIF()
PROJECT(
obs-studio-node
VERSION ${VERSION_FULL}.${VERSION_BUILD}
)
################################################################################
# CMake
################################################################################
MESSAGE(STATUS "OBS Studio for Node.JS Version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}")
# Set Module Path
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
# CppCheck
include(cppcheck)
################################################################################
# Compiler
################################################################################
# MSVC Specific
IF(WIN32)
# Resource VersionInfo
SET(
PROJECT_PRODUCT_NAME
"OBS Studio for Node.JS"
)
SET(
PROJECT_COMPANY_NAME
"Streamlabs"
)
SET(
PROJECT_COPYRIGHT
"Streamlabs © 2017 - 2018"
)
SET(
PROJECT_LEGAL_TRADEMARKS_1
""
)
SET(
PROJECT_LEGAL_TRADEMARKS_2
""
)
configure_file(
${PROJECT_SOURCE_DIR}/cmake/version.rc.in
${PROJECT_BINARY_DIR}/version.rc
@ONLY
)
# ToDo: Figure out a better way to tell the test setup where to find our binaries.
configure_file(
${PROJECT_SOURCE_DIR}/cmake/obs.js.in
${PROJECT_SOURCE_DIR}/tests/helpers/obs.js
@ONLY
)
ENDIF()
#############################
# Configuration
#############################
# Installation
SET(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/distribute" CACHE PATH "Path to install files to")
#############################
# Projects
#############################
cppcheck(EXCLUDE "${PROJECT_SOURCE_DIR}/node_modules")
ADD_SUBDIRECTORY(lib-streamlabs-ipc)
ADD_SUBDIRECTORY(obs-studio-client)
ADD_SUBDIRECTORY(obs-studio-server)