From 3e8155eb345c602ef8fb5ad0f580cad982bf1641 Mon Sep 17 00:00:00 2001
From: Brent Huisman <brenthuisman@users.noreply.github.com>
Date: Tue, 8 Dec 2020 20:24:15 +0100
Subject: [PATCH] Fixes #1266 (#1267)

Replace CMAKE_SOURCE_DIR with PROJECT_SOURCE_DIR to pick up the correct paths when used as a sub-module.

Fixes #1266.
---
 python/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index bd487a9a..d0cd67f9 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -71,8 +71,8 @@ add_subdirectory(test)
 # The module contains the dynamic library, __init__.py and VERSION information.
 set(python_mod_path "${CMAKE_CURRENT_BINARY_DIR}/arbor")
 set_target_properties(pyarb PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${python_mod_path}")
-file(COPY "${CMAKE_SOURCE_DIR}/python/__init__.py" DESTINATION "${python_mod_path}")
-file(COPY "${CMAKE_SOURCE_DIR}/VERSION" DESTINATION "${python_mod_path}")
+file(COPY "${PROJECT_SOURCE_DIR}/python/__init__.py" DESTINATION "${python_mod_path}")
+file(COPY "${PROJECT_SOURCE_DIR}/VERSION" DESTINATION "${python_mod_path}")
 
 # Determine the installation path, according to the Python version.
 # The installation for Python 3.8 would be:
-- 
GitLab