diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2014-12-29 09:36:51 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2014-12-31 18:42:08 -0800 |
commit | 6fb98d621a1b123b08f5575eb051458f13998c9d (patch) | |
tree | 1f89d1b376e284e5d8e9fcdf537fe1fef28331f3 | |
parent | 222e44b7f0014ec267b1214225e9d09a41e255ef (diff) |
cmake: fix version search
Currently the cmake file uses both WAFFLE_INCLUDE_DIR and
WAFFLE_INCLUDE_DIRS, but only the DIRS version is actually defined.
cmake doesn't complain about the undefined variable, instead it treats
it as a blank string. This leads to the version never being checked.
This patch replaces DIR with DIRS, which corrects the problem.
Fixes #27: https://github.com/waffle-gl/waffle/issues/27
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
-rw-r--r-- | cmake/Modules/FindWaffle.cmake | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cmake/Modules/FindWaffle.cmake b/cmake/Modules/FindWaffle.cmake index 972bdfe..4e16c4e 100644 --- a/cmake/Modules/FindWaffle.cmake +++ b/cmake/Modules/FindWaffle.cmake @@ -48,8 +48,8 @@ find_library(WAFFLE_LIBRARIES NAMES "waffle-${WAFFLE_FIND_VERSION_MAJOR}" ) -if(WAFFLE_INCLUDE_DIR AND EXISTS "${WAFFLE_INCLUDE_DIR}/waffle_version.h") - file(STRINGS "${WAFFLE_INCLUDE_DIR}/waffle_version.h" WAFFLE_VERSION_H) +if(WAFFLE_INCLUDE_DIRS AND EXISTS "${WAFFLE_INCLUDE_DIRS}/waffle_version.h") + file(STRINGS "${WAFFLE_INCLUDE_DIRS}/waffle_version.h" WAFFLE_VERSION_H) string(REGEX REPLACE "^.*WAFFLE_MAJOR_VERSION ([0-9]+).*$" "\\1" WAFFLE_MAJOR_VERSION "${WAFFLE_VERSION_H}") string(REGEX REPLACE "^.*WAFFLE_MINOR_VERSION ([0-9]+).*$" "\\1" WAFFLE_MINOR_VERSION "${WAFFLE_VERSION_H}") string(REGEX REPLACE "^.*WAFFLE_PATCH_VERSION ([0-9]+).*$" "\\1" WAFFLE_PATCH_VERSION "${WAFFLE_VERSION_H}") @@ -72,9 +72,7 @@ mark_as_advanced(WAFFLE_LIBRARIES WAFFLE_INCLUDE_DIRS) # variables from the cache *and* local scope. # unset(WAFFLE_FIND_VERSION_MAJOR CACHE) -unset(WAFFLE_INCLUDE_DIR CACHE) unset(WAFFLE_VERSION_H CACHE) unset(WAFFLE_FIND_VERSION_MAJOR) -unset(WAFFLE_INCLUDE_DIR) unset(WAFFLE_VERSION_H) |