From d5bfa0ee80149eda9d97935fd985fa0077011bfb Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Sun, 6 Aug 2023 14:07:30 +0200 Subject: [PATCH] Use install dir instead of project root for build stamp file. Otherwise only one version will be built. --- recipes/CMakeProject/recipe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/CMakeProject/recipe.py b/recipes/CMakeProject/recipe.py index f00e10c..e2e30e4 100644 --- a/recipes/CMakeProject/recipe.py +++ b/recipes/CMakeProject/recipe.py @@ -11,7 +11,7 @@ def cook(env: Environment, project_root: str, generate_args: 'list[str]' = [], b config = env['BUILD_TYPE'] build_dir = os.path.join(project_root, f'build_{config}') install_dir = os.path.join(project_root, f'install_{config}') - is_built = os.path.exists(os.path.join(project_root, _BUILT_STAMPFILE)) + is_built = os.path.exists(os.path.join(install_dir, _BUILT_STAMPFILE)) if not is_built or env['UPDATE_REPOSITORIES']: print(f'Building {project_root}, config {config}') os.makedirs(build_dir, exist_ok=True) @@ -24,7 +24,7 @@ def cook(env: Environment, project_root: str, generate_args: 'list[str]' = [], b subprocess.run(('cmake', '-G', 'Ninja', '-B', build_dir, f'-DCMAKE_BUILD_TYPE={build_type}', f'-DCMAKE_INSTALL_PREFIX={install_dir}', *generate_args, project_root), stdout=sys.stdout, stderr=sys.stderr, check=True) subprocess.run(('cmake', '--build', *build_args, build_dir), stdout=sys.stdout, stderr=sys.stderr, check=True) subprocess.run(('cmake', '--install', *install_args, build_dir), stdout=sys.stdout, stderr=sys.stderr, check=True) - pathlib.Path(project_root, _BUILT_STAMPFILE).touch() + pathlib.Path(install_dir, _BUILT_STAMPFILE).touch() return { 'LIBPATH': [os.path.join(install_dir, 'lib')],