Make dependencies private since they're only used by the implementation.

This commit is contained in:
Maarten Billemont 2018-06-16 19:47:53 -04:00
parent 5b86166a05
commit 70f32f0680

View file

@ -1,5 +1,5 @@
### CMAKE
project( mpw C )
project( mpw-cli C )
cmake_minimum_required( VERSION 3.0.2 )
@ -39,8 +39,8 @@ endif()
### DEPENDENCIES
function( use_mpw_sodium t r )
if( USE_SODIUM )
target_link_libraries( "${t}" sodium )
target_compile_definitions( "${t}" PUBLIC -DMPW_SODIUM=1 )
target_link_libraries( "${t}" PRIVATE sodium )
target_compile_definitions( "${t}" PRIVATE -DMPW_SODIUM=1 )
message( STATUS "${t}: USE_SODIUM is enabled." )
elseif( r STREQUAL "required" )
@ -56,9 +56,9 @@ function( use_mpw_color t )
find_package( Curses )
if( USE_COLOR )
if ( CURSES_FOUND )
target_include_directories( "${t}" PUBLIC ${CURSES_INCLUDE_DIR} )
target_link_libraries( "${t}" ${CURSES_LIBRARIES} )
target_compile_definitions( "${t}" PUBLIC -DMPW_COLOR=1 ${CURSES_DEFINITIONS} )
target_include_directories( "${t}" PRIVATE ${CURSES_INCLUDE_DIR} )
target_link_libraries( "${t}" PRIVATE ${CURSES_LIBRARIES} )
target_compile_definitions( "${t}" PRIVATE -DMPW_COLOR=1 ${CURSES_DEFINITIONS} )
message( STATUS "${t}: USE_COLOR is enabled." )
elseif( r STREQUAL "required" )
@ -80,8 +80,8 @@ endfunction()
function( use_mpw_json t )
if( USE_JSON )
target_link_libraries( "${t}" json-c )
target_compile_definitions( "${t}" PUBLIC -DMPW_JSON=1 )
target_link_libraries( "${t}" PRIVATE json-c )
target_compile_definitions( "${t}" PRIVATE -DMPW_JSON=1 )
message( STATUS "${t}: USE_JSON is enabled." )
elseif( r STREQUAL "required" )
@ -97,9 +97,9 @@ function( use_mpw_xml t r )
find_package( LibXml2 )
if( USE_XML )
if ( LIBXML2_FOUND )
target_include_directories( "${t}" PUBLIC ${LIBXML2_INCLUDE_DIR} )
target_link_libraries( "${t}" ${LIBXML2_LIBRARIES} )
target_compile_definitions( "${t}" PUBLIC -DMPW_XML=1 ${LIBXML2_DEFINITIONS} )
target_include_directories( "${t}" PRIVATE ${LIBXML2_INCLUDE_DIR} )
target_link_libraries( "${t}" PRIVATE ${LIBXML2_LIBRARIES} )
target_compile_definitions( "${t}" PRIVATE -DMPW_XML=1 ${LIBXML2_DEFINITIONS} )
message( STATUS "${t}: USE_XML is enabled." )
elseif( r STREQUAL "required" )