Skip to content

Commit

Permalink
Add post installation step
Browse files Browse the repository at this point in the history
Add sym link of the installed directory into the shared compiled tools directory
  • Loading branch information
guiguem authored Oct 13, 2023
1 parent 499dc89 commit c920fc0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hkinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,19 @@ class hkLibToolPackTemplate(CMake):
def __init__(self, path):
super().__init__(path)
self._package_name = "hk-LibToolPackTemplate"

def post_install(self):
# Run standard post_install step
super().post_install()

# Link compiled tool into
compiled_tools_folder = os.environ.get("HK_COMPILEDTOOLS_DIR")
logger.info(f"Linking installation to {compiled_tools_folder}")
if not os.path.exists(compiled_tools_folder):
logger.debug("Folder doesn't exist: creating it")
os.mkdir(compiled_tools_folder)
symlink = os.path.join(compiled_tools_folder, self._package_name)
# if os.path.exists(symlink):
os.symlink(self._install_folder, symlink)
return True

0 comments on commit c920fc0

Please sign in to comment.