[Piglit] [PATCH 11/14] cmake/FindWaffle: Use PATH_SUFFIXES for WAFFLE_INCLUDE_DIR

groleo at gmail.com groleo at gmail.com
Fri Nov 16 04:46:56 PST 2012


From: Adrian Marius Negreanu <adrian.m.negreanu at intel.com>

This simplifies the code for finding WAFFLE_INCLUDE_DIR.

Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu at intel.com>
[chadv: Write commit message. Split intwo two patches.]
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 cmake/Modules/FindWaffle.cmake | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/cmake/Modules/FindWaffle.cmake b/cmake/Modules/FindWaffle.cmake
index 0334387..1f8b22b 100644
--- a/cmake/Modules/FindWaffle.cmake
+++ b/cmake/Modules/FindWaffle.cmake
@@ -39,14 +39,10 @@ if(NOT DEFINED WAFFLE_FIND_VERSION_MAJOR)
     set(WAFFLE_FIND_VERSION_MAJOR 1)
 endif()
 
-find_path(WAFFLE_PREFIX_INCLUDE_DIR
-    NAMES "waffle-${WAFFLE_FIND_VERSION_MAJOR}/waffle.h"
-)
-
-set(WAFFLE_INCLUDE_DIR "${WAFFLE_PREFIX_INCLUDE_DIR}/waffle-${WAFFLE_FIND_VERSION_MAJOR}")
-
-set(WAFFLE_INCLUDE_DIRS "${WAFFLE_INCLUDE_DIR}"
-    CACHE FILEPATH "Full path to Waffle library")
+find_path(WAFFLE_INCLUDE_DIRS
+    NAMES waffle.h
+    PATH_SUFFIXES "waffle-${WAFFLE_FIND_VERSION_MAJOR}"
+ )
 
 find_library(WAFFLE_LIBRARIES
     NAMES "waffle-${WAFFLE_FIND_VERSION_MAJOR}"
@@ -77,10 +73,8 @@ mark_as_advanced(WAFFLE_LIBRARIES WAFFLE_INCLUDE_DIRS)
 #
 unset(WAFFLE_FIND_VERSION_MAJOR CACHE)
 unset(WAFFLE_INCLUDE_DIR CACHE)
-unset(WAFFLE_PREFIX_INCLUDE_DIR CACHE)
 unset(WAFFLE_VERSION_H CACHE)
 
 unset(WAFFLE_FIND_VERSION_MAJOR)
 unset(WAFFLE_INCLUDE_DIR)
-unset(WAFFLE_PREFIX_INCLUDE_DIR)
 unset(WAFFLE_VERSION_H)
-- 
1.8.0



More information about the Piglit mailing list