3 # check if GNUWIN32_DIR is already set
4 # (e.g. by command line argument or the calling script)
6 # check for enviroment variable
7 file(TO_CMAKE_PATH "$ENV{GNUWIN32_DIR}" 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
14 "C:/" "D:/" "E:/" "F:/" "G:/"
16 set(GNUWIN32_DIR ${GNUWIN32_DIR_tmp})
17 endif(NOT GNUWIN32_DIR)
18 endif(NOT 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)
32 if (NOT GNUWIN32_FIND_QUIETLY)
33 message(STATUS "Found GNUWIN32: ${GNUWIN32_DIR}")
34 endif (NOT GNUWIN32_FIND_QUIETLY)
36 if (GNUWIN32_FIND_REQUIRED)
37 message(SEND_ERROR "Could NOT find GNUWIN32")
38 endif (GNUWIN32_FIND_REQUIRED)
39 endif (GNUWIN32_FOUND)