1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

31667: target_link_libraries with public interface for cmake >= 3

This commit is contained in:
craffael
2020-07-16 11:12:39 +02:00
parent 41ccce129d
commit 61f7249b4c

View File

@@ -346,7 +346,10 @@ else()
endif()
endif()
if (BUILD_SHARED_LIBS)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.0.0")
# Declare the dependencies public so that all code that uses this library automatically also links with the dependencies
target_link_libraries (${PROJECT_NAME} PUBLIC ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
elseif (BUILD_SHARED_LIBS)
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
endif()