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.
This commit is contained in:
Albrecht Schlosser 2023-11-25 19:10:00 +01:00
parent 34ed30fe1a
commit e8ad00d9fe
1 changed files with 8 additions and 0 deletions

View File

@ -168,6 +168,14 @@ function (CREATE_EXAMPLE NAME SOURCES LIBRARIES)
unset (WRAPPER)
endif (MAC_BUNDLE)
if (MSVC AND TARGET fltk_SHARED)
set (DllDir "$<SHELL_PATH:$<TARGET_FILE_DIR:fltk_SHARED>>")
## 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.
######################################################################