mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
cmake: add BUILDPYTHON3 flag
Use the same methodology as in mraa, by default build for python2, if requested use python3 for everything Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
parent
a48f457057
commit
10d784ea7e
@ -51,6 +51,7 @@ set (CMAKE_SWIG_FLAGS "")
|
||||
option (BUILDDOC "Build all doc." OFF)
|
||||
option (BUILDSWIG "Build swig modules." ON)
|
||||
option (BUILDSWIGPYTHON "Build swig python modules." ON)
|
||||
option (BUILDPYTHON3 "Use python3 for building/installing/testing" OFF)
|
||||
option (BUILDSWIGNODE "Build swig node modules." ON)
|
||||
option (BUILDEXAMPLES "Build C++ example binaries" OFF)
|
||||
option (BUILDJAVAEXAMPLES "Build java example jars" OFF)
|
||||
@ -231,10 +232,18 @@ if(BUILDJAVAEXAMPLES)
|
||||
add_subdirectory (examples/java)
|
||||
endif()
|
||||
|
||||
if(BUILDTESTS)
|
||||
find_package (PythonInterp REQUIRED)
|
||||
if (${PYTHONINTERP_FOUND})
|
||||
enable_testing ()
|
||||
add_subdirectory (tests)
|
||||
endif ()
|
||||
if (BUILDSWIGPYTHON OR BUILDTESTS)
|
||||
if (BUILDPYTHON3)
|
||||
set (PYTHONBUILD_VERSION 3)
|
||||
else ()
|
||||
set (PYTHONBUILD_VERSION 2.7)
|
||||
endif ()
|
||||
find_package (PythonInterp ${PYTHONBUILD_VERSION} REQUIRED)
|
||||
find_package (PythonLibs ${PYTHONBUILD_VERSION} REQUIRED)
|
||||
include_directories(${PYTHON_INCLUDE_PATH})
|
||||
endif ()
|
||||
|
||||
if (BUILDTESTS)
|
||||
enable_testing ()
|
||||
add_subdirectory (tests)
|
||||
endif()
|
||||
|
@ -140,13 +140,7 @@ macro(upm_doxygen)
|
||||
endmacro()
|
||||
|
||||
if (SWIG_FOUND)
|
||||
if(BUILDSWIGPYTHON)
|
||||
find_package (PythonLibs)
|
||||
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
|
||||
list (GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
|
||||
list (GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
|
||||
endif(BUILDSWIGPYTHON)
|
||||
if(BUILDSWIGNODE)
|
||||
if (BUILDSWIGNODE)
|
||||
if(NOT NODE_FOUND)
|
||||
find_package(Node)
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user