Browse Source

Unset cached variables on failure in Jansson find module

BtbN 11 years ago
parent
commit
602b048089
1 changed files with 5 additions and 0 deletions
  1. 5 0
      cmake/Modules/FindJansson.cmake

+ 5 - 0
cmake/Modules/FindJansson.cmake

@@ -59,5 +59,10 @@ else()
 		REQUIRED_VARS Jansson_LIB Jansson_INCLUDE_DIR
 		VERSION_VAR JANSSON_VERSION)
 	mark_as_advanced(Jansson_INCLUDE_DIR Jansson_LIB)
+
+	if(NOT JANSSON_FOUND)
+		unset(JANSSON_INCLUDE_DIRS CACHE)
+		unset(JANSSON_LIBRARIES CACHE)
+	endif()
 endif()