From 2aab8d488e45db41633fb090a82b1ce9dc229dce Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 15 Apr 2019 20:35:15 +0300 Subject: [PATCH] Issue a warning when an imported location is overwritten --- boost-install.jam | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/boost-install.jam b/boost-install.jam index 176e07c..3749102 100644 --- a/boost-install.jam +++ b/boost-install.jam @@ -269,11 +269,18 @@ rule generate-cmake-variant- ( target : sources * : properties * ) local target = "Boost::$(lname)" ; .info " target=" $(target) ; - print.text "# Target file name: $(fname)" : true ; + print.text "# Target file name: $(fname)" "" : true ; print.text + "get_target_property(__boost_imploc $(target) IMPORTED_LOCATION_$(variant:U))" + "if(__boost_imploc)" + " message(WARNING \"Target $(target) already has an imported location '${__boost_imploc}', which will be overwritten with '${_BOOST_LIBDIR}/$(fname)'\")" + "endif()" + "unset(__boost_imploc)" + "" "set_property(TARGET $(target) APPEND PROPERTY IMPORTED_CONFIGURATIONS $(variant:U))" + "" "set_target_properties($(target) PROPERTIES" " IMPORTED_LINK_INTERFACE_LANGUAGES_$(variant:U) CXX" " IMPORTED_LOCATION_$(variant:U) \"${_BOOST_LIBDIR}/$(fname)\""