Index: llvm/CMakeLists.txt =================================================================== --- llvm/CMakeLists.txt +++ llvm/CMakeLists.txt @@ -371,19 +371,20 @@ ) if (LLVM_ENABLE_Z3_SOLVER) - find_package(Z3 4.7.1) - if (LLVM_Z3_INSTALL_DIR) + find_package(Z3 4.7.1 HINTS ${LLVM_Z3_INSTALL_DIR}) if (NOT Z3_FOUND) message(FATAL_ERROR "Z3 >= 4.7.1 has not been found in LLVM_Z3_INSTALL_DIR: ${LLVM_Z3_INSTALL_DIR}.") endif() - endif() - - if (NOT Z3_FOUND) - message(FATAL_ERROR "LLVM_ENABLE_Z3_SOLVER cannot be enabled when Z3 is not available.") + else() + find_package(Z3 4.7.1) + if (NOT Z3_FOUND) + message(FATAL_ERROR "LLVM_ENABLE_Z3_SOLVER cannot be enabled when Z3 is not available.") + endif() endif() set(LLVM_WITH_Z3 1) + message(STATUS "Found Z3 ${Z3_VERSION_STRING} in ${Z3_DIR}") endif() set(LLVM_ENABLE_Z3_SOLVER_DEFAULT "${Z3_FOUND}")