From 5e6c9983dd5a96e28bcf02a123b3db6182b807dc Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Thu, 12 Jan 2017 13:38:25 +0800 Subject: [PATCH] Use correct CMake base directory offset CMAKE_SOURCE_DIR is the top-level directory of a project, but if you include this as a dependency, the file check locations won't exist at the top level of any parent project. CMAKE_CURRENT_SOURCE_DIR is the actual directory of the current project() regardless of compile mode (standalone or included in another project). --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df300af..9bff17e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,17 +8,17 @@ project (LibreSSL C) enable_testing() -file(READ ${CMAKE_SOURCE_DIR}/ssl/VERSION SSL_VERSION) +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/ssl/VERSION SSL_VERSION) string(STRIP ${SSL_VERSION} SSL_VERSION) string(REPLACE ":" "." SSL_VERSION ${SSL_VERSION}) string(REGEX REPLACE "\\..*" "" SSL_MAJOR_VERSION ${SSL_VERSION}) -file(READ ${CMAKE_SOURCE_DIR}/crypto/VERSION CRYPTO_VERSION) +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/crypto/VERSION CRYPTO_VERSION) string(STRIP ${CRYPTO_VERSION} CRYPTO_VERSION) string(REPLACE ":" "." CRYPTO_VERSION ${CRYPTO_VERSION}) string(REGEX REPLACE "\\..*" "" CRYPTO_MAJOR_VERSION ${CRYPTO_VERSION}) -file(READ ${CMAKE_SOURCE_DIR}/tls/VERSION TLS_VERSION) +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/tls/VERSION TLS_VERSION) string(STRIP ${TLS_VERSION} TLS_VERSION) string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION})