Skip to content

Commit

Permalink
Remove common name from module helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
fdr400 committed Jan 6, 2025
1 parent ffebb90 commit 3a3272c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
17 changes: 2 additions & 15 deletions cmake/ModuleHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ macro(_userver_module_begin)
# Custom package name; NAME is used by default
PACKAGE_NAME
# For multi-target packages
COMMON_NAME
VERSION
)
set(multiValueArgs
Expand Down Expand Up @@ -295,18 +294,11 @@ macro(_userver_module_end)
mark_as_advanced(${required_vars})
else()
# Forward to another CMake module, add nice error messages if missing.
if(ARG_COMMON_NAME)
set(wrapped_package_name "${ARG_COMMON_NAME}")
else()
set(wrapped_package_name "${current_package_name}")
endif()
set(wrapped_package_name "${current_package_name}")
set(find_command_args "${wrapped_package_name}")
if(ARG_VERSION)
list(APPEND find_command_args "${ARG_VERSION}")
endif()
if(ARG_COMMON_NAME)
list(APPEND find_command_args COMPONENTS "${name}")
endif()
find_package(${find_command_args})
set("${name}_FOUND" "${${wrapped_package_name}_FOUND}")
endif()
Expand All @@ -332,16 +324,11 @@ macro(_userver_module_end)
endif()
endif()

if(ARG_COMMON_NAME
OR (NOT "${${libraries_variable}}" STREQUAL "")
if((NOT "${${libraries_variable}}" STREQUAL "")
OR (NOT "${${includes_variable}}" STREQUAL ""))
if(NOT TARGET "${name}")
add_library("${name}" INTERFACE IMPORTED GLOBAL)

if(ARG_COMMON_NAME AND TARGET "${ARG_COMMON_NAME}::${name}")
target_link_libraries("${name}" INTERFACE "${ARG_COMMON_NAME}::${name}")
endif()

if(NOT "${${includes_variable}}" STREQUAL "")
target_include_directories("${name}" INTERFACE ${${includes_variable}})
message(STATUS "${name} include directories: ${${includes_variable}}")
Expand Down
4 changes: 4 additions & 0 deletions scripts/docs/en/deps/alpine.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
boost1.84-dev
boost1.84-static
clang17-extra-tools
clang18
cmake
Expand All @@ -11,6 +12,9 @@ hiredis-dev
jemalloc-dev
krb5-dev
libev-dev
libev-static
libbson-static
libbson-static
lz4-dev
lz4-static
make
Expand Down

0 comments on commit 3a3272c

Please sign in to comment.