cmake_minimum_required(VERSION 2.8.7)
project(libiio-py)

include(FindPythonInterp)

if (PYTHONINTERP_FOUND)
	option(PYTHON_BINDINGS "Install Python bindings" ON)

	if (PYTHON_BINDINGS)
		set(SETUP_PY_IN ${CMAKE_CURRENT_SOURCE_DIR}/setup.py.cmakein)
		set(SETUP_PY ${CMAKE_CURRENT_BINARY_DIR}/setup.py)

		configure_file(${SETUP_PY_IN} ${SETUP_PY})

		install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} install --root=$DESTDIR --prefix=${CMAKE_INSTALL_PREFIX})")
	endif()
endif()

cmake_minimum_required(VERSION 2.8.7)
project(libiio-py)

include(FindPythonInterp)

if (PYTHONINTERP_FOUND)
	option(PYTHON_BINDINGS "Install Python bindings" ON)

	if (PYTHON_BINDINGS)
		set(SETUP_PY_IN ${CMAKE_CURRENT_SOURCE_DIR}/setup.py.cmakein)
		set(SETUP_PY ${CMAKE_CURRENT_BINARY_DIR}/setup.py)

		configure_file(${SETUP_PY_IN} ${SETUP_PY})

		install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} install --root=\$ENV{DESTDIR}/ --prefix=${CMAKE_INSTALL_PREFIX})")
	endif()
endif()

Fix installation of Python bindings when DESTDIR is not used
CMake: Fix installation of Python bindings when DESTDIR is not used

Signed-off-by: Paul Cercueil <73d292422978d45c9eeef455bb1b24a0db453722@analog.com>
