From 3b3c671b7863014f752353560e4f801a310b77e2 Mon Sep 17 00:00:00 2001 From: William C Bonner Date: Fri, 22 Sep 2023 14:17:27 -0700 Subject: [PATCH 1/2] Use CTest --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21058f9..b283dff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,9 +41,9 @@ jobs: - name: Build run: cmake --build build - - name: Run `goveebttemplogger --help` + - name: Test working-directory: build - run: ./goveebttemplogger --help + run: ctest --verbose - name: Make `deb` file working-directory: build From 8a633aa196dbc7560393bc41f41ce774d93f1c57 Mon Sep 17 00:00:00 2001 From: William C Bonner Date: Fri, 22 Sep 2023 15:27:29 -0700 Subject: [PATCH 2/2] modified: .github/workflows/ci.yml modified: CMakeLists.txt --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b283dff..c88bede 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: run: cmake -S . -B build - name: Build - run: cmake --build build + run: cmake --build build --config Release - name: Test working-directory: build diff --git a/CMakeLists.txt b/CMakeLists.txt index 32c208b..b59dcf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,8 @@ if (POLICY CMP0141) set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") endif() -project ("goveebttemplogger" - VERSION 2.20230922.3 +project (GoveeBTTempLogger + VERSION 2.20230922.7 DESCRIPTION "Listen and log Govee Thermometer Bluetooth Low Energy Advertisments" HOMEPAGE_URL https://github.com/wcbonner/GoveeBTTempLogger ) @@ -28,24 +28,29 @@ configure_file(goveebttemplogger-version.h.in goveebttemplogger-version.h) add_executable (goveebttemplogger goveebttemplogger.cpp goveebttemplogger-version.h att-types.h uuid.c uuid.h) target_link_libraries(goveebttemplogger -lbluetooth -lstdc++fs) +if (CMAKE_VERSION VERSION_GREATER 3.12) + set_property(TARGET goveebttemplogger PROPERTY CXX_STANDARD 17) +endif() + +target_include_directories(goveebttemplogger PUBLIC + "${PROJECT_BINARY_DIR}" + ${EXTRA_INCLUDES} + ) + add_custom_command(TARGET goveebttemplogger POST_BUILD COMMAND sudo setcap 'cap_net_raw,cap_net_admin+eip' $ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Setting Raw Priveleges on $" ) -add_executable(gvh-organizelogs gvh-organizelogs.cpp) +add_executable(gvh-organizelogs gvh-organizelogs.cpp goveebttemplogger-version.h) target_link_libraries(gvh-organizelogs -lbluetooth -lstdc++fs) -if (CMAKE_VERSION VERSION_GREATER 3.12) - set_property(TARGET goveebttemplogger PROPERTY CXX_STANDARD 17) -endif() - if (CMAKE_VERSION VERSION_GREATER 3.12) set_property(TARGET gvh-organizelogs PROPERTY CXX_STANDARD 17) endif() -target_include_directories(goveebttemplogger PUBLIC +target_include_directories(gvh-organizelogs PUBLIC "${PROJECT_BINARY_DIR}" ${EXTRA_INCLUDES} )