xiaobai added a comment. @sgraenitz: I don't think `find_package` alone will help you here. LLVMConfig doesn't necessarily tell you what's actually been built and/or installed, but it can tell you what's exported. Here's what I would do:
1. List the tools you need for `LLDB_TEST_DEPS` from LLVM 2. For each tool, check to see if it's exported from the LLVM CMake package (this is as simple as checking if it's a target) 3. If it's not exported, proceed to the next tool 4. If it is exported, use `find_program` to check if it was built/installed (LLVMConfig should tell you where it is -- `LLVM_TOOLS_BINARY_DIR`) 5. If it is built, add it to `LLDB_TEST_DEPS`. 6. If it's not built, don't add it to `LLDB_TEST_DEPS`. I think this should work regardless of if you have a build tree or an install tree. I don't see any logic in here that is specific to one or the other, but if you absolutely do need to check, probably the most reliable way is to check for the existince of the `LLVM_BUILD_*` variables. I think the install tree also has a variable `LLVM_INSTALL_PREFIX`, so that could be another way to check. Repository: rLLDB LLDB CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58193/new/ https://reviews.llvm.org/D58193 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits