From 5e92b3e608c98e1484a8a237db4b03bd807452a3 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Wed, 8 Feb 2017 17:43:23 -0500 Subject: [PATCH] Fix path to libsize.py (#658) Use PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR as the base of the path to libsize.py. This fixes an error if pybind11 is being built directly within another project. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 763ad54a..acb67fca 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -107,7 +107,7 @@ endif() # And another to show the .so size and, if a previous size, compare it: add_custom_command(TARGET pybind11_tests POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/libsize.py + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/libsize.py $ ${CMAKE_CURRENT_BINARY_DIR}/sosize-$.txt) # Test CMake build using functions and targets from subdirectory or installed location