This repository has been archived by the owner on May 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
154 lines (128 loc) · 4.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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
cmake_minimum_required(VERSION 3.16)
project(
libmueb
VERSION 2.0
DESCRIPTION "Network library for Schönherz Mátrix packet sending"
HOMEPAGE_URL "kszk.bme.hu"
LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(GNUInstallDirs)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
find_package(
Qt5
COMPONENTS Core Gui Network
REQUIRED)
add_compile_definitions(LIBMUEB_LIBRARY)
if(BUILD_SHARED_LIBS)
add_compile_definitions(LIBMUEB_AS_DLL)
endif()
add_library(
mueb
src/framecompressor.cpp
src/framecompressor.h
src/muebtransmitter.cpp
src/datagramprocessor.h
src/datagramprocessor.cpp
src/muebreceiver.cpp
src/muebcontroller.cpp
include/libmueb/mueb.h
include/libmueb/libmueb_global.h
include/libmueb/muebtransmitter.h
include/libmueb/muebreceiver.h
include/libmueb/libmuebconfig.h
include/libmueb/muebcontroller.h)
add_library(
muebtransmitter
src/framecompressor.cpp src/framecompressor.h src/muebtransmitter.cpp
include/libmueb/libmueb_global.h include/libmueb/muebtransmitter.h
include/libmueb/libmuebconfig.h)
add_library(
muebreceiver
src/datagramprocessor.h src/datagramprocessor.cpp src/muebreceiver.cpp
include/libmueb/libmueb_global.h include/libmueb/muebreceiver.h
include/libmueb/libmuebconfig.h)
add_library(libmueb::mueb ALIAS mueb)
add_library(libmueb::muebtransmitter ALIAS muebtransmitter)
add_library(libmueb::muebreceiver ALIAS muebreceiver)
target_include_directories(
mueb
PUBLIC $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}>)
target_include_directories(
muebtransmitter
PUBLIC $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}>)
target_include_directories(
muebreceiver
PUBLIC $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}>)
target_link_libraries(
mueb
PUBLIC Qt5::Core Qt5::Gui
PRIVATE Qt5::Network)
target_link_libraries(
muebtransmitter
PUBLIC Qt5::Core Qt5::Gui
PRIVATE Qt5::Network)
target_link_libraries(
muebreceiver
PUBLIC Qt5::Core Qt5::Gui
PRIVATE Qt5::Network)
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
set(version_config
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
set(project_config "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
set(namespace "${PROJECT_NAME}::")
include(CMakePackageConfigHelpers)
write_basic_package_version_file("${version_config}"
COMPATIBILITY SameMajorVersion)
configure_package_config_file("cmake/Config.cmake.in" "${project_config}"
INSTALL_DESTINATION "${config_install_dir}")
install(
TARGETS mueb
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
INCLUDES
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}")
install(
TARGETS muebreceiver
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
INCLUDES
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}")
install(
TARGETS muebtransmitter
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
INCLUDES
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}")
install(DIRECTORY "include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES "${project_config}" "${version_config}"
DESTINATION "${config_install_dir}")
install(
EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${namespace}"
DESTINATION "${config_install_dir}")
export(
EXPORT ${TARGETS_EXPORT_NAME}
FILE "${TARGETS_EXPORT_NAME}.cmake"
NAMESPACE "${namespace}")
set(CPACK_PACKAGE_VENDOR ${PROJECT_HOMEPAGE_URL})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION})
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_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
include(CPack)