-
Notifications
You must be signed in to change notification settings - Fork 490
Expand file tree
/
Copy pathDebuggerEnvironment.cmake
More file actions
27 lines (21 loc) · 989 Bytes
/
DebuggerEnvironment.cmake
File metadata and controls
27 lines (21 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
###############################################################################
# Define a function to set debugger environment so that the run time
# dependencies can be located by the debugger.
function(set_debugger_env target_name)
cmake_parse_arguments(ARG "NEEDS_GL" "" "" ${ARGN})
if(NOT TARGET ${target_name})
message(FATAL_ERROR "set_debugger_env: '${target_name}' is not a CMake target")
endif()
# Set the Paths for Visual Studio IDE Debugger.
if(MSVC)
if(OCIO_GL_ENABLED AND ARG_NEEDS_GL)
# Add folders for glut and glew DLLs.
set(extra_dirs "${GLUT_INCLUDE_DIR}/../bin;${GLEW_INCLUDE_DIRS}/../bin")
endif()
set_property(TARGET ${target_name} PROPERTY
VS_DEBUGGER_ENVIRONMENT "PATH=$<JOIN:$<TARGET_RUNTIME_DLL_DIRS:${target_name}>,;>;${extra_dirs};%PATH%"
)
endif()
endfunction()