mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +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:

committed by
Mihai Tudor Panu

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()
|
||||
|
Reference in New Issue
Block a user