diff --git a/Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake b/Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake index ae665d404fe..6a9680b5f0f 100644 --- a/Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake +++ b/Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake @@ -31,7 +31,14 @@ if(Boost_IOSTREAMS_FOUND AND NOT TARGET CGAL::Boost_iostreams_support) endif() add_library(CGAL::Boost_iostreams_support INTERFACE IMPORTED) - set_target_properties(CGAL::Boost_iostreams_support PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_BOOST_IOSTREAMS" - INTERFACE_LINK_LIBRARIES "${Boost_LIB};${ZLIB_LIBS}") + + if(CMAKE_VERSION VERSION_LESS 3.11) + set_target_properties(CGAL::Boost_iostreams_support PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_BOOST_IOSTREAMS" + INTERFACE_LINK_LIBRARIES "${Boost_LIB};${ZLIB_LIBS}") + else() + set_target_properties(CGAL::Boost_iostreams_support PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_BOOST_IOSTREAMS") + target_link_libraries(CGAL::Boost_iostreams_support INTERFACE "${Boost_LIB};${ZLIB_LIBS}") + endif() endif()