diff options
author | Matt Stancliff <matt@genges.com> | 2017-01-12 13:38:25 +0800 |
---|---|---|
committer | Matt Stancliff <matt@genges.com> | 2017-01-12 13:46:03 +0800 |
commit | 5e6c9983dd5a96e28bcf02a123b3db6182b807dc (patch) | |
tree | e9d347571dc76805f5e3e6f23bf7b6b5b0103dd9 /CMakeLists.txt | |
parent | 9f9fdc05314a3a961fb78c9e7fd1c34fa24b5846 (diff) | |
download | portable-5e6c9983dd5a96e28bcf02a123b3db6182b807dc.tar.gz portable-5e6c9983dd5a96e28bcf02a123b3db6182b807dc.tar.bz2 portable-5e6c9983dd5a96e28bcf02a123b3db6182b807dc.zip |
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).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files 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) | |||
8 | 8 | ||
9 | enable_testing() | 9 | enable_testing() |
10 | 10 | ||
11 | file(READ ${CMAKE_SOURCE_DIR}/ssl/VERSION SSL_VERSION) | 11 | file(READ ${CMAKE_CURRENT_SOURCE_DIR}/ssl/VERSION SSL_VERSION) |
12 | string(STRIP ${SSL_VERSION} SSL_VERSION) | 12 | string(STRIP ${SSL_VERSION} SSL_VERSION) |
13 | string(REPLACE ":" "." SSL_VERSION ${SSL_VERSION}) | 13 | string(REPLACE ":" "." SSL_VERSION ${SSL_VERSION}) |
14 | string(REGEX REPLACE "\\..*" "" SSL_MAJOR_VERSION ${SSL_VERSION}) | 14 | string(REGEX REPLACE "\\..*" "" SSL_MAJOR_VERSION ${SSL_VERSION}) |
15 | 15 | ||
16 | file(READ ${CMAKE_SOURCE_DIR}/crypto/VERSION CRYPTO_VERSION) | 16 | file(READ ${CMAKE_CURRENT_SOURCE_DIR}/crypto/VERSION CRYPTO_VERSION) |
17 | string(STRIP ${CRYPTO_VERSION} CRYPTO_VERSION) | 17 | string(STRIP ${CRYPTO_VERSION} CRYPTO_VERSION) |
18 | string(REPLACE ":" "." CRYPTO_VERSION ${CRYPTO_VERSION}) | 18 | string(REPLACE ":" "." CRYPTO_VERSION ${CRYPTO_VERSION}) |
19 | string(REGEX REPLACE "\\..*" "" CRYPTO_MAJOR_VERSION ${CRYPTO_VERSION}) | 19 | string(REGEX REPLACE "\\..*" "" CRYPTO_MAJOR_VERSION ${CRYPTO_VERSION}) |
20 | 20 | ||
21 | file(READ ${CMAKE_SOURCE_DIR}/tls/VERSION TLS_VERSION) | 21 | file(READ ${CMAKE_CURRENT_SOURCE_DIR}/tls/VERSION TLS_VERSION) |
22 | string(STRIP ${TLS_VERSION} TLS_VERSION) | 22 | string(STRIP ${TLS_VERSION} TLS_VERSION) |
23 | string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) | 23 | string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) |
24 | string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) | 24 | string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) |