CMakeLists: make DAWN_THIRD_PARTY_DIR an option.

Also output more context when failing to run the code generator.

Bug: None
Change-Id: I6685c062a074ad11a8fd67f19b8698ce9bcf6694
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30560
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8394d03..2766db7b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,6 @@
 set(DAWN_SRC_DIR "${Dawn_SOURCE_DIR}/src")
 set(DAWN_INCLUDE_DIR "${DAWN_SRC_DIR}/include")
 set(DAWN_TEMPLATE_DIR "${DAWN_GENERATOR_DIR}/templates")
-set(DAWN_THIRD_PARTY_DIR "${Dawn_SOURCE_DIR}/third_party")
 
 set(DAWN_DUMMY_FILE "${DAWN_SRC_DIR}/Dummy.cpp")
 
@@ -75,6 +74,8 @@
 
 option(DAWN_BUILD_EXAMPLES "Enables building Dawn's exmaples" ON)
 
+set(DAWN_THIRD_PARTY_DIR "${Dawn_SOURCE_DIR}/third_party" CACHE STRING "Directory in which to find third-party dependencies.")
+
 set(DAWN_GLFW_DIR "${DAWN_THIRD_PARTY_DIR}/glfw" CACHE STRING "Directory in which to find GLFW")
 set(DAWN_GLM_DIR "${DAWN_THIRD_PARTY_DIR}/glm" CACHE STRING "Directory in which to find GLM")
 set(DAWN_GLSLANG_DIR "${DAWN_THIRD_PARTY_DIR}/glslang" CACHE STRING "Directory in which to find GLSLang")