CMake: Detect dotty.
Patch by Arnaud Allard de Grandmaison!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86153 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 9351f26..d67eaf7 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -126,6 +126,15 @@
check_type_exists(uint64_t "${headers}" HAVE_UINT64_T)
check_type_exists(u_int64_t "${headers}" HAVE_U_INT64_T)
+# available programs checks
+find_program(DOTTY_EXECUTABLE dotty)
+if(DOTTY_EXECUTABLE)
+ set(HAVE_DOTTY 1)
+ set(LLVM_PATH_DOTTY ${DOTTY_EXECUTABLE})
+ mark_as_advanced(HAVE_DOTTY)
+ mark_as_advanced(LLVM_PATH_DOTTY)
+endif()
+
# Define LLVM_MULTITHREADED if gcc atomic builtins exists.
include(CheckAtomic)
diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake
index fa5d316..4a80c3a 100644
--- a/include/llvm/Config/config.h.cmake
+++ b/include/llvm/Config/config.h.cmake
@@ -80,7 +80,7 @@
#undef HAVE_DOT
/* Define if the dotty program is available */
-#undef HAVE_DOTTY
+#cmakedefine HAVE_DOTTY ${HAVE_DOTTY}
/* Define if you have the _dyld_func_lookup function. */
#undef HAVE_DYLD
@@ -471,7 +471,7 @@
#undef LLVM_PATH_DOT
/* Define to path to dotty program if found or 'echo dotty' otherwise */
-#undef LLVM_PATH_DOTTY
+#cmakedefine LLVM_PATH_DOTTY "${LLVM_PATH_DOTTY}"
/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
#undef LLVM_PATH_GRAPHVIZ