ProjectConverter icon indicating copy to clipboard operation
ProjectConverter copied to clipboard

abspath dependence

Open boger047 opened this issue 1 year ago • 0 comments

The scenario I'm using requires an absolute path, and the call to template_dir in cmake.py requires that the program execution path be in the same directory as the script

this is my solution

abspath = os.path.abspath(os.path.join(self.path,'CMakeLists.txt'))
self.generateFile('CMakeLists.txt', abspath)

replace to

template_path = os.path.split(os.path.realpath(__file__))[0]

abspath = os.path.abspath(os.path.join(self.path,'CMakeLists.txt'))
self.generateFile('CMakeLists.txt', abspath, template_dir=template_path)
self.linkerScript('STM32FLASH.ld',os.path.join(self.path,'STM32FLASH.ld'), template_path)

boger047 avatar Jul 29 '24 11:07 boger047