-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
60 lines (50 loc) · 1.76 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.25 FATAL_ERROR)
PROJECT(fleet-protocol C CXX)
SET(FLEET_PROTOCOL_VERSION 2.0.0)
SET(FLEET_PROTOCOL_NAMESPACE "fleet-protocol-interface::")
OPTION(BRINGAUTO_PACKAGE "Package creation" OFF)
OPTION(BRINGAUTO_INSTALL "Enable install" OFF)
OPTION(BRINGAUTO_SAMPLES "Enable build of sample app, not used in project" OFF)
IF(BRINGAUTO_PACKAGE)
IF(NOT BRINGAUTO_INSTALL)
SET(BRINGAUTO_INSTALL ON CACHE BOOL "Forced install due to BRINGAUTO_PACKAGE=ON" FORCE)
MESSAGE(WARNING "BRINGAUTO_INSTALL is switched to on because of BRINGAUTO_PACKAGE=ON")
ENDIF()
ENDIF()
FIND_PACKAGE(CMLIB
COMPONENTS CMDEF CMUTIL
REQUIRED
)
IF(BRINGAUTO_SAMPLES)
ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/examples")
ENDIF()
ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/lib")
ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/protobuf")
CMDEF_ADD_LIBRARY(
LIBRARY_GROUP fleet-protocol
TYPE INTERFACE
VERSION ${FLEET_PROTOCOL_VERSION}
)
TARGET_LINK_LIBRARIES(fleet-protocol-interface INTERFACE
common-headers-interface
internal-client-interface
module-gateway-interface
module-maintainer-external-server-interface
module-maintainer-module-gateway-interface
protobuf-cpp-interface
)
IF (BRINGAUTO_INSTALL)
CMDEF_INSTALL(
TARGET fleet-protocol-interface
NAMESPACE ${FLEET_PROTOCOL_NAMESPACE}
)
ENDIF ()
IF (BRINGAUTO_PACKAGE)
CMDEF_PACKAGE(
MAIN_TARGET fleet-protocol-interface
VERSION ${FLEET_PROTOCOL_VERSION}
)
SET(CPACK_GENERATOR ZIP)
SET(CPACK_PACKAGE_CONTACT "BringAuto s.r.o. <[email protected]>")
INCLUDE(CPack)
ENDIF()