summaryrefslogtreecommitdiffstats
path: root/extra
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@github.mail.kapsi.fi>2015-09-26 12:08:55 +0300
committerPetteri Aimonen <jpa@github.mail.kapsi.fi>2015-09-26 12:08:55 +0300
commit403706c63c1b2196960c755cd4c61bd179a04c6e (patch)
tree8233f003e317cb48d2db2756ebd58b495a9a2f47 /extra
parent6cd4f20b0601ce7a68d555087ce0a62f837026ed (diff)
parent9c9f7f14e71c3b49877cca8eccd448cabea6306d (diff)
Merge pull request #169 from kylemanna/python3
Add proper Python3 support to the generator
Diffstat (limited to 'extra')
-rw-r--r--extra/FindNanopb.cmake14
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