diff options
author | Kyle Manna <kyle@kylemanna.com> | 2015-09-19 15:19:28 -0700 |
---|---|---|
committer | Kyle Manna <kyle@kylemanna.com> | 2015-09-20 18:48:06 -0700 |
commit | 1f86b707e3a845f2c403e77173d0859dbf6aa4b0 (patch) | |
tree | 8b0aeedd6c703d2642e2d5ffb7660f8742288ddb /extra | |
parent | b222209e1bf80b2e855817d8f9287c5e2dc1eb04 (diff) |
cmake: Don't explicitly look for python2
* Use the system python binary and make sure the generator works with
both instead.
Diffstat (limited to 'extra')
-rw-r--r-- | extra/FindNanopb.cmake | 14 |
1 files changed, 2 insertions, 12 deletions
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 |