forked from sccn/liblsl
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
72 lines (62 loc) · 2.53 KB
/
Copy pathCMakeLists.txt
File metadata and controls
72 lines (62 loc) · 2.53 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
cmake_minimum_required (VERSION 3.23)
# Derive the version from the most recent git tag (e.g. v1.18.0 -> 1.18.0).
# The literal below is the single source of truth for builds without git/tags.
include(cmake/ProjectVersion.cmake)
lsl_version_from_git(LSL_VERSION LSL_VERSION_FULL FALLBACK "1.18.0")
project (liblsl
VERSION ${LSL_VERSION}
LANGUAGES C CXX
DESCRIPTION "Labstreaminglayer C/C++ library"
HOMEPAGE_URL "https://github.com/sccn/liblsl"
)
# API version, to be incremented on backwards-incompatible ABI changes
set(LSL_ABI_VERSION 2)
# Enable folder organization in IDEs (Visual Studio, Xcode, CLion)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Include modular configuration files
include(cmake/ProjectOptions.cmake) #
include(cmake/CompilerSettings.cmake) #
include(cmake/Dependencies.cmake) #
include(cmake/SourceFiles.cmake) #
include(cmake/TargetObjLib.cmake) #
include(cmake/TargetLib.cmake) #
include(cmake/Installation.cmake) #
include(cmake/TargetOther.cmake)
if(LSL_UNITTESTS AND NOT IOS)
add_subdirectory(testing)
endif()
# Config for packaging
include(cmake/LSLCMake.cmake)
LSL_get_target_arch()
LSL_get_os_name()
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
# Use the full tag (incl. any pre-release suffix like b1) for package metadata,
# while PROJECT_VERSION stays strictly numeric as CMake requires.
set(CPACK_PACKAGE_VERSION "${LSL_VERSION_FULL}")
set(CPACK_PACKAGE_VENDOR "Labstreaminglayer")
set(CPACK_STRIP_FILES ON)
if(APPLE)
set(CPACK_GENERATOR TGZ)
elseif(WIN32)
set(CPACK_GENERATOR ZIP)
else()
set(CPACK_GENERATOR DEB TGZ)
# Debian prereleases must sort before the corresponding stable version.
# Keep the Git tag and other package metadata unchanged (e.g. 1.18.0.b3).
string(REGEX REPLACE
"^([0-9]+\\.[0-9]+\\.[0-9]+)[.-]?((alpha|beta|rc|a|b)[0-9]+)$"
"\\1~\\2" CPACK_DEBIAN_PACKAGE_VERSION "${LSL_VERSION_FULL}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "LabStreamingLayer Developers")
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
if(LSL_ARCH STREQUAL "amd64" OR LSL_ARCH STREQUAL "arm64" OR LSL_ARCH STREQUAL "i386")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${LSL_ARCH}")
elseif(LSL_ARCH STREQUAL "arm")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
elseif(LSL_ARCH STREQUAL "ppc64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "ppc64el")
elseif(LSL_ARCH STREQUAL "powerpc")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "powerpc")
endif()
endif()
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-${LSL_OS}_${LSL_ARCH}")
include(CPack)