Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Sep 24, 2024
2 parents 4fd56df + ff34725 commit 0464c12
Show file tree
Hide file tree
Showing 13 changed files with 159 additions and 106 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-latest]
os: [ubuntu-20.04, ubuntu-latest]

steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: development
submodules: recursive

- name: Checkout vscp repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: grodansparadis/vscp
path: vscp
ref: master
ref: development

- name: Checkout google test repo
run: sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo mkdir build && cd build && sudo cmake .. && sudo make DESTDIR=/usr/lib
Expand Down Expand Up @@ -64,7 +67,7 @@ jobs:
sudo cpack -G DEB
sudo make install DESTDIR=AppDir
# Save artifact
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_libvscphelper_15.0.2.deb
path: /home/runner/work/vscp-helper-lib/vscp-helper-lib/build/libvscphelper_15.0.2.deb
Expand Down
40 changes: 27 additions & 13 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,60 @@ on: [push]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
VSCP_PATH: '${{ github.workspace }}/vscp'
ENVIRONMENT_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
GENERATORS: "Visual Studio 17 2022"
BUILD_CONFIGURATION: Release

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
#
# https://github.com/marketplace/actions/run-vcpkg
# https://github.com/ilammy/msvc-dev-cmd

BUILD_CONFIGURATION: Release
# https://github.com/ilammy/msvc-dev-cmd

jobs:
build:
name: Windows x64
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1

- name: Install ms-dev environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: development
submodules: recursive

- name: Checkout vscp repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: grodansparadis/vscp
path: vscp
ref: development
submodules: recursive

- name: Get latest CMake and ninja
# Using 'latest' branch, the most recent CMake and ninja are installed.
uses: lukka/get-cmake@latest

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Checkout vcpkg repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: microsoft/vcpkg
path: vcpkg

- name: Add MSBuild to PATH
uses: microsoft/[email protected]
with:
msbuild-architecture: x64

- name: Setup vcpkg
run: |
cd vcpkg
Expand All @@ -65,9 +78,10 @@ jobs:
- name: Build
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=D:/a/vscp-helper-lib/vscp-helper-lib/vcpkg/scripts/buildsystems/vcpkg.cmake -DVSCP_PATH=vscp
msbuild libvscphelper.sln /p:Configuration=Release
cd build
cmake .. -G "${{ env.GENERATORS }}" -A x64 -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=${{ env.BUILD_CONFIGURATION }} -DCMAKE_TOOLCHAIN_FILE=D:/a/vscp-helper-lib/vscp-helper-lib/vcpkg/scripts/buildsystems/vcpkg.cmake -DVSCP_PATH=vscp
cmake --build . --config ${{ env.BUILD_CONFIGURATION }}
#msbuild libvscphelper.sln /p:Configuration=Release
cpack .
# Save artifacts
Expand Down
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "third_party/mustache"]
path = third_party/mustache
url = https://github.com/kainjow/Mustache.git
[submodule "third_party/spdlog"]
path = third_party/spdlog
url = https://github.com/gabime/spdlog.git
[submodule "third_party/nlohmann"]
path = third_party/nlohmann
url = https://github.com/nlohmann/json.git
[submodule "third_party/mongoose"]
path = third_party/mongoose
url = https://github.com/cesanta/mongoose.git
185 changes: 101 additions & 84 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Build instructions for VSCP Works.
#
# Copyright (c) 2000-2023 Åke Hedman, the VSCP Project
# Copyright (C) 2000-2024 Åke Hedman, the VSCP Project
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -32,15 +32,17 @@ set(PACKAGE_AUTHOR "Ake Hedman, the VSCP Project")

# Version settings
if(NOT DEFINED MAJOR_VERSION)
SET(MAJOR_VERSION "15")
SET(MAJOR_VERSION "16")
endif()
if(NOT DEFINED MINOR_VERSION)
SET(MINOR_VERSION "0")
endif()
if(NOT DEFINED PATCH_VERSION)
SET(PATCH_VERSION "2")
SET(PATCH_VERSION "0")
endif()

#add_subdirectory(./third_party/spdlog/)

SET(CPACK_PACKAGE_DESCRIPTION "VSCP Helper library")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Helper functionality for VSCP applications")
SET(CPACK_PACKAGE_VENDOR "the VSCP Project")
Expand Down Expand Up @@ -75,8 +77,8 @@ endif()

option(USE_SSL "Use SSL" TRUE)

## --- C++11 build flags ---
set(CMAKE_CXX_STANDARD 11)
## --- C++14 build flags ---
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)

Expand Down Expand Up @@ -208,11 +210,34 @@ endif(WIN32)

# Set sockettcp build flags
add_definitions(-DUSE_IPV6)
string(FIND "${OPENSSL_VERSION}" "1.1." SSL_VER_POS)

set(OPENSSL_VER "OPENSSL_API_${OPENSSL_VERSION_MAJOR}_${OPENSSL_VERSION_MINOR}")
message(STATUS "OPENSSL Version: ${OPENSSL_VER}")
add_definitions(-D${OPENSSL_VER})

# 1.1.0 / 1.1.1 / 3.0.0 / 3.1.0
string(FIND "${OPENSSL_VERSION}" "1.0" SSL_VER_POS)
if(${SSL_VER_POS})
add_definitions(-DOPENSSL_API_1_0)
else()
add_definitions(-DOPENSSL_API_1_1)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL_API_1_0")
#add_definitions(-DOPENSSL_API_1_0)
endif()

string(FIND "${OPENSSL_VERSION}" "1.1" SSL_VER_POS)
if(${SSL_VER_POS})
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL_API_1_1")
#add_definitions(-DOPENSSL_API_1_1)
endif()

string(FIND "${OPENSSL_VERSION}" "3.0" SSL_VER_POS)
if(NOT SSL_VER_POS EQUAL -1)
#add_definitions(-DOPENSSL_API_3_0)
message(STATUS "openssl test ${SSL_VER_POS}")
endif()

string(FIND "${OPENSSL_VERSION}" "3.1" SSL_VER_POS)
if(NOT SSL_VER_POS EQUAL -1)
add_definitions(-DOPENSSL_API_3_0)
message(STATUS "Open ssl version is 3.1 but set to 3.0 ${SSL_VER_POS} fir Civetweb. That is OK")
endif()

set(RESOURCE_FILES
Expand All @@ -226,69 +251,61 @@ add_library(libvscphelper SHARED
./src/vscphelperlib.cpp
./windows/libvscphelper.h
./windows/libvscphelper.cpp
${VSCP_PATH}/src/common/third_party/mustache.hpp
${VSCP_PATH}/src/common/third_party/spdlog-1.9.2/include
${VSCP_PATH}/src/vscp/common/vscp.h
${VSCP_PATH}/src/vscp/common/vscpremotetcpif.h
${VSCP_PATH}/src/vscp/common/vscpremotetcpif.cpp
${VSCP_PATH}/src/vscp/common/vscpdatetime.h
${VSCP_PATH}/src/vscp/common/vscpdatetime.cpp
${VSCP_PATH}/src/vscp/common/guid.h
${VSCP_PATH}/src/vscp/common/guid.cpp
# ${VSCP_PATH}/src/vscp/common/mdf.h
# ${VSCP_PATH}/src/vscp/common/mdf.cpp
${VSCP_PATH}/src/vscp/common/vscphelper.h
${VSCP_PATH}/src/vscp/common/vscphelper.cpp
${VSCP_PATH}/src/vscp/common/canal.h
${VSCP_PATH}/src/common/sockettcp.h
${VSCP_PATH}/src/common/sockettcp.c
${VSCP_PATH}/src/common/vscpbase64.h
${VSCP_PATH}/src/common/vscpbase64.c
${VSCP_PATH}/src/common/vscp_aes.h
${VSCP_PATH}/src/common/vscp_aes.c
${VSCP_PATH}/src/common/crc.h
${VSCP_PATH}/src/common/crc.c
${VSCP_PATH}/src/common/crc8.h
${VSCP_PATH}/src/common/crc8.c
${VSCP_PATH}/src/common/vscpmd5.h
${VSCP_PATH}/src/common/vscpmd5.c
${VSCP_PATH}/src/common/fastpbkdf2.h
${VSCP_PATH}/src/common/fastpbkdf2.c
./third_party/mustache/mustache.hpp
./third_party/spdlog/include
$ENV{VSCP_ROOT}/src/vscp/common/vscp.h
$ENV{VSCP_ROOT}/src/vscp/common/vscpremotetcpif.h
$ENV{VSCP_ROOT}/src/vscp/common/vscpremotetcpif.cpp
$ENV{VSCP_ROOT}/src/vscp/common/vscpdatetime.h
$ENV{VSCP_ROOT}/src/vscp/common/vscpdatetime.cpp
$ENV{VSCP_ROOT}/src/vscp/common/guid.h
$ENV{VSCP_ROOT}/src/vscp/common/guid.cpp
$ENV{VSCP_ROOT}/src/vscp/common/vscphelper.h
$ENV{VSCP_ROOT}/src/vscp/common/vscphelper.cpp
$ENV{VSCP_ROOT}/src/vscp/common/canal.h
$ENV{VSCP_ROOT}/src/common/sockettcp.h
$ENV{VSCP_ROOT}/src/common/sockettcp.c
$ENV{VSCP_ROOT}/src/common/vscpbase64.h
$ENV{VSCP_ROOT}/src/common/vscpbase64.c
$ENV{VSCP_ROOT}/src/common/vscp-aes.h
$ENV{VSCP_ROOT}/src/common/vscp-aes.c
$ENV{VSCP_ROOT}/src/common/crc.h
$ENV{VSCP_ROOT}/src/common/crc.c
$ENV{VSCP_ROOT}/src/common/crc8.h
$ENV{VSCP_ROOT}/src/common/crc8.c
$ENV{VSCP_ROOT}/src/common/vscpmd5.h
$ENV{VSCP_ROOT}/src/common/vscpmd5.c
)
else()
add_library(libvscphelper SHARED
./src/vscphelperlib.h
./src/vscphelperlib.cpp
./linux/libvscphelper.h
./linux/libvscphelper.cpp
${VSCP_PATH}/src/common/third_party/mustache.hpp
${VSCP_PATH}/src/common/third_party/spdlog-1.9.2/include
${VSCP_PATH}/src/vscp/common/vscp.h
${VSCP_PATH}/src/vscp/common/vscpremotetcpif.h
${VSCP_PATH}/src/vscp/common/vscpremotetcpif.cpp
${VSCP_PATH}/src/vscp/common/vscpdatetime.h
${VSCP_PATH}/src/vscp/common/vscpdatetime.cpp
${VSCP_PATH}/src/vscp/common/guid.h
${VSCP_PATH}/src/vscp/common/guid.cpp
# ${VSCP_PATH}/src/vscp/common/mdf.h
# ${VSCP_PATH}/src/vscp/common/mdf.cpp
${VSCP_PATH}/src/vscp/common/vscphelper.h
${VSCP_PATH}/src/vscp/common/vscphelper.cpp
${VSCP_PATH}/src/vscp/common/canal.h
${VSCP_PATH}/src/common/sockettcp.h
${VSCP_PATH}/src/common/sockettcp.c
${VSCP_PATH}/src/common/vscpbase64.h
${VSCP_PATH}/src/common/vscpbase64.c
${VSCP_PATH}/src/common/vscp_aes.h
${VSCP_PATH}/src/common/vscp_aes.c
${VSCP_PATH}/src/common/crc.h
${VSCP_PATH}/src/common/crc.c
${VSCP_PATH}/src/common/crc8.h
${VSCP_PATH}/src/common/crc8.c
${VSCP_PATH}/src/common/vscpmd5.h
${VSCP_PATH}/src/common/vscpmd5.c
${VSCP_PATH}/src/common/fastpbkdf2.h
${VSCP_PATH}/src/common/fastpbkdf2.c
./third_party/mustache/mustache.hpp
./third_party/spdlog/include
$ENV{VSCP_ROOT}/src/vscp/common/vscp.h
$ENV{VSCP_ROOT}/src/vscp/common/vscpremotetcpif.h
$ENV{VSCP_ROOT}/src/vscp/common/vscpremotetcpif.cpp
$ENV{VSCP_ROOT}/src/vscp/common/vscpdatetime.h
$ENV{VSCP_ROOT}/src/vscp/common/vscpdatetime.cpp
$ENV{VSCP_ROOT}/src/vscp/common/guid.h
$ENV{VSCP_ROOT}/src/vscp/common/guid.cpp
$ENV{VSCP_ROOT}/src/vscp/common/vscphelper.h
$ENV{VSCP_ROOT}/src/vscp/common/vscphelper.cpp
$ENV{VSCP_ROOT}/src/vscp/common/canal.h
$ENV{VSCP_ROOT}/src/common/sockettcp.h
$ENV{VSCP_ROOT}/src/common/sockettcp.c
$ENV{VSCP_ROOT}/src/common/vscpbase64.h
$ENV{VSCP_ROOT}/src/common/vscpbase64.c
$ENV{VSCP_ROOT}/src/common/vscp-aes.h
$ENV{VSCP_ROOT}/src/common/vscp-aes.c
$ENV{VSCP_ROOT}/src/common/crc.h
$ENV{VSCP_ROOT}/src/common/crc.c
$ENV{VSCP_ROOT}/src/common/crc8.h
$ENV{VSCP_ROOT}/src/common/crc8.c
$ENV{VSCP_ROOT}/src/common/vscpmd5.h
$ENV{VSCP_ROOT}/src/common/vscpmd5.c
)
endif()

Expand Down Expand Up @@ -320,23 +337,23 @@ if (WIN32)

include_directories( PUBLIC src/
./windows/
${VSCP_PATH}/src/vscp/common/
${VSCP_PATH}/src/common
${VSCP_PATH}/src/common/third_party
${VSCP_PATH}/src/common/third_party/nlohmann
${VSCP_PATH}/src/common/third_party/spdlog-1.9.2/include
$ENV{VSCP_ROOT}/src/vscp/common/
$ENV{VSCP_ROOT}/src/common
$ENV{VSCP_ROOT}/src/common/third_party
./third_party/nlohmann/include/
./third_party/spdlog/include
${PThreads4W_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
${OPENSSL_INCLUDE_DIR}
${LOCAL_WIN_INCLUDE}
${LOCAL_SYSLOG_INCLUDE} )
else()
include_directories( PUBLIC src/
${VSCP_PATH}/src/vscp/common/
${VSCP_PATH}/src/common
${VSCP_PATH}/src/common/third_party
${VSCP_PATH}/src/common/third_party/nlohmann
${VSCP_PATH}/src/common/third_party/spdlog-1.9.2/include
$ENV{VSCP_ROOT}/src/vscp/common/
$ENV{VSCP_ROOT}/src/common
$ENV{VSCP_ROOT}/src/common/third_party
./third_party/nlohmann/include/
./third_party/spdlog/include/
${CMAKE_BINARY_DIR}
${OPENSSL_INCLUDE_DIR}
${LOCAL_SYSLOG_INCLUDE} )
Expand Down Expand Up @@ -391,11 +408,11 @@ if(WIN32)
DESTINATION ${CMAKE_INSTALL_BINDIR}/..)

# Headers
INSTALL( FILES "${VSCP_PATH}/src/vscp/common/vscp.h"
INSTALL( FILES "$ENV{VSCP_ROOT}/src/vscp/common/vscp.h"
"${CMAKE_SOURCE_DIR}/src/vscphelperlib.h"
"${VSCP_PATH}/src/vscp/common/canal.h"
"${VSCP_PATH}/src/vscp/common/vscp_class.h"
"${VSCP_PATH}/src/vscp/common/vscp_type.h"
"$ENV{VSCP_ROOT}/src/vscp/common/canal.h"
"$ENV{VSCP_ROOT}/src/vscp/common/vscp_class.h"
"$ENV{VSCP_ROOT}/src/vscp/common/vscp_type.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

else()
Expand All @@ -410,12 +427,12 @@ else()
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)

# Headers
INSTALL(FILES "${VSCP_PATH}/src/vscp/common/vscp.h"
INSTALL(FILES "$ENV{VSCP_ROOT}/src/vscp/common/vscp.h"
"${PROJECT_SOURCE_DIR}/src/vscphelperlib.h"
"${VSCP_PATH}/src/vscp/common/canal.h"
"${VSCP_PATH}/src/vscp/common/vscp_class.h"
"${VSCP_PATH}/src/vscp/common/vscp_type.h"
"$ENV{VSCP_ROOT}/src/vscp/common/canal.h"
"$ENV{VSCP_ROOT}/src/vscp/common/vscp_class.h"
"$ENV{VSCP_ROOT}/src/vscp/common/vscp_type.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()



Loading

0 comments on commit 0464c12

Please sign in to comment.