Skip to content

Commit

Permalink
CMake: Avoid conflicts with parent projects that also set libsodium
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuzzbawls committed Jun 12, 2021
1 parent 48a8185 commit b1ef4f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake_modules/Findsodium.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ if(sodium_USE_STATIC_LIBS)
else()
set(_LIB_TYPE SHARED)
endif()
add_library(sodium ${_LIB_TYPE} IMPORTED)
if(NOT TARGET sodium)
add_library(sodium ${_LIB_TYPE} IMPORTED)
endif()

set_target_properties(sodium PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${sodium_INCLUDE_DIR}"
Expand Down

0 comments on commit b1ef4f6

Please sign in to comment.