From 245b331e5ef4962f6bffdff2d207b185e362a58a Mon Sep 17 00:00:00 2001 From: Roman Dubtsov Date: Mon, 11 Mar 2019 17:53:25 -0700 Subject: [PATCH] build: do not break transitive linking when being used as a subproject --- cmake/utils.cmake | 6 +++--- src/CMakeLists.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 867ec08aa33..cb4e76b1454 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -105,15 +105,15 @@ macro(append_to_windows_path_list path_list path) endif() endmacro() -function(target_link_libraries_private target list) +function(target_link_libraries_build target list) # Foreach is required for compatibility with 2.8.11 ways foreach(lib ${list}) - target_link_libraries(${target} LINK_PRIVATE + target_link_libraries(${target} "$") endforeach(lib) endfunction() -function(target_link_libraries_public target list) +function(target_link_libraries_install target list) # Foreach is required for compatibility with 2.8.11 ways foreach(lib ${list}) get_filename_component(base "${lib}" NAME) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f10feb20e55..93fbeadd924 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -103,11 +103,11 @@ target_include_directories(${LIB_NAME} PUBLIC $/${CMAKE_INSTALL_INCLUDEDIR}> ) -target_link_libraries_private(${LIB_NAME} +target_link_libraries_build(${LIB_NAME} "${EXTRA_SHARED_LIBS};${EXTRA_STATIC_LIBS}") -target_link_libraries_public(${LIB_NAME} "${EXTRA_SHARED_LIBS}") +target_link_libraries_install(${LIB_NAME} "${EXTRA_SHARED_LIBS}") if(MKLDNN_LIBRARY_TYPE STREQUAL "STATIC") - target_link_libraries_public(${LIB_NAME} "${EXTRA_STATIC_LIBS}") + target_link_libraries_install(${LIB_NAME} "${EXTRA_STATIC_LIBS}") endif() set(LIB_EXPORT_NAME "${LIB_NAME}-targets")