Improve cmake search for sodium library.

[IMPROVED]  Ability for cmake to find installed sodium library.
This commit is contained in:
Maarten Billemont 2021-02-28 13:37:26 -05:00
parent c9f84f0620
commit 180cc3db8b

View file

@ -39,6 +39,11 @@ endif()
### DEPENDENCIES
function( use_spectre_sodium t r )
if( USE_SODIUM )
find_library( libsodium NAMES sodium )
find_path( libsodium_include sodium.h )
include_directories("${libsodium_include}")
get_filename_component(libsodium_path "${libsodium}" PATH)
link_directories("${libsodium_path}")
target_link_libraries( "${t}" PRIVATE sodium )
target_compile_definitions( "${t}" PRIVATE -DSPECTRE_SODIUM=1 )
message( STATUS "${t}: USE_SODIUM is enabled." )
@ -53,8 +58,8 @@ function( use_spectre_sodium t r )
endfunction()
function( use_spectre_color t )
find_package( Curses )
if( USE_COLOR )
find_package( Curses )
if ( CURSES_FOUND )
target_include_directories( "${t}" PRIVATE ${CURSES_INCLUDE_DIR} )
target_link_libraries( "${t}" PRIVATE ${CURSES_LIBRARIES} )