From 95e170653799f05f84042e3b411ea1ae0bea45ad Mon Sep 17 00:00:00 2001 From: Chris Kitching Date: Mon, 16 Oct 2017 20:22:12 +0100 Subject: [PATCH] Don't reinvent find_package PythonInterp is a finder module that ships with cmake. It supports the conventional interaction with find_package that allows you to demand success, and particular vesions, without having your own logic: https://cmake.org/cmake/help/v3.0/command/find_package.html [ROCm/clr commit: c62766f880eae1d423c08bacc43e7c9d9c18bca1] --- projects/clr/hipamd/hipify-clang/CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/projects/clr/hipamd/hipify-clang/CMakeLists.txt b/projects/clr/hipamd/hipify-clang/CMakeLists.txt index 6e3f4e80de..4c6dc8aec8 100644 --- a/projects/clr/hipamd/hipify-clang/CMakeLists.txt +++ b/projects/clr/hipamd/hipify-clang/CMakeLists.txt @@ -66,14 +66,7 @@ install(TARGETS hipify-clang DESTINATION bin) if (HIPIFY_CLANG_TESTS) # tests - set(Python_ADDITIONAL_VERSIONS 2.7) - include(FindPythonInterp) - if(NOT PYTHONINTERP_FOUND) - message(FATAL_ERROR - "Unable to find Python interpreter, required for builds and testing.\n\n" - "Please install Python or specify the PYTHON_EXECUTABLE CMake variable.") - endif() - + find_package(PythonInterp 2.7 REQUIRED EXACT) find_program(LIT_COMMAND lit) set(BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})