1# - Script to compile Win32-developed sources using tchar without modifying the code
2# Requires that ${CMAKE_SOURCE_DIR}/cmake/workarounds/tchar/ be present.
3#
4#	TCHAR_WORKAROUND, automatically set to on when not on win32
5#	TCHAR_INCLUDE_DIR, location of our fake tchar.h file
6#
7# Original Author:
8# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
9# http://academic.cleardefinition.com
10# Iowa State University HCI Graduate Program/VRAC
11#
12# Copyright Iowa State University 2009-2010.
13# Distributed under the Boost Software License, Version 1.0.
14# (See accompanying file LICENSE_1_0.txt or copy at
15# http://www.boost.org/LICENSE_1_0.txt)
16
17if(NOT WIN32)
18	option(TCHAR_WORKAROUND "Work around missing tchar error" on)
19else()
20	option(TCHAR_WORKAROUND "Work around missing tchar error" off)
21endif()
22
23mark_as_advanced(TCHAR_WORKAROUND)
24
25if(TCHAR_WORKAROUND)
26	find_path(TCHAR_INCLUDE_DIR
27		tchar.h
28		PATHS
29		${CMAKE_SOURCE_DIR}/cmake/workarounds/tchar/
30		./workarounds/tchar/
31		PATH_SUFFIXES
32		workarounds/
33		workarounds/tchar/)
34	if(TCHAR_INCLUDE_DIR)
35		include_directories(${TCHAR_INCLUDE_DIR})
36		mark_as_advanced(TCHAR_INCLUDE_DIR)
37	endif()
38endif()
39