From e8ad00d9fe3522480b26b4f8660f5398a9140716 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 25 Nov 2023 19:10:00 +0100 Subject: [PATCH] CMake/Windows/MSVC: add DLL path as target property This modifies the debug environment so demo programs linked to FLTK DLL's can be debugged w/o copying FLTK DLL's to the build folders of the demo programs. This is work in progress and may be improved in a future commit but it works as it is now for all demo programs. --- CMake/fl_create_example.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake index 1ff85d17c..6ea1ff141 100644 --- a/CMake/fl_create_example.cmake +++ b/CMake/fl_create_example.cmake @@ -168,6 +168,14 @@ function (CREATE_EXAMPLE NAME SOURCES LIBRARIES) unset (WRAPPER) endif (MAC_BUNDLE) + if (MSVC AND TARGET fltk_SHARED) + set (DllDir "$>") + ## fl_debug_var (DllDir) + set_target_properties(${TARGET_NAME} PROPERTIES + VS_DEBUGGER_ENVIRONMENT "PATH=${DllDir};$ENV{PATH}" + ) + endif() + ###################################################################### # Parse optional fourth argument, see description above. ######################################################################