aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2017-01-12 13:38:25 +0800
committerMatt Stancliff <matt@genges.com>2017-01-12 13:46:03 +0800
commit5e6c9983dd5a96e28bcf02a123b3db6182b807dc (patch)
treee9d347571dc76805f5e3e6f23bf7b6b5b0103dd9 /CMakeLists.txt
parent9f9fdc05314a3a961fb78c9e7fd1c34fa24b5846 (diff)
downloadportable-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.txt6
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
9enable_testing() 9enable_testing()
10 10
11file(READ ${CMAKE_SOURCE_DIR}/ssl/VERSION SSL_VERSION) 11file(READ ${CMAKE_CURRENT_SOURCE_DIR}/ssl/VERSION SSL_VERSION)
12string(STRIP ${SSL_VERSION} SSL_VERSION) 12string(STRIP ${SSL_VERSION} SSL_VERSION)
13string(REPLACE ":" "." SSL_VERSION ${SSL_VERSION}) 13string(REPLACE ":" "." SSL_VERSION ${SSL_VERSION})
14string(REGEX REPLACE "\\..*" "" SSL_MAJOR_VERSION ${SSL_VERSION}) 14string(REGEX REPLACE "\\..*" "" SSL_MAJOR_VERSION ${SSL_VERSION})
15 15
16file(READ ${CMAKE_SOURCE_DIR}/crypto/VERSION CRYPTO_VERSION) 16file(READ ${CMAKE_CURRENT_SOURCE_DIR}/crypto/VERSION CRYPTO_VERSION)
17string(STRIP ${CRYPTO_VERSION} CRYPTO_VERSION) 17string(STRIP ${CRYPTO_VERSION} CRYPTO_VERSION)
18string(REPLACE ":" "." CRYPTO_VERSION ${CRYPTO_VERSION}) 18string(REPLACE ":" "." CRYPTO_VERSION ${CRYPTO_VERSION})
19string(REGEX REPLACE "\\..*" "" CRYPTO_MAJOR_VERSION ${CRYPTO_VERSION}) 19string(REGEX REPLACE "\\..*" "" CRYPTO_MAJOR_VERSION ${CRYPTO_VERSION})
20 20
21file(READ ${CMAKE_SOURCE_DIR}/tls/VERSION TLS_VERSION) 21file(READ ${CMAKE_CURRENT_SOURCE_DIR}/tls/VERSION TLS_VERSION)
22string(STRIP ${TLS_VERSION} TLS_VERSION) 22string(STRIP ${TLS_VERSION} TLS_VERSION)
23string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION}) 23string(REPLACE ":" "." TLS_VERSION ${TLS_VERSION})
24string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION}) 24string(REGEX REPLACE "\\..*" "" TLS_MAJOR_VERSION ${TLS_VERSION})