2006-09-15 17:05:20 +00:00
|
|
|
#
|
|
|
|
# from kdelibs
|
|
|
|
#
|
|
|
|
|
2007-08-28 18:30:02 +00:00
|
|
|
if(WIN32)
|
2006-06-11 11:57:25 +00:00
|
|
|
|
2007-08-28 18:30:02 +00:00
|
|
|
# check if GNUWIN32_DIR is already set
|
|
|
|
# (e.g. by command line argument or the calling script)
|
2006-09-03 10:51:20 +00:00
|
|
|
if(NOT GNUWIN32_DIR)
|
2007-08-28 18:30:02 +00:00
|
|
|
# check for enviroment variable
|
|
|
|
file(TO_CMAKE_PATH "$ENV{GNUWIN32_DIR}" GNUWIN32_DIR)
|
|
|
|
if(NOT GNUWIN32_DIR)
|
|
|
|
# search in the default program install folder
|
|
|
|
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _progFiles)
|
2010-03-28 12:18:03 +00:00
|
|
|
find_file(GNUWIN32_DIR gnuwin32 win32libs
|
2007-08-28 18:30:02 +00:00
|
|
|
PATHS
|
|
|
|
"${_progFiles}"
|
|
|
|
"C:/" "D:/" "E:/" "F:/" "G:/"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
2006-06-11 11:57:25 +00:00
|
|
|
|
2007-08-28 18:30:02 +00:00
|
|
|
if(GNUWIN32_DIR)
|
|
|
|
set(GNUWIN32_INCLUDE_DIR ${GNUWIN32_DIR}/include)
|
|
|
|
set(GNUWIN32_LIBRARY_DIR ${GNUWIN32_DIR}/lib)
|
|
|
|
set(GNUWIN32_BINARY_DIR ${GNUWIN32_DIR}/bin)
|
|
|
|
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GNUWIN32_INCLUDE_DIR})
|
|
|
|
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GNUWIN32_LIBRARY_DIR})
|
|
|
|
set(GNUWIN32_FOUND TRUE)
|
|
|
|
else()
|
|
|
|
set(GNUWIN32_FOUND)
|
|
|
|
endif()
|
2006-06-11 11:57:25 +00:00
|
|
|
|
2007-08-28 18:30:02 +00:00
|
|
|
if(GNUWIN32_FOUND)
|
|
|
|
if (NOT GNUWIN32_FIND_QUIETLY)
|
|
|
|
message(STATUS "Found GNUWIN32: ${GNUWIN32_DIR}")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if (GNUWIN32_FIND_REQUIRED)
|
2010-03-28 12:18:03 +00:00
|
|
|
set(GNUWIN32_DIR CACHE PATH FORCE)
|
2011-02-14 19:26:33 +00:00
|
|
|
message(STATUS "ERROR: Could NOT find GNUWIN32, please set GNUWIN32_DIR")
|
2011-02-15 09:46:14 +00:00
|
|
|
message(STATUS "ERROR: or let cmake download all required files by using -DLYX_DEPENDENCIES_DOWNLOAD=1")
|
2011-02-14 19:26:33 +00:00
|
|
|
message(FATAL_ERROR)
|
2007-08-28 18:30:02 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2006-06-11 11:57:25 +00:00
|
|
|
|
2007-08-28 18:30:02 +00:00
|
|
|
endif()
|
2006-06-11 11:57:25 +00:00
|
|
|
|