1 #///////////////////////////////////////////////////////////////////////////////
3 #// Visual Leak Detector - CallStack Class Implementations
4 #// Copyright (c) 2005-2006 Dan Moulding
5 #// Copyright (c) 2007 Peter Kümmel, CMake files
7 #// This library is free software; you can redistribute it and/or
8 #// modify it under the terms of the GNU Lesser General Public
9 #// License as published by the Free Software Foundation; either
10 #// version 2.1 of the License, or (at your option) any later version.
12 #// This library is distributed in the hope that it will be useful,
13 #// but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 #// Lesser General Public License for more details.
17 #// You should have received a copy of the GNU Lesser General Public
18 #// License along with this library; if not, write to the Free Software
19 #// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #// See COPYING.txt for the full terms of the GNU Lesser General Public License.
23 #////////////////////////////////////////////////////////////////////////////////
25 cmake_minimum_required(VERSION 2.6.4)
29 include(CheckCXXSourceCompiles)
31 check_cxx_source_compiles(
33 #pragma comment(lib, \"dbghelp.lib\")
38 int main(){void* ptr = (void*)&SymInitializeW; return 0;}
40 HAVE_DEBUGGING_TOOLS_FOR_WINDOWS)
42 if (NOT HAVE_DEBUGGING_TOOLS_FOR_WINDOWS)
43 message(STATUS "'Debugging Tools for Windows' not found.")
44 message(STATUS "Please install the tools from http://www.microsoft.com/whdc/devtools/debugging/default.mspx")
45 message(STATUS "and add it to the Visual Studio include and lib serach paths.")
46 message(FATAL_ERROR "")
47 endif (NOT HAVE_DEBUGGING_TOOLS_FOR_WINDOWS)
49 set(vld_path ${CMAKE_CURRENT_SOURCE_DIR}/..)
51 file(GLOB vld_sources ${vld_path}/src/*.cpp)
52 file(GLOB vld_headers ${vld_path}/src/*.h)
54 add_definitions(-DVLD_BUILD -DUNICODE -D_UNICODE)
57 add_library(vld SHARED ${vld_sources} ${vld_headers})