7 # check if GNUWIN32_DIR is already set
8 # (e.g. by command line argument or the calling script)
10 # check for enviroment variable
11 file(TO_CMAKE_PATH "$ENV{GNUWIN32_DIR}" GNUWIN32_DIR)
13 # search in the default program install folder
14 file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _progFiles)
15 find_file(GNUWIN32_DIR_tmp gnuwin32 win32libs
18 "C:/" "D:/" "E:/" "F:/" "G:/"
20 set(GNUWIN32_DIR ${GNUWIN32_DIR_tmp})
21 endif(NOT GNUWIN32_DIR)
22 else(NOT GNUWIN32_DIR)
23 SET(GNUWIN32_DIR ${GNUWIN32_DIR} CACHE TYPE STRING)
24 endif(NOT GNUWIN32_DIR)
27 set(GNUWIN32_INCLUDE_DIR ${GNUWIN32_DIR}/include)
28 set(GNUWIN32_LIBRARY_DIR ${GNUWIN32_DIR}/lib)
29 set(GNUWIN32_BINARY_DIR ${GNUWIN32_DIR}/bin)
30 set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GNUWIN32_INCLUDE_DIR})
31 set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GNUWIN32_LIBRARY_DIR})
32 set(GNUWIN32_FOUND TRUE)
38 if (NOT GNUWIN32_FIND_QUIETLY)
39 message(STATUS "Found GNUWIN32: ${GNUWIN32_DIR}")
40 endif (NOT GNUWIN32_FIND_QUIETLY)
42 if (GNUWIN32_FIND_REQUIRED)
43 message(SEND_ERROR "Could NOT find GNUWIN32")
44 endif (GNUWIN32_FIND_REQUIRED)
45 endif (GNUWIN32_FOUND)