From a21093d392506bb7e796f05578668965f94b4d70 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 14 Oct 2017 10:29:29 -0400 Subject: [PATCH] Added warning messages when users use the old non-target based cmake variables. --- dlib/cmake_utils/dlibConfig.cmake.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlib/cmake_utils/dlibConfig.cmake.in b/dlib/cmake_utils/dlibConfig.cmake.in index 378ee2a61..03a6c59a7 100644 --- a/dlib/cmake_utils/dlibConfig.cmake.in +++ b/dlib/cmake_utils/dlibConfig.cmake.in @@ -33,4 +33,17 @@ set(dlib_LIBRARIES ${dlib_LIBRARIES} "@dlib_needed_libraries@") set(dlib_LIBS ${dlib_LIBRARIES} "@dlib_needed_libraries@") set(dlib_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@" "@dlib_needed_includes@") + +# Mark these variables above as deprecated. +function(__deprecated_var var access) + if(access STREQUAL "READ_ACCESS") + message(WARNING "The variable '${var}' is deprecated! Instead, simply use target_link_libraries(your_app dlib::dlib). See http://dlib.net/examples/CMakeLists.txt.html for an example.") + endif() +endfunction() +variable_watch(dlib_LIBRARIES __deprecated_var) +variable_watch(dlib_LIBS __deprecated_var) +variable_watch(dlib_INCLUDE_DIRS __deprecated_var) + + + include(@CMAKE_INSTALL_FULL_INCLUDEDIR@/dlib/cmake_utils/use_cpp_11.cmake)