Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions ports/logme/disable-gtest-discovery-cross.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--- a/tests/ChannelRedirect/CMakeLists.txt
+++ b/tests/ChannelRedirect/CMakeLists.txt
@@ -36,5 +36,10 @@
target_compile_definitions(${PROJECT_NAME} PRIVATE LOGME_INRELEASE)

include(GoogleTest)
-gtest_discover_tests(${PROJECT_NAME})
+
+if(NOT CMAKE_CROSSCOMPILING)
Comment thread
efmsoft marked this conversation as resolved.
Outdated
+ gtest_discover_tests(${PROJECT_NAME})
+else()
+ message(STATUS "Skipping gtest_discover_tests() while cross-compiling")
+endif()
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "Tests")
--- a/tests/LevelFilter/CMakeLists.txt
+++ b/tests/LevelFilter/CMakeLists.txt
@@ -36,5 +36,10 @@
target_compile_definitions(${PROJECT_NAME} PRIVATE LOGME_INRELEASE)

include(GoogleTest)
-gtest_discover_tests(${PROJECT_NAME})
+
+if(NOT CMAKE_CROSSCOMPILING)
+ gtest_discover_tests(${PROJECT_NAME})
+else()
+ message(STATUS "Skipping gtest_discover_tests() while cross-compiling")
+endif()
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "Tests")
--- a/tests/OutputFlags/CMakeLists.txt
+++ b/tests/OutputFlags/CMakeLists.txt
@@ -35,5 +35,10 @@
target_compile_definitions(${PROJECT_NAME} PRIVATE LOGME_INRELEASE)

include(GoogleTest)
-gtest_discover_tests(${PROJECT_NAME})
+
+if(NOT CMAKE_CROSSCOMPILING)
+ gtest_discover_tests(${PROJECT_NAME})
+else()
+ message(STATUS "Skipping gtest_discover_tests() while cross-compiling")
+endif()
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "Tests")
48 changes: 48 additions & 0 deletions ports/logme/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO efmsoft/logme
REF v1.6.0
SHA512 6749152e0c79ae5979867b0368234459040f7dcac861d47585fce53095512d06c3a2325a6160b7a7ac53a34a5279419e0715a8f28ea8f00aee6cff40b5f0bf63
HEAD_REF master
)

vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
examples LOGME_BUILD_EXAMPLES
tests LOGME_BUILD_TESTS
tools LOGME_BUILD_TOOLS
)

vcpkg_apply_patches(

Check warning on line 17 in ports/logme/portfile.cmake

View workflow job for this annotation

GitHub Actions / Check

The function vcpkg_apply_patches is deprecated. Please use the PATCHES arguments to the "extract" helpers (for example, vcpkg_from_github() (https://learn.microsoft.com/en-us/vcpkg/maintainers/functions/vcpkg_from_github))
SOURCE_PATH "${SOURCE_PATH}"
PATCHES
disable-gtest-discovery-cross.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" _LOGME_BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" _LOGME_BUILD_DYNAMIC)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DLOGME_BUILD_STATIC=${_LOGME_BUILD_STATIC}
-DLOGME_BUILD_DYNAMIC=${_LOGME_BUILD_DYNAMIC}
-DUSE_LOGME_SHARED=${_LOGME_BUILD_DYNAMIC}
${FEATURE_OPTIONS}
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(
PACKAGE_NAME logme
CONFIG_PATH lib/cmake/logme
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vcpkg_cmake_config_fixup(
PACKAGE_NAME logme
CONFIG_PATH lib/cmake/logme
)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/logme)


file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
7 changes: 7 additions & 0 deletions ports/logme/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
logme provides CMake package config files.
In your CMakeLists.txt:

find_package(logme CONFIG REQUIRED)
target_link_libraries(your_target PRIVATE logme::logme)

The logme::logme target is stable for both static and shared builds.
25 changes: 25 additions & 0 deletions ports/logme/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "logme",
"version": "1.6.0",
"description": "Cross-platform C/C++ logging framework: channels and routing, multiple backends, colored output, and runtime dynamic control.",
"homepage": "https://github.com/efmsoft/logme",
"license": "Apache-2.0",
"dependencies": [
"vcpkg-cmake",
"vcpkg-cmake-config"
],
"features": {
"examples": {
"description": "Build examples."
},
"tests": {
"description": "Build tests.",
"dependencies": [
"gtest"
]
},
"tools": {
"description": "Build command-line tools."
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6008,6 +6008,10 @@
"baseline": "1.5.0",
"port-version": 0
},
"logme": {
"baseline": "1.6.0",
"port-version": 0
},
"loguru": {
"baseline": "2.1.0",
"port-version": 6
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/logme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
Comment thread
vicroms marked this conversation as resolved.
"versions": [
{
"git-tree": "0de4c344a23e38f819b9d67f574c50c10c96a5e4",
"version": "1.6.0",
"port-version": 0
}
]
}
Loading