-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAF-763 release fleet protocol as a package (#15)
* remade cmake files to be able to create a header only package * Fix protobuf * Write TODOs * Use CMDEF_ADD_LIBRARY, remove namespace aliases * Fix protobuf parsing example * Remove todo, commented code, origin_install_rpath * Use NAMESPACE * Namespace Tree structure * Change version * Fix Includes * remove prefix from error_codes files. readme update * Use cached variables --------- Co-authored-by: mario <[email protected]>
- Loading branch information
1 parent
68397c8
commit 309e180
Showing
28 changed files
with
267 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 3.25 FATAL_ERROR) | ||
PROJECT(fleet-protocol-common-headers C CXX) | ||
PROJECT(fleet-protocol C CXX) | ||
|
||
ADD_LIBRARY(common_headers INTERFACE) | ||
TARGET_INCLUDE_DIRECTORIES(common_headers INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/>" | ||
"$<INSTALL_INTERFACE:include/>") | ||
CMDEF_ADD_LIBRARY( | ||
LIBRARY_GROUP common-headers | ||
TYPE INTERFACE | ||
VERSION ${FLEET_PROTOCOL_VERSION} | ||
INCLUDE_DIRECTORIES include/ | ||
INSTALL_INCLUDE_DIRECTORIES include/ | ||
) | ||
|
||
FILE(GLOB_RECURSE include_files include/*) | ||
TARGET_SOURCES(common_headers INTERFACE | ||
FILE_SET common_headers TYPE HEADERS FILES ${include_files} BASE_DIRS include) | ||
|
||
ADD_LIBRARY(fleet-protocol::common_headers ALIAS common_headers) | ||
CMDEF_INSTALL( | ||
TARGET common-headers-interface | ||
NAMESPACE ${FLEET_PROTOCOL_NAMESPACE} | ||
) |
2 changes: 1 addition & 1 deletion
2
...ommon_headers/include/device_management.h → ...otocol/common_headers/device_management.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 3.25 FATAL_ERROR) | ||
PROJECT(fleet-protocol-internal-client C CXX) | ||
PROJECT(fleet-protocol C CXX) | ||
|
||
ADD_LIBRARY(internal_client_interface INTERFACE) | ||
TARGET_INCLUDE_DIRECTORIES(internal_client_interface INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/>" | ||
"$<INSTALL_INTERFACE:include/>") | ||
TARGET_LINK_LIBRARIES(internal_client_interface INTERFACE fleet-protocol::common_headers) | ||
CMDEF_ADD_LIBRARY( | ||
LIBRARY_GROUP internal-client | ||
TYPE INTERFACE | ||
VERSION ${FLEET_PROTOCOL_VERSION} | ||
INCLUDE_DIRECTORIES include/ | ||
INSTALL_INCLUDE_DIRECTORIES include/ | ||
) | ||
TARGET_LINK_LIBRARIES(internal-client-interface INTERFACE common-headers-interface) | ||
|
||
FILE(GLOB_RECURSE include_files include/*) | ||
TARGET_SOURCES(internal_client_interface INTERFACE | ||
FILE_SET internal_client_interface TYPE HEADERS FILES ${include_files} BASE_DIRS include) | ||
|
||
ADD_LIBRARY(fleet-protocol::internal_client_interface ALIAS internal_client_interface) | ||
CMDEF_INSTALL( | ||
TARGET internal-client-interface | ||
NAMESPACE ${FLEET_PROTOCOL_NAMESPACE} | ||
) | ||
|
2 changes: 1 addition & 1 deletion
2
lib/internal_client/include/ic_error_codes.h → ...et_protocol/internal_client/error_codes.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 3.25 FATAL_ERROR) | ||
PROJECT(fleet-protocol C CXX) | ||
|
||
ADD_LIBRARY(module_gateway INTERFACE) | ||
TARGET_INCLUDE_DIRECTORIES(module_gateway INTERFACE include/) | ||
TARGET_LINK_LIBRARIES(module_gateway INTERFACE ${PROJECT_NAME}::common_headers) | ||
|
||
FILE(GLOB_RECURSE include_files include/*) | ||
TARGET_SOURCES(module_gateway INTERFACE | ||
FILE_SET module_gateway TYPE HEADERS FILES ${include_files} BASE_DIRS include) | ||
|
||
ADD_LIBRARY(${PROJECT_NAME}::module_gateway ALIAS module_gateway ) | ||
CMDEF_ADD_LIBRARY( | ||
LIBRARY_GROUP module-gateway | ||
TYPE INTERFACE | ||
VERSION ${FLEET_PROTOCOL_VERSION} | ||
INCLUDE_DIRECTORIES include/ | ||
INSTALL_INCLUDE_DIRECTORIES include/ | ||
) | ||
TARGET_LINK_LIBRARIES(module-gateway-interface INTERFACE common-headers-interface) | ||
CMDEF_INSTALL( | ||
TARGET module-gateway-interface | ||
NAMESPACE ${FLEET_PROTOCOL_NAMESPACE} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/module_gateway/include/mg_error_codes.h → ...eet_protocol/module_gateway/error_codes.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.