Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidAutoProtocol 1.6 Support #29

Open
wants to merge 8 commits into
base: newdev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ cmake_install.cmake
install_manifest.txt
build/**
/cmake-build-*/
.idea/
.idea/
/build/
/buildenv/
/protobuf/build/
/protobuf/cmake-build-debug/
/protobuf/.idea/
/.vscode/
209 changes: 145 additions & 64 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
cmake_minimum_required(VERSION 3.5.1)

project(aasdk)
message(STATUS "AASDK Library")
message(STATUS "Cross Compiling?")

# Cross Compiling Architecture
if( TARGET_ARCH STREQUAL "amd64" )
message("Building for amd64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
message(STATUS "...amd64")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
elseif( TARGET_ARCH STREQUAL "armhf" )
message("Building for armhf")
message(STATUS "...armhf")
set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc-8)
set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++-8)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
else()
message("Target Architecture not specified, not cross compiling")
message(STATUS "...not cross compiling")
endif()

set (aasdk_VERSION_MAJOR 3)
set (aasdk_VERSION_MINOR 1)
set (aasdk_VERSION_PATCH 0)

project(aasdk
VERSION ${aasdk_VERSION_MAJOR}.${aasdk_VERSION_MINOR}.${aasdk_VERSION_PATCH}
LANGUAGES CXX)
# Set Compile Versions
set(LIBRARY_BUILD_DATE "20241121") # Binary Release Build Date
set(LIBRARY_BUILD_MAJOR_RELEASE 4) # Binary Release Build Number (increment if released on same day)
set(LIBRARY_BUILD_MINOR_RELEASE 0) # Binary Release Build Number (increment if released on same day)
set(LIBRARY_BUILD_INCREMENTAL 0) # Binary Build Version - Increment for Each Build

# Cache
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
Expand All @@ -31,27 +35,48 @@ set(sources_directory ${base_directory}/src)
set(include_directory ${base_directory}/include)
set(include_ut_directory ${base_directory}/unit_test)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${base_directory}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${base_directory}/lib)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${base_directory}/bin)
set(EXECUTABLE_OUTPUT_PATH ${base_directory}/bin)
# Configure CMAKE
message(STATUS "Configuring CMAKE")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

SET(CMAKE_CXX_STANDARD 14)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake_modules/")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -fPIC -Wall -pedantic")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -DNDEBUG")

# Default to Release mode unless overridden with -DCMAKE_BUILD_TYPE=Debug on cmake command
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Forcing Release build type")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

# Paths
set(sources_directory ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(include_directory ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(include_ut_directory ${CMAKE_CURRENT_SOURCE_DIR}/include_ut)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)

set (CMAKE_PROJECT_VERSION_PATCH ${_commit_timestamp})

# Configure Boost
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)

add_definitions(-DBOOST_ALL_DYN_LINK)

include(${base_directory}/cmake_modules/gitversion.cmake)
set (aasdk_VERSION_PATCH ${_commit_timestamp})
set (CMAKE_PROJECT_VERSION_PATCH ${aasdk_VERSION_PATCH})
if(CMAKE_BUILD_TYPE STREQUAL "Release")
message(STATUS "Disabling Boost DEBUG logs")
add_definitions(-DNDEBUG)
endif()

if(WIN32)
set(WINSOCK2_LIBRARIES "ws2_32")
Expand All @@ -61,23 +86,32 @@ if(AASDK_TEST)
include(ExternalGtest)
endif(AASDK_TEST)

add_subdirectory(aasdk_proto)
find_package(aap_protobuf REQUIRED)

find_package(Boost REQUIRED COMPONENTS system log_setup log)
# Building on a Mac requires Abseil
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") # macOS
message(STATUS "MacOS System Detected")
find_package(protobuf REQUIRED CONFIG)
find_package(absl REQUIRED)
else ()
find_package(Protobuf REQUIRED)
endif ()

include(FindProtobuf)

find_package(Boost REQUIRED COMPONENTS system log_setup log OPTIONAL_COMPONENTS unit_test_framework)
find_package(libusb-1.0 REQUIRED)
find_package(Protobuf REQUIRED)
find_package(OpenSSL REQUIRED)

set(AASDK_PROTO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR})

include_directories(${AASDK_PROTO_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${PROTOBUF_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
${GTEST_INCLUDE_DIRS}
${GMOCK_INCLUDE_DIRS}
${include_directory}
${include_ut_directory})
include_directories(
${Boost_INCLUDE_DIRS}
${PROTOBUF_INCLUDE_DIR}
${AAP_PROTOBUF_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
${GTEST_INCLUDE_DIRS}
${GMOCK_INCLUDE_DIRS}
${include_directory}
${include_ut_directory})

file(GLOB_RECURSE source_files ${sources_directory}/*.cpp)
file(GLOB_RECURSE include_files ${include_directory}/*.hpp)
Expand All @@ -86,31 +120,76 @@ file(GLOB_RECURSE tests_include_files ${include_ut_directory}/*.hpp)

list(REMOVE_ITEM source_files ${tests_source_files})

add_library(aasdk SHARED
${source_files}
${include_files})

add_dependencies(aasdk aasdk_proto)
target_link_libraries(aasdk
aasdk_proto
libusb
${Boost_LIBRARIES}
${PROTOBUF_LIBRARIES}
${OPENSSL_LIBRARIES}
${WINSOCK2_LIBRARIES})

set(aasdk_VERSION_STRING ${aasdk_VERSION_MAJOR}.${aasdk_VERSION_MINOR}.${aasdk_VERSION_PATCH})
message(INFO " Project Version: ${aasdk_VERSION_STRING}")
set_target_properties(aasdk PROPERTIES VERSION ${aasdk_VERSION_STRING}
SOVERSION ${aasdk_VERSION_MAJOR})

install(TARGETS aasdk DESTINATION lib COMPONENT libraries)
install(DIRECTORY include/aasdk DESTINATION include COMPONENT headers)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") # macOS
message(NOTICE "Configuring STATIC Library for MacOS")
add_library(aasdk STATIC
${source_files}
${include_files})
else()
message(NOTICE "Configuring SHARED Library")
add_library(aasdk SHARED
${source_files}
${include_files})
endif()
target_include_directories(aasdk PUBLIC ${AAP_PROTOBUF_INCLUDE_DIR})

target_link_libraries(aasdk PUBLIC
libusb
${Boost_LIBRARIES}
${PROTOBUF_LIBRARIES}
${AAP_PROTOBUF_LIB_DIR}
${OPENSSL_LIBRARIES}
${WINSOCK2_LIBRARIES})


set(LIBRARY_VERSION_STRING "${LIBRARY_BUILD_MAJOR_RELEASE}.${LIBRARY_BUILD_MINOR_RELEASE}.${LIBRARY_BUILD_INCREMENTAL}+${LIBRARY_BUILD_DATE}")
message(STATUS "Project Version: ${LIBRARY_VERSION_STRING}")
set_target_properties(aasdk
PROPERTIES VERSION ${LIBRARY_VERSION_STRING} SOVERSION ${LIBRARY_BUILD_INCREMENTAL})

# Install rules
install(TARGETS aasdk libusb
EXPORT aasdkTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

# Install headers explicitly
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/aasdk
DESTINATION include
)

# Export the targets to a script
install(EXPORT aasdkTargets
FILE aasdkTargets.cmake
NAMESPACE AASDK::
DESTINATION lib/cmake/aasdk
)

# Create a Config file for FindPackage
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/aasdkConfigVersion.cmake"
VERSION 1.0
COMPATIBILITY AnyNewerVersion
)

configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/aasdkConfig.cmake"
INSTALL_DESTINATION lib/cmake/aasdk
)

# Install the config files
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/aasdkConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/aasdkConfig.cmake"
DESTINATION lib/cmake/aasdk)

if(AASDK_TEST)
add_executable(aasdk_ut
${tests_source_files}
${tests_include_files})
${tests_source_files}
${tests_include_files})

add_dependencies(aasdk_ut aasdk)
target_link_libraries(aasdk_ut
Expand All @@ -126,27 +205,29 @@ if(AASDK_TEST)
setup_target_for_coverage(NAME aasdk_coverage EXECUTABLE aasdk_ut DEPENDENCIES aasdk_ut)
endif(AASDK_CODE_COVERAGE)
endif(AASDK_TEST)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "AASDK") #required
SET(CPACK_PACKAGE_VENDOR "AASDK")
set(CPACK_PACKAGE_VERSION ${aasdk_VERSION_STRING})


set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "AASDK") #required
set(CPACK_PACKAGE_VENDOR "AASDK")
set(CPACK_PACKAGE_VERSION ${LIBRARY_VERSION_STRING})
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0-0,libboost-all-dev,libssl-dev,libprotobuf-dev")
set(CPACK_COMPONENTS_ALL libraries headers Unspecified)
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers")
set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
"Static libraries used to build programs with AASDK")
"Static libraries used to build programs with AASDK")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION
"C/C++ header files for use with AASDK")
"C/C++ header files for use with AASDK")
set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
set(CPACK_COMPONENT_HEADERS_GROUP "Development")
set(CPACK_COMPONENT_GROUP_DEVELOPMENT_EXPANDED ON)
set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
"All of the tools you'll ever need to develop software")
"All of the tools you'll ever need to develop software")
set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
set(CPACK_ALL_INSTALL_TYPES Full Developer)
set(CPACK_INSTALL_TYPE_FULL_DISPLAY_NAME "Everything")
set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full)
set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
INCLUDE(CPack)
include(CPack)
3 changes: 3 additions & 0 deletions Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(AASDK_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@)
set(AASDK_LIB_DIRS @CMAKE_INSTALL_FULL_LIBDIR@)
include("${CMAKE_CURRENT_LIST_DIR}/aasdkTargets.cmake")
10 changes: 10 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Release Notes
=============
20241120 - 2.0.1
- Restructure AASDK Proto Protobuf files for Android Auto 1.6 Support based on information from https://milek7.pl/.stuff/galdocs/readme.md
This fleshes out enums and other methods with their full naming conventions for better readability and understanding.
- Restructure AASDK source/header with additional renames to clarify differences between AudioService, VideoService and AVInput. Updated to MediaSinkService which is extended by AudioMediaSinkService and VideoMediaSinkService which themselves are extended by the individual service channels.
- Added initial GenericNotification, MediaBrowser, MediaPlaybackStatus, PhoneStatus, Radio, VendorExtension and WifiProjection services.
- Update AASDK_LOG entries for extra consistency
- Simplify CMAKE to build and install keeping parameters to a minimum. Default to Release mode and Raspberry PI build unless otherwise specified.
-
35 changes: 0 additions & 35 deletions aasdk_proto/AVChannelData.proto

This file was deleted.

39 changes: 0 additions & 39 deletions aasdk_proto/AVChannelMessageIdsEnum.proto

This file was deleted.

Loading