Skip to content

Commit

Permalink
Add nanopb as an external submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Jun 17, 2024
1 parent e923a89 commit 7dbce97
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 4,418 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
[submodule "external/sdbus-cpp"]
path = external/sdbus-cpp
url = https://github.com/Kistler-Group/sdbus-cpp
[submodule "external/nanopb"]
path = external/nanopb
url = https://github.com/nanopb/nanopb.git
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,8 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_D
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/packages.cmake)

# external targets
if (WIN32 AND TARGET flatbuffers AND TARGET lunasvg AND TARGET flatc AND TARGET qmqtt AND TARGET liblzma AND TARGET sqlite3)
set_target_properties(qmqtt flatbuffers lunasvg flatc resources uninstall liblzma sqlite3 PROPERTIES FOLDER ExternalLibsTargets)
if (WIN32 AND TARGET flatbuffers AND TARGET protobuf-nanopb AND TARGET lunasvg AND TARGET flatc AND TARGET qmqtt AND TARGET liblzma AND TARGET sqlite3)
set_target_properties(qmqtt flatbuffers protobuf-nanopb lunasvg flatc resources uninstall liblzma sqlite3 PROPERTIES FOLDER ExternalLibsTargets)
else()
set_target_properties(resources uninstall PROPERTIES FOLDER ExternalLibsTargets)
endif()
Expand Down
6 changes: 3 additions & 3 deletions cmake/installers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ macro(DeployUnix TARGET)
# HyperHDR bin & res
install ( TARGETS hyperhdr DESTINATION "share/hyperhdr/bin" COMPONENT "HyperHDR" )
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/linux/service DESTINATION "share/hyperhdr/" COMPONENT "HyperHDR" )
install ( FILES ${CMAKE_SOURCE_DIR}/cmake/resources/hyperhdr-icon-32px.png DESTINATION "share/hyperhdr/icons" COMPONENT "HyperHDR" )
install ( FILES ${CMAKE_SOURCE_DIR}/cmake/resources/hyperhdr_128.png DESTINATION "share/hyperhdr/desktop" COMPONENT "HyperHDR" )
install ( FILES ${CMAKE_SOURCE_DIR}/cmake/resources/hyperhdr.desktop DESTINATION "share/hyperhdr/desktop" COMPONENT "HyperHDR" )
install ( FILES ${CMAKE_SOURCE_DIR}/cmake/linux/resources/hyperhdr-icon-32px.png DESTINATION "share/hyperhdr/icons" COMPONENT "HyperHDR" )
install ( FILES ${CMAKE_SOURCE_DIR}/cmake/linux/resources/hyperhdr_128.png DESTINATION "share/hyperhdr/desktop" COMPONENT "HyperHDR" )
install ( FILES ${CMAKE_SOURCE_DIR}/cmake/linux/resources/hyperhdr.desktop DESTINATION "share/hyperhdr/desktop" COMPONENT "HyperHDR" )


# Our and custom libs
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SET ( CPACK_PACKAGE_CONTACT "see_me_at@hyperhdr.eu")
SET ( CPACK_PACKAGE_VENDOR "HyperHDR")
SET ( CPACK_PACKAGE_EXECUTABLES "hyperhdr;HyperHDR" )
SET ( CPACK_PACKAGE_INSTALL_DIRECTORY "HyperHDR" )
SET ( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/resources/hyperhdr-icon-32px.png")
SET ( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/linux/resources/hyperhdr-icon-32px.png")

SET ( CPACK_PACKAGE_VERSION_MAJOR "${HYPERHDR_VERSION_MAJOR}")
SET ( CPACK_PACKAGE_VERSION_MINOR "${HYPERHDR_VERSION_MINOR}")
Expand Down
22 changes: 22 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ target_compile_definitions(sqlite3 PUBLIC
SQLITE_OMIT_DEPRECATED
)

#=============================================================================
# Protobuf-nanopb
#=============================================================================

set(PROTOBUF-NANOPB-SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/nanopb/pb.h
${CMAKE_CURRENT_SOURCE_DIR}/nanopb/pb_common.h
${CMAKE_CURRENT_SOURCE_DIR}/nanopb/pb_common.c
${CMAKE_CURRENT_SOURCE_DIR}/nanopb/pb_encode.h
${CMAKE_CURRENT_SOURCE_DIR}/nanopb/pb_encode.c
${CMAKE_CURRENT_SOURCE_DIR}/nanopb/pb_decode.h
${CMAKE_CURRENT_SOURCE_DIR}/nanopb/pb_decode.c)

add_library(protobuf-nanopb STATIC ${PROTOBUF-NANOPB-SOURCES})
set_target_properties(protobuf-nanopb PROPERTIES OUTPUT_NAME protobuf-nanopb)
install(TARGETS protobuf-nanopb EXPORT nanopb-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

target_include_directories(protobuf-nanopb INTERFACE
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/nanopb>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)

#=============================================================================
# RPi ws281x
#=============================================================================
Expand Down
1 change: 1 addition & 0 deletions external/nanopb
Submodule nanopb added at 6cfe48
2 changes: 1 addition & 1 deletion include/proto-nano-server/message.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#ifndef PB_PROTO_MESSAGE_PB_H_INCLUDED
#define PB_PROTO_MESSAGE_PB_H_INCLUDED
#include <pb.h>
#include <nanopb/pb.h>

#if PB_PROTO_HEADER_VERSION != 40
#error Regenerate this file with the current version of nanopb generator.
Expand Down
Loading

0 comments on commit 7dbce97

Please sign in to comment.