diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ffdaeb55..d77a1d689 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -643,7 +643,7 @@ function (monero_add_library name) endfunction() function (monero_add_library_with_deps) - cmake_parse_arguments(MONERO_ADD_LIBRARY "" "NAME" "DEPENDS;SOURCES" ${ARGN}) + cmake_parse_arguments(MONERO_ADD_LIBRARY "" "NAME" "DEPENDS;LINKS;PRIVATE_LINKS;INCLUDES;PRIVATE_INCLUDES;SOURCES" ${ARGN}) source_group("${MONERO_ADD_LIBRARY_NAME}" FILES ${MONERO_ADD_LIBRARY_SOURCES}) # Define a ("virtual") object library and an actual library that links those @@ -658,6 +658,22 @@ function (monero_add_library_with_deps) if (MONERO_ADD_LIBRARY_DEPENDS) add_dependencies(${objlib} ${MONERO_ADD_LIBRARY_DEPENDS}) endif() + if (MONERO_ADD_LIBRARY_LINKS) + target_link_libraries(${objlib} PUBLIC ${MONERO_ADD_LIBRARY_LINKS}) + target_link_libraries(${MONERO_ADD_LIBRARY_NAME} PUBLIC ${MONERO_ADD_LIBRARY_LINKS}) + endif() + if (MONERO_ADD_LIBRARY_PRIVATE_LINKS) + target_link_libraries(${objlib} PRIVATE ${MONERO_ADD_LIBRARY_PRIVATE_LINKS}) + target_link_libraries(${MONERO_ADD_LIBRARY_NAME} PRIVATE ${MONERO_ADD_LIBRARY_PRIVATE_LINKS}) + endif() + if (MONERO_ADD_LIBRARY_INCLUDES) + target_include_directories(${objlib} PUBLIC ${MONERO_ADD_LIBRARY_INCLUDES}) + target_include_directories(${MONERO_ADD_LIBRARY_NAME} PUBLIC ${MONERO_ADD_LIBRARY_INCLUDES}) + endif() + if (MONERO_ADD_LIBRARY_PRIVATE_INCLUDES) + target_include_directories(${objlib} PRIVATE ${MONERO_ADD_LIBRARY_PRIVATE_INCLUDES}) + target_include_directories(${MONERO_ADD_LIBRARY_NAME} PRIVATE ${MONERO_ADD_LIBRARY_PRIVATE_INCLUDES}) + endif() set_property(TARGET "${MONERO_ADD_LIBRARY_NAME}" PROPERTY FOLDER "libs") target_compile_definitions(${objlib} PRIVATE $)