-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
69 lines (59 loc) · 2.5 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
#----------------------------------------------------------------------------+
# HMDQ Tools - tools for VR headsets and other hardware introspection |
# https://github.com/risa2000/hmdq |
# |
# Copyright (c) 2019, Richard Musil. All rights reserved. |
# |
# This source code is licensed under the BSD 3-Clause "New" or "Revised" |
# License found in the LICENSE file in the root directory of this project. |
# SPDX-License-Identifier: BSD-3-Clause |
#----------------------------------------------------------------------------+
cmake_minimum_required (VERSION 3.15)
# Set policy to accept MSVC runtime selector (requires CMake >= 3.15)
cmake_policy (SET CMP0091 NEW)
# Add path for modules (helpers)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Versioning
# ============
include(gitversion)
message (STATUS "GIT_REPO_VERSION = ${GIT_REPO_VERSION}")
# Standards
# ============
set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
# CMake options
# ============
option(BUILD_TESTS "Build optional unit tests (needs Catch2 lib)" ON)
# Project root
# ============
project (hmdq_tools
VERSION ${GIT_REPO_VERSION_MAJOR}.${GIT_REPO_VERSION_MINOR}.${GIT_REPO_VERSION_PATCH}
DESCRIPTION "Tools for VR headset and other hardware introspection."
HOMEPAGE_URL "https://github.com/risa2000/hmdq"
)
# Include sub-projects.
add_subdirectory ("hmdq")
add_subdirectory ("hmdv")
if (BUILD_TESTS)
add_subdirectory ("hmdq_test")
endif (BUILD_TESTS)
# Install
# ============
install (FILES
${CMAKE_SOURCE_DIR}/api/openvr_api.json
${CMAKE_SOURCE_DIR}/res/save_data.cmd
${CMAKE_SOURCE_DIR}/README.md
${CMAKE_SOURCE_DIR}/Changelog.md
${CMAKE_SOURCE_DIR}/LICENSE
DESTINATION .
)
set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set (CPACK_PACKAGE_VENDOR $ENV{USERNAME})
set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set (CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "hmdq tools package")
set (CPACK_PACKAGE_HOMEPAGE_URL ${PROJECT_HOMEPAGE_URL})
set (CPACK_GENERATOR "ZIP" CACHE STRING "Generators to support. semi-colon delimited list")
include(CPack)