def test_set_skbuild_plat_name(): try: previous_plat_name = skbuild_plat_name() set_skbuild_plat_name("plat-name") assert os.path.join("_skbuild", "plat-name-{}.{}".format(*sys.version_info[:2])) == SKBUILD_DIR() finally: set_skbuild_plat_name(previous_plat_name)
if cmake_version < LegacyVersion("3.5") or cmake_version >= LegacyVersion( "3.15"): setup_requires.append('cmake<3.15') except SKBuildError: setup_requires.append('cmake<3.15') # If you want to re-build the cython cpp file (DracoPy.cpp), run: # cython --cplus -3 -I./_skbuild/linux-x86_64-3.7/cmake-install/include/draco/ ./src/TrakoDracoPy.pyx # Replace "linux-x86_64-3.6" with the directory under _skbuild in your system # Draco must already be built/setup.py already be run before running the above command src_dir = './src' lib_dir = os.path.abspath(os.path.join(CMAKE_INSTALL_DIR(), 'lib/')) cmake_args = [] if sys.platform == 'darwin': plat_name = skbuild_plat_name() sep = [pos for pos, char in enumerate(plat_name) if char == '-'] assert len(sep) == 2 cmake_args = [ '-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=' + plat_name[sep[0] + 1:sep[1]], '-DCMAKE_OSX_ARCHITECTURES:STRING=' + plat_name[sep[1] + 1:] ] library_link_args = [ '-l{0}'.format(lib) for lib in ('dracoenc', 'draco', 'dracodec') ] else: library_link_args = [ '-l:{0}'.format(lib) for lib in ('libdracoenc.so', 'libdraco.so', 'libdracodec.so', 'libdracoenc.so.1', 'libdraco.so.1', 'libdracodec.so.1') ]