]> git.lyx.org Git - lyx.git/blob - development/cmake/modules/FindGNUWIN32.cmake
also check vor env. variable GNUWIN32_DIR
[lyx.git] / development / 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 gnuwin32 win32libs 
12                         PATHS
13                         "${_progFiles}"
14                         "C:/"
15                 )
16         endif(NOT GNUWIN32_DIR)
17 endif(NOT GNUWIN32_DIR)
18
19 if (GNUWIN32_DIR)
20    set(GNUWIN32_INCLUDE_DIR ${GNUWIN32_DIR}/include)
21    set(GNUWIN32_LIBRARY_DIR ${GNUWIN32_DIR}/lib)
22    set(GNUWIN32_BINARY_DIR  ${GNUWIN32_DIR}/bin)
23    set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GNUWIN32_INCLUDE_DIR})
24    set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GNUWIN32_LIBRARY_DIR})
25    set(GNUWIN32_FOUND TRUE)
26 else (GNUWIN32_DIR)
27    set(GNUWIN32_FOUND)
28 endif (GNUWIN32_DIR)
29
30 if (GNUWIN32_FOUND)
31   if (NOT GNUWIN32_FIND_QUIETLY)
32     message(STATUS "Found GNUWIN32: ${GNUWIN32_DIR}")
33   endif (NOT GNUWIN32_FIND_QUIETLY)
34 else (GNUWIN32_FOUND)
35   if (GNUWIN32_FIND_REQUIRED)
36     message(SEND_ERROR "Could NOT find GNUWIN32")
37   endif (GNUWIN32_FIND_REQUIRED)
38 endif (GNUWIN32_FOUND)
39
40 endif (WIN32)
41