with msvc, replace va_copy by assigning the va_lists (cherry picked from commit 42d61...
[platform/upstream/dbus.git] / cmake / modules / FindKDEWIN.cmake
1 # - Try to find the install path of the required win32 supplementary libraries 
2
3 # used environment vars 
4 #  KDEWIN_DIR  - kdewin root dir 
5 #
6 # this will define
7 #  KDEWIN_FOUND - system has KDEWIN
8 #  KDEWIN_DIR - the KDEWIN root installation dir
9 #
10 # Copyright (c) 2007, Ralf Habacker, <ralf.habacker@freenet.de>
11 #
12 # Redistribution and use is allowed according to the terms of the BSD license.
13 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14
15 if (WIN32)
16   IF (NOT KDEWIN_DIR)
17     # check for enviroment variable
18     file(TO_CMAKE_PATH "$ENV{KDEWIN_DIR}" KDEWIN_DIR)
19     if(NOT KDEWIN_DIR)
20       file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _progFiles)
21       if (MINGW)
22         set (DIR "kdewin-mingw")
23       else (MINGW)
24         set (DIR "kdewin-msvc")
25       endif (MINGW)
26       
27       # search in the default program install folder
28       find_file(KDEWIN_DIR_tmp ${DIR} kdewin kdewin32 gnuwin32 win32libs
29       PATHS
30         "${_progFiles}"
31       )
32       set (KDEWIN_DIR ${KDEWIN_DIR_tmp})
33     endif (NOT KDEWIN_DIR)
34     if (KDEWIN_DIR)
35       message(STATUS "Found windows supplementary package location: ${KDEWIN_DIR}")
36     endif (KDEWIN_DIR)
37   endif (NOT KDEWIN_DIR)
38
39   # this must be set every time 
40   if (KDEWIN_DIR)
41     # add include path and library to all targets, this is required because 
42     # cmake's 2.4.6 FindZLib.cmake does not use CMAKE_REQUIRED... vars
43     set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${KDEWIN_DIR}/include)
44     set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${KDEWIN_DIR}/lib)
45      
46     set (KDEWIN_FOUND 1)
47   else(KDEWIN_DIR)
48     message(STATUS "Could not find the location of the windows supplementary packages which is \n"
49                     "\t\tenvironment variable KDEWIN_DIR\n"
50                     "\t\t<ProgramFiles>/${DIR}\n"
51                     "\t\t<ProgramFiles>/kdewin\n" 
52                     "\t\t<ProgramFiles>/kdewin32\n" 
53                     "\t\t<ProgramFiles>/gnuwin32\n")
54    endif(KDEWIN_DIR)
55   
56 endif (WIN32)