mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-23 05:35:13 +00:00
9df2f1ff13
* Apply isort * Tweak isort config * Add env.py as a known_first_party * Add one missing known first party * Make config compat with older isort versions * Add another comment * Revert pyproject setting
22 lines
662 B
Python
22 lines
662 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)
|