summaryrefslogtreecommitdiff
path: root/CMake/fl_create_example.cmake
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2023-11-25 19:10:00 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2023-11-25 20:53:46 +0100
commite8ad00d9fe3522480b26b4f8660f5398a9140716 (patch)
tree511db020d3f9965c48217992b63f176b41a145b4 /CMake/fl_create_example.cmake
parent34ed30fe1a710f6294e23003aa385bd6da6cb326 (diff)
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.
Diffstat (limited to 'CMake/fl_create_example.cmake')
-rw-r--r--CMake/fl_create_example.cmake8
1 files changed, 8 insertions, 0 deletions
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 "$<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.
######################################################################