-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Using cmake target export * CPack configuration * Updated doxygen-awesome-css to v2.3.1 * Fixed wrong project title. Whoops. * Removed "lib" prefix from project name, as CMake adds this automatically * Updated maintainer information * Updated README * Added lib prefix to cpack package name * Updated gitignore * Added new "docs" target for HTML Doxygen generation * Updated CPack config to generate .debs, .rpms, etc. * Added new workflow --------- Co-authored-by: Simon Cahill <[email protected]>
- Loading branch information
1 parent
c520dcc
commit 621383e
Showing
10 changed files
with
162 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: CMake | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt update | ||
sudo apt-get update | ||
sudo apt-get -y install can-utils libsocketcan-dev | ||
while read -r cmd | ||
do | ||
eval sudo $cmd | ||
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
# Build your program with the given configuration | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
|
||
- name: Pack | ||
working-directory: ${{github.workspace}}/build | ||
# Execute tests defined by the CMake configuration. | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: cpack . | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# these are cache variables, so they could be overwritten with -D, | ||
set(CPACK_PACKAGE_NAME lib${PROJECT_NAME} | ||
CACHE STRING "The resulting package name" | ||
) | ||
|
||
# which is useful in case of packing only selected components instead of the whole thing | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A socketcan wrapper library for C++" | ||
CACHE STRING "Package description for the package metadata" | ||
) | ||
|
||
set(CPACK_VERBATIM_VARIABLES YES) | ||
|
||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) | ||
SET(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/packages") | ||
|
||
# https://unix.stackexchange.com/a/11552/254512 | ||
#set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/some")#/${CMAKE_PROJECT_VERSION}") | ||
|
||
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_PACKAGE_CONTACT "[email protected]") | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Simon Cahill") | ||
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") | ||
|
||
# package name for deb. If set, then instead of some-application-0.9.2-Linux.deb | ||
# you'll get some-application_0.9.2_amd64.deb (note the underscores too) | ||
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) | ||
|
||
# that is if you want every group to have its own package, | ||
# although the same will happen if this is not set (so it defaults to ONE_PER_GROUP) | ||
# and CPACK_DEB_COMPONENT_INSTALL is set to YES | ||
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)#ONE_PER_GROUP) | ||
|
||
# without this you won't be able to pack only specified component | ||
set(CPACK_DEB_COMPONENT_INSTALL YES) | ||
|
||
set(CPACK_GENERATOR TGZ DEB TZ STGZ RPM ZIP) | ||
|
||
include(CPack) |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# include(CMakeFindDependencyMacro) | ||
# find_dependency(xxx 2.0) | ||
include(${CMAKE_CURRENT_LIST_DIR}/libsockcanppTargets.cmake) |
Submodule doxygen-awesome-css
updated
39 files
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.23) | ||
|
||
target_sources(${PROJECT_NAME} | ||
PUBLIC FILE_SET HEADERS | ||
BASE_DIRS ${CMAKE_CURRENT_LIST_DIR} | ||
FILES | ||
CanDriver.hpp | ||
CanId.hpp | ||
CanMessage.hpp | ||
) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target_sources(${PROJECT_NAME} | ||
PRIVATE | ||
${CMAKE_CURRENT_LIST_DIR}/CanDriver.cpp | ||
) |
lib
prefix missed.lib${PROJECT_NAME}ConfigVersion.cmake
is expected bellow.