[opengtl-commits] [348] oups forgot about FindOpenRaw.cmake file |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 348
Author: cyrille
Date: 2008-09-02 00:33:37 +0200 (Tue, 02 Sep 2008)
Log Message:
-----------
oups forgot about FindOpenRaw.cmake file
Added Paths:
-----------
trunk/OpenGTL/cmake/modules/FindOpenRaw.cmake
Added: trunk/OpenGTL/cmake/modules/FindOpenRaw.cmake
===================================================================
--- trunk/OpenGTL/cmake/modules/FindOpenRaw.cmake (rev 0)
+++ trunk/OpenGTL/cmake/modules/FindOpenRaw.cmake 2008-09-01 22:33:37 UTC (rev 348)
@@ -0,0 +1,36 @@
+
+
+INCLUDE(UsePkgConfig)
+PKGCONFIG(libopenraw-1.0 _openrawIncDir _openrawLinkDir _openrawLinkFlags _openrawCflags)
+
+set(OPENRAW_DEFINITIONS ${_openrawCflags})
+set(OPENRAW_LIBRARIES ${_openrawLinkFlags})
+set(OPENRAW_INCLUDE_DIR ${_openrawIncDir}/libopenraw-1.0)
+
+if(OPENRAW_DEFINITIONS AND OPENRAW_LIBRARIES)
+
+ FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin/ /usr/local/bin )
+
+ # query pkg-config asking for openraw == 0.0.6
+ EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.0.6 libopenraw-1.0 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+
+ if(_return_VALUE STREQUAL "0")
+ set(OPENRAW_FOUND TRUE)
+ set(HAVE_openraw TRUE)
+ else(_return_VALUE STREQUAL "0")
+ message(STATUS "openraw < 0.0.6 was found")
+ endif(_return_VALUE STREQUAL "0")
+endif(OPENRAW_DEFINITIONS AND OPENRAW_LIBRARIES)
+
+if (OPENRAW_FOUND)
+ if (NOT OPENRAW_FIND_QUIETLY)
+ message(STATUS "Found openraw: ${OPENRAW_LIBRARIES} ${OPENRAW_INCLUDE_DIR}")
+ endif (NOT OPENRAW_FIND_QUIETLY)
+else (openraw_FOUND)
+ if (NOT OPENRAW_FIND_QUIETLY)
+ message(STATUS "openraw was NOT found.")
+ endif (NOT openraw_FIND_QUIETLY)
+ if (OPENRAW_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find openraw")
+ endif (OPENRAW_FIND_REQUIRED)
+endif (OPENRAW_FOUND)