diff --git a/tools/onnx2daq/python/setup.py b/tools/onnx2daq/python/setup.py index 98a471a..81c5e04 100644 --- a/tools/onnx2daq/python/setup.py +++ b/tools/onnx2daq/python/setup.py @@ -108,7 +108,6 @@ def build_extension(self, ext): '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DPY_EXT_SUFFIX={}'.format(sysconfig.get_config_var('EXT_SUFFIX') or ''), '-DDNN_BUILD_PYTHON=ON', - '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}'.format(extdir), ] if COVERAGE or DEBUG: # in order to get accurate coverage information, the @@ -144,6 +143,21 @@ def build_extension(self, ext): build_args.extend(['--', '-j', str(multiprocessing.cpu_count())]) subprocess.check_call(build_args) + fullname = self.get_ext_fullname(ext.name) + filename = os.path.basename(self.get_ext_filename(fullname)) + + lib_path = os.path.join(CMAKE_BUILD_DIR, 'tools', 'onnx2daq') + if os.name == 'nt': + debug_lib_dir = os.path.join(lib_path, "Debug") + release_lib_dir = os.path.join(lib_path, "Release") + if os.path.exists(debug_lib_dir): + lib_path = debug_lib_dir + elif os.path.exists(release_lib_dir): + lib_path = release_lib_dir + src = os.path.join(lib_path, filename) + dst = os.path.join(os.path.realpath(self.build_lib), "onnx2daq", filename) + self.copy_file(src, dst) + cmdclass = { 'build_ext': build_ext,