forked from mumble-voip/mumble-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (31 loc) · 865 Bytes
/
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
cmake_minimum_required(VERSION 3.15)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(TargetArch)
project(MumblePlugin
VERSION "1.1.0"
DESCRIPTION "Factorio Positional Audio Plugin"
LANGUAGES "C"
)
set(PLUGIN_NAME "factorio")
add_library(plugin
SHARED
plugin.c
)
target_include_directories(plugin
PUBLIC "${CMAKE_SOURCE_DIR}/include/"
)
# Add suffix for the respective OS
if (WIN32)
set(PLUGIN_NAME "${PLUGIN_NAME}_win")
elseif (APPLE)
set(PLUGIN_NAME "${PLUGIN_NAME}_macos")
elseif(UNIX)
set(PLUGIN_NAME "${PLUGIN_NAME}_linux")
endif()
# Add suffix for target architecture
target_architecture(TARGET_ARCH)
string(TOLOWER "${TARGET_ARCH}" TARGET_ARCH)
if (NOT TARGET_ARCH STREQUAL "unknown")
set(PLUGIN_NAME "${PLUGIN_NAME}_${TARGET_ARCH}")
endif()
set_target_properties(plugin PROPERTIES LIBRARY_OUTPUT_NAME "${PLUGIN_NAME}")