setup.py
def run(self):
        """
        Copy libraries from the bin directory and place them as appropriate
        """
        self.announce("Moving library files", level=3)
        # We have already built the libraries in the previous build_ext step
        self.skip_build = True
        if hasattr(self.distribution, 'bin_dir'):
            bin_dir = self.distribution.bin_dir
        else:
            bin_dir = os.path.join(self.build_dir)
        # Depending on the files that are generated from your cmake
        # build chain, you may need to change the below code, such that
        # your files are moved to the appropriate location when the installation
        # is run
        libs = [os.path.join(bin_dir, _lib) for _lib in 
                os.listdir(bin_dir) if 
                os.path.isfile(os.path.join(bin_dir, _lib)) and 
                os.path.splitext(_lib)[1] in [".dll", ".so"]
                and not (_lib.startswith("python") or _lib.startswith(PACKAGE_NAME))]
        for lib in libs:
            shutil.move(lib, os.path.join(self.build_dir,
                                          os.path.basename(lib)))
        # Mark the libs for installation, adding them to 
        # distribution.data_files seems to ensure that setuptools' record 
        # writer appends them to installed-files.txt in the package's egg-info
        #
        # Also tried adding the libraries to the distribution.libraries list, 
        # but that never seemed to add them to the installed-files.txt in the 
        # egg-info, and the online recommendation seems to be adding libraries 
        # into eager_resources in the call to setup(), which I think puts them 
        # in data_files anyways. 
        # 
        # What is the best way?
        # These are the additional installation files that should be
        # included in the package, but are resultant of the cmake build
        # step; depending on the files that are generated from your cmake
        # build chain, you may need to modify the below code
        self.distribution.data_files = [os.path.join(self.install_dir, 
                                                     os.path.basename(lib))
                                        for lib in libs]
        # Must be forced to run after adding the libs to data_files
        self.distribution.run_command("install_data")
        super(InstallCMakeLibs, self).run()

        Copy libraries from the bin directory and place them as appropriate
        
Copy libraries from the bin directory and place them as appropriate
Copy libraries from the bin directory and place them as appropriate
def run(self):
        self.announce("Moving library files", level=3)
        self.skip_build = True
        if hasattr(self.distribution, 'bin_dir'):
            bin_dir = self.distribution.bin_dir
        else:
            bin_dir = os.path.join(self.build_dir)
        libs = [os.path.join(bin_dir, _lib) for _lib in 
                os.listdir(bin_dir) if 
                os.path.isfile(os.path.join(bin_dir, _lib)) and 
                os.path.splitext(_lib)[1] in [".dll", ".so"]
                and not (_lib.startswith("python") or _lib.startswith(PACKAGE_NAME))]
        for lib in libs:
            shutil.move(lib, os.path.join(self.build_dir,
                                          os.path.basename(lib)))
         Also tried adding the libraries to the distribution.libraries list, 
         but that never seemed to add them to the installed-files.txt in the 
         egg-info, and the online recommendation seems to be adding libraries 
         into eager_resources in the call to setup(), which I think puts them 
         in data_files anyways. 
         What is the best way?
         These are the additional installation files that should be
         included in the package, but are resultant of the cmake build
         step; depending on the files that are generated from your cmake
         build chain, you may need to modify the below code
        self.distribution.data_files = [os.path.join(self.install_dir, 
                                                     os.path.basename(lib))
                                        for lib in libs]
         Must be forced to run after adding the libs to data_files
        self.distribution.run_command("install_data")
        super(InstallCMakeLibs, self).run()
def run ( self ) : self . announce ( "Moving library files" , level = 3 ) self . skip_build = True if hasattr ( self . distribution , 'bin_dir' ) : bin_dir = self . distribution . bin_dir else : bin_dir = os . path . join ( self . build_dir ) libs = [ os . path . join ( bin_dir , _lib ) for _lib in os . listdir ( bin_dir ) if os . path . isfile ( os . path . join ( bin_dir , _lib ) ) and os . path . splitext ( _lib ) [ 1 ] in [ ".dll" , ".so" ] and not ( _lib . startswith ( "python" ) or _lib . startswith ( PACKAGE_NAME ) ) ] for lib in libs : shutil . move ( lib , os . path . join ( self . build_dir , os . path . basename ( lib ) ) ) self . distribution . data_files = [ os . path . join ( self . install_dir , os . path . basename ( lib ) ) for lib in libs ] self . distribution . run_command ( "install_data" ) super ( InstallCMakeLibs , self ) . run ( )
Copy libraries from the bin directory and place them as appropriate
Copy libraries from the bin directory and place them as appropriate
"""
        Copy libraries from the bin directory and place them as appropriate
        """ # We have already built the libraries in the previous build_ext step # Depending on the files that are generated from your cmake # build chain, you may need to change the below code, such that # your files are moved to the appropriate location when the installation # is run # Mark the libs for installation, adding them to  # distribution.data_files seems to ensure that setuptools' record  # writer appends them to installed-files.txt in the package's egg-info # # Also tried adding the libraries to the distribution.libraries list,  # but that never seemed to add them to the installed-files.txt in the  # egg-info, and the online recommendation seems to be adding libraries  # into eager_resources in the call to setup(), which I think puts them  # in data_files anyways.  #  # What is the best way? # These are the additional installation files that should be # included in the package, but are resultant of the cmake build # step; depending on the files that are generated from your cmake # build chain, you may need to modify the below code # Must be forced to run after adding the libs to data_files
self