with msvc, replace va_copy by assigning the va_lists (cherry picked from commit 42d61...
[platform/upstream/dbus.git] / cmake / modules / FindGNUWIN32.cmake
1 if (WIN32)
2
3 # check if GNUWIN32_DIR is already set 
4 # (e.g. by command line argument or the calling script)
5 if(NOT GNUWIN32_DIR)
6         # check for enviroment variable
7         file(TO_CMAKE_PATH "$ENV{GNUWIN32_DIR}" GNUWIN32_DIR)
8         if(NOT GNUWIN32_DIR)
9                 # search in the default program install folder
10                 file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _progFiles)
11                 find_file(GNUWIN32_DIR_tmp gnuwin32 win32libs 
12                         PATHS
13                         "${_progFiles}"
14                         "C:/" "D:/" "E:/" "F:/" "G:/"
15                 )
16                 set(GNUWIN32_DIR ${GNUWIN32_DIR_tmp})
17         endif(NOT GNUWIN32_DIR)
18 endif(NOT GNUWIN32_DIR)
19
20 if (GNUWIN32_DIR)
21    set(GNUWIN32_INCLUDE_DIR ${GNUWIN32_DIR}/include)
22    set(GNUWIN32_LIBRARY_DIR ${GNUWIN32_DIR}/lib)
23    set(GNUWIN32_BINARY_DIR  ${GNUWIN32_DIR}/bin)
24    set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GNUWIN32_INCLUDE_DIR})
25    set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GNUWIN32_LIBRARY_DIR})
26    set(GNUWIN32_FOUND TRUE)
27 else (GNUWIN32_DIR)
28    set(GNUWIN32_FOUND)
29 endif (GNUWIN32_DIR)
30
31 if (GNUWIN32_FOUND)
32   if (NOT GNUWIN32_FIND_QUIETLY)
33     message(STATUS "Found GNUWIN32: ${GNUWIN32_DIR}")
34   endif (NOT GNUWIN32_FIND_QUIETLY)
35 else (GNUWIN32_FOUND)
36   if (GNUWIN32_FIND_REQUIRED)
37     message(SEND_ERROR "Could NOT find GNUWIN32")
38   endif (GNUWIN32_FIND_REQUIRED)
39 endif (GNUWIN32_FOUND)
40
41 endif (WIN32)
42