2020-11-16 17:05:33 -05:00
|
|
|
# This cmake module is meant to hold helper functions/macros
|
|
|
|
# that make maintaining the cmake build system much easier.
|
|
|
|
# This is especially helpful since gsl needs to provide coverage
|
|
|
|
# for multiple versions of cmake.
|
|
|
|
#
|
|
|
|
# Any functions/macros should have a gsl_* prefix to avoid problems
|
2021-01-05 14:55:13 -05:00
|
|
|
|
2020-12-15 13:06:46 -05:00
|
|
|
# Adding the GSL.natvis files improves the debugging experience for users of this library.
|
|
|
|
function(gsl_add_native_visualizer_support)
|
2022-10-29 15:31:23 -04:00
|
|
|
if (MSVC_IDE)
|
|
|
|
option(GSL_VS_ADD_NATIVE_VISUALIZERS "Configure project to use Visual Studio native visualizers" TRUE)
|
|
|
|
else()
|
|
|
|
set(GSL_VS_ADD_NATIVE_VISUALIZERS FALSE CACHE INTERNAL "Native visualizers are Visual Studio extension" FORCE)
|
|
|
|
endif()
|
2020-12-15 13:06:46 -05:00
|
|
|
|
2022-10-29 15:31:23 -04:00
|
|
|
# add natvis file to the library so it will automatically be loaded into Visual Studio
|
|
|
|
if(GSL_VS_ADD_NATIVE_VISUALIZERS)
|
|
|
|
target_sources(GSL INTERFACE $<BUILD_INTERFACE:${GSL_SOURCE_DIR}/GSL.natvis>)
|
2020-12-15 13:06:46 -05:00
|
|
|
endif()
|
|
|
|
endfunction()
|