1# - Add appropriate linker flags to show link details on Visual Studio
2#
3#  include(MSVCVerboseLinking) - to add the flags automaticlly if applicable
4#
5# Be sure to include this module _BEFORE_ adding your targets, or the targets
6# won't pick up the updated flags.
7#
8# Requires these CMake modules:
9#  - none
10#
11# Original Author:
12# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
13# http://academic.cleardefinition.com
14# Iowa State University HCI Graduate Program/VRAC
15#
16# Copyright Iowa State University 2009-2010.
17# Distributed under the Boost Software License, Version 1.0.
18# (See accompanying file LICENSE_1_0.txt or copy at
19# http://www.boost.org/LICENSE_1_0.txt)
20
21if(MSVC)
22	if(NOT DEFINED MSVC_LINK_REALLY_VERBOSE)
23		if(IN_DASHBOARD_SCRIPT)
24			set(MSVC_LINK_REALLY_VERBOSE TRUE)
25		else()
26			set(MSVC_LINK_REALLY_VERBOSE FALSE)
27		endif()
28	endif()
29	set(MSVC_LINK_REALLY_VERBOSE
30		"${MSVC_LINK_REALLY_VERBOSE}"
31		CACHE
32		BOOL
33		"Provide maximum linker messages?")
34	mark_as_advanced(MSVC_LINK_REALLY_VERBOSE)
35
36	if(MSVC_LINK_REALLY_VERBOSE)
37		set(_verbose_flag "/VERBOSE")
38	else()
39		set(_verbose_flag "/VERBOSE:LIB")
40	endif()
41
42	set(CMAKE_EXE_LINKER_FLAGS
43		"${CMAKE_EXE_LINKER_FLAGS} ${_verbose_flag}")
44	set(CMAKE_MODULE_LINKER_FLAGS
45		"${CMAKE_MODULE_LINKER_FLAGS} ${_verbose_flag}")
46	set(CMAKE_SHARED_LINKER_FLAGS
47		"${CMAKE_SHARED_LINKER_FLAGS} ${_verbose_flag}")
48endif()
49