]> git.lyx.org Git - lyx.git/blob - development/cmake/modules/FindGNUWIN32.cmake
cmake cosmetics
[lyx.git] / development / cmake / modules / FindGNUWIN32.cmake
1 #
2 #  from kdelibs
3 #
4
5 if(WIN32)
6
7         # check if GNUWIN32_DIR is already set 
8         # (e.g. by command line argument or the calling script)
9         if(NOT GNUWIN32_DIR)
10                 # check for enviroment variable
11                 file(TO_CMAKE_PATH "$ENV{GNUWIN32_DIR}" GNUWIN32_DIR)
12                 if(NOT 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 
16                                         PATHS
17                                         "${_progFiles}"
18                                         "C:/" "D:/" "E:/" "F:/" "G:/"
19                         )
20                         set(GNUWIN32_DIR ${GNUWIN32_DIR_tmp})
21                 endif()
22         else()
23                 set(GNUWIN32_DIR ${GNUWIN32_DIR} CACHE TYPE STRING)
24         endif()
25
26         if(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)
33         else()
34                  set(GNUWIN32_FOUND)
35         endif()
36
37         if(GNUWIN32_FOUND)
38                 if (NOT GNUWIN32_FIND_QUIETLY)
39                         message(STATUS "Found GNUWIN32: ${GNUWIN32_DIR}")
40                 endif()
41         else()
42                 if (GNUWIN32_FIND_REQUIRED)
43                         message(SEND_ERROR "Could NOT find GNUWIN32")
44                 endif()
45         endif()
46
47 endif()
48