[waffle] [PATCH] add FindWaffle.cmake
groleo at gmail.com
groleo at gmail.com
Wed Oct 17 13:43:43 PDT 2012
From: Adrian Marius Negreanu <adrian.m.negreanu at intel.com>
Piglit searches waffle by using pkg_check_modules.
If one tried to use android toolchain along cmake,
waffle won't be found, since pkg_check_modules relies on
pkg-config(missing on android)
To fix this, add a "cmake find module" for Waffle.
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu at intel.com>
---
cmake/Modules/FindWaffle.cmake | 49 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 cmake/Modules/FindWaffle.cmake
diff --git a/cmake/Modules/FindWaffle.cmake b/cmake/Modules/FindWaffle.cmake
new file mode 100644
index 0000000..c0c3b88
--- /dev/null
+++ b/cmake/Modules/FindWaffle.cmake
@@ -0,0 +1,49 @@
+# Copyright 2012 Intel Corporation
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# - Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# - Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+# Locate the Waffle library.
+#
+#
+# Defines the variables:
+# WAFFLE_INCLUDE_DIR Where to look for Waffle headers.
+# WAFFLE_LIBRARY Where to look for Waffle library.
+# WAFFLE_FOUND If FALSE, don't try to use Waffle.
+#
+
+find_path(WAFFLE_INCLUDE_DIR
+ NAMES waffle.h
+)
+
+find_library(WAFFLE_LIBRARY
+ NAMES waffle
+)
+
+# handle the 'QUIETLY' and 'REQUIRED' arguments and
+# set 'WAFFLE_FOUND' to TRUE if all listed variables are TRUE
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(Waffle DEFAULT_MSG WAFFLE_LIBRARY WAFFLE_INCLUDE_DIR)
+
+mark_as_advanced(WAFFLE_LIBRARY WAFFLE_INCLUDE_DIR)
--
1.7.11.3
More information about the waffle
mailing list