From 312d9d0ac5c280e81aee0689045a10ae441b4db1 Mon Sep 17 00:00:00 2001 From: Daniel Varga Date: Mon, 10 Apr 2017 17:43:05 +0200 Subject: [PATCH] Fix cmake file not to use CMAKE_SOURCE_DIR (#367) Using CMAKE_SOURCE_DIR benchmark cannot be built as part of a project. This change allows to add benchmark using add_subdirectory to a bigger project. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d517b3cc..77077739 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,7 +49,7 @@ write_basic_package_version_file( "${version_config}" VERSION ${GIT_VERSION} COMPATIBILITY SameMajorVersion ) -configure_file("${CMAKE_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" @ONLY) +configure_file("${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" @ONLY) # Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable) install(