From 1f86b707e3a845f2c403e77173d0859dbf6aa4b0 Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Sat, 19 Sep 2015 15:19:28 -0700 Subject: cmake: Don't explicitly look for python2 * Use the system python binary and make sure the generator works with both instead. --- extra/FindNanopb.cmake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'extra') diff --git a/extra/FindNanopb.cmake b/extra/FindNanopb.cmake index e65706ac..1fd25334 100644 --- a/extra/FindNanopb.cmake +++ b/extra/FindNanopb.cmake @@ -175,7 +175,7 @@ function(NANOPB_GENERATE_CPP SRCS HDRS) add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.c" "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h" - COMMAND ${PYTHON2_EXECUTABLE} + COMMAND ${PYTHON_EXECUTABLE} ARGS ${NANOPB_GENERATOR_EXECUTABLE} ${FIL_WE}.pb ${NANOPB_OPTIONS} DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb" COMMENT "Running nanopb generator on ${FIL_WE}.pb" @@ -244,17 +244,7 @@ find_file(NANOPB_GENERATOR_EXECUTABLE ) mark_as_advanced(NANOPB_GENERATOR_EXECUTABLE) -# If python3 has already been found, save it and look for python2.6 -if(${PYTHON_VERSION_MAJOR} AND ${PYTHON_VERSION_MAJOR} EQUAL 3) - set(PYTHON3_EXECUTABLE ${PYTHON_EXECUTABLE}) - set(PYTHON_EXECUTABLE PYTHON_EXECUTABLE-NOTFOUND) - find_package(PythonInterp 2.6 REQUIRED) - set(PYTHON2_EXECUTABLE ${PYTHON_EXECUTABLE}) - set(PYTHON_EXECUTABLE ${PYTHON3_EXECUTABLE}) -else() - find_package(PythonInterp 2.6 REQUIRED) - set(PYTHON2_EXECUTABLE ${PYTHON_EXECUTABLE}) -endif() +find_package(PythonInterp REQUIRED) include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(NANOPB DEFAULT_MSG -- cgit 1.2.3-korg