knx/pybind11/commands.py
Thomas Kunze f34e604d3b Squashed 'examples/knxPython/pybind11/' content from commit 59a2ac27
git-subtree-dir: examples/knxPython/pybind11
git-subtree-split: 59a2ac2745d8a57ac94c6accced73620d59fb844
2020-10-28 21:09:58 +01:00

23 lines
663 B
Python

# -*- coding: utf-8 -*-
import os
DIR = os.path.abspath(os.path.dirname(__file__))
def get_include(user=False):
# type: (bool) -> str
installed_path = os.path.join(DIR, "include")
source_path = os.path.join(os.path.dirname(DIR), "include")
return installed_path if os.path.exists(installed_path) else source_path
def get_cmake_dir():
# type: () -> str
cmake_installed_path = os.path.join(DIR, "share", "cmake", "pybind11")
if os.path.exists(cmake_installed_path):
return cmake_installed_path
else:
msg = "pybind11 not installed, installation required to access the CMake files"
raise ImportError(msg)