diff options
author | Patrick Steinhardt <ps@pks.im> | 2017-10-20 07:29:17 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2017-10-20 07:38:34 +0200 |
commit | 4da74c83e4263bb2d62c85af6188d223fd0157d6 (patch) | |
tree | 39a8b2be5fb2f63f85e049ed68526e481f11d91e /deps | |
parent | 661cf4d4974d6381f1482f169f9292262192140d (diff) | |
download | libgit2-4da74c83e4263bb2d62c85af6188d223fd0157d6.tar.gz |
cmake: use project-relative binary and source directories
Due to our split of CMake files into multiple modules, we had to replace
some uses of the `${CMAKE_CURRENT_SOURCE_DIR}` and
`${CMAKE_CURRENT_BINARY_DIR}` variables and replace them with
`${CMAKE_SOURCE_DIR}` and `${CMAKE_BINARY_DIR}`. This enabled us to
still be able to refer to top-level files when defining build
instructions inside of a subdirectory.
When replacing all variables, it was assumed that the absolute set of
variables is always relative to the current project. But in fact, this
is not the case, as these variables always point to the source and
binary directory as given by the top-levl project. So the change
actually broke the ability to include libgit2 directly as a subproject,
as source files cannot be found anymore.
Fix this by instead using project-specific source and binary directories
with `${libgit2_SOURCE_DIR}` and `${libgit2_BINARY_DIR}`.
Diffstat (limited to 'deps')
-rw-r--r-- | deps/winhttp/CMakeLists.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/deps/winhttp/CMakeLists.txt b/deps/winhttp/CMakeLists.txt index baa9fe2f0..148ac3ebc 100644 --- a/deps/winhttp/CMakeLists.txt +++ b/deps/winhttp/CMakeLists.txt @@ -3,7 +3,7 @@ IF (NOT DLLTOOL) MESSAGE(FATAL_ERROR "Could not find dlltool command") ENDIF () -SET(LIBWINHTTP_PATH "${CMAKE_BINARY_DIR}/deps/winhttp") +SET(LIBWINHTTP_PATH "${libgit2_BINARY_DIR}/deps/winhttp") SET(LIBWINHTTP_PATH ${LIBWINHTTP_PATH} PARENT_SCOPE) FILE(MAKE_DIRECTORY ${LIBWINHTTP_PATH}) |