Skip to content

Commit

Permalink
Add missing alias targets to CMakeLists (#461)
Browse files Browse the repository at this point in the history
This makes usage consistent. NuRaft::target_name will always work
regardless of whether NuRaft was set up as a subdirectory or loaded from
a config.

Fixes #459.
  • Loading branch information
JosiahWI committed Aug 27, 2023
1 parent 188947b commit 47e12c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,11 @@ set(STATIC_LIB_SRC
set(LIBRARY_NAME "nuraft")

add_library(static_lib ${STATIC_LIB_SRC})
add_library(NuRaft::static_lib ALIAS static_lib)
set_target_properties(static_lib PROPERTIES OUTPUT_NAME ${LIBRARY_NAME} CLEAN_DIRECT_OUTPUT 1)

add_library(shared_lib SHARED ${STATIC_LIB_SRC})
add_library(NuRaft::shared_lib ALIAS shared_lib)
set_target_properties(shared_lib PROPERTIES OUTPUT_NAME ${LIBRARY_NAME} CLEAN_DIRECT_OUTPUT 1)
if (APPLE)
target_link_libraries(shared_lib ${LIBRARIES})
Expand Down

0 comments on commit 47e12c8

Please sign in to comment.