From 36ebfd411b358fb4797d31d23f945e8f6844d15a Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sat, 3 Mar 2007 14:32:17 +0000 Subject: * cmake: new directory, contains cmake build support. See http://www.cmake.org for more informations. Currently only unix will be buildable because some win32 required files are still missing. --- cmake/modules/FindGLIB.cmake | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 cmake/modules/FindGLIB.cmake (limited to 'cmake/modules/FindGLIB.cmake') diff --git a/cmake/modules/FindGLIB.cmake b/cmake/modules/FindGLIB.cmake new file mode 100644 index 00000000..1fdaee95 --- /dev/null +++ b/cmake/modules/FindGLIB.cmake @@ -0,0 +1,42 @@ +# - Try to find the GLIB library +# Once done this will define +# +# GLIB_FOUND - system has GLIB +# GLIB_INCLUDES - the GLIB include directories +# GLIB_LIBRARIES - The libraries needed to use GLIB + +if (WIN32) + +INCLUDE(MacroGetenvWinPath) + +MACRO_GETENV_WIN_PATH(_program_FILES_DIR PROGRAMFILES) + +FIND_PATH(GLIB_INCLUDE_DIR glib.h + ${_program_FILES_DIR}/glib/include/glib-2.0 +) + + +# search for GLIB in the default install directory for applications (default of (n)make install) +FIND_LIBRARY(GLIB_LIBRARY NAMES glib-2.0 + PATHS + ${_program_FILES_DIR}/glib/lib +) + +if (GLIB_LIBRARY AND GLIB_INCLUDE_DIR) + set(GLIB_FOUND TRUE) + set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GLIB_INCLUDES}) + set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GLIB_LIBRARIES}) + +endif (GLIB_LIBRARY AND GLIB_INCLUDE_DIR) + +if (GLIB_FOUND) + if (NOT GLIB_FIND_QUIETLY) + message(STATUS "Found GLIB: ${GLIB_LIBRARY}") + endif (NOT GLIB_FIND_QUIETLY) +else (GLIB_FOUND) + if (GLIB_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find GLIB library") + endif (GLIB_FIND_REQUIRED) +endif (GLIB_FOUND) + +endif (WIN32) -- cgit