How to copy folders with subfolders to package installation path?
I have a python package and want to copy a folder "models", that have subfolders, to installation path. In setup.py file I have tried to do that including the following lines of code:
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
(os.path.join('share', package_name, 'models'), glob('models/**', recursive=True)),]
But when I build the package I get this error: "error: can't copy 'models/': doesn't exist or not a regular file".
Please, could someone tell me how I can do it?
Thank you very much in advance for your help.
Are you trying to package this code with a wheel or debian? If you're using debian, you can use the install(DIRECTORY) command in CMakeLists.txt to copy folders.
Hello @scotie, thanks for your answer. My package is a python package, so It doesn't have a CMakeLists.txt.