summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTony Kelman <tony@kelman.net>2015-03-16 13:30:10 -0700
committerTony Kelman <tony@kelman.net>2015-03-16 13:59:33 -0700
commitd612e48ecc74a2b9140a3d7f4357537af3c6465e (patch)
tree10cc1bac05e6ed22865c4fd99501d9bfc31de2f8 /CMakeLists.txt
parent3066026b0468730ac36850c276f6dab7140f2093 (diff)
downloadlibgit2-d612e48ecc74a2b9140a3d7f4357537af3c6465e.tar.gz
Fix out-of-tree build
link against crypt32 for CertFreeCertificateContext
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e52ef904..f7db9ffa2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -163,12 +163,13 @@ IF (WIN32 AND WINHTTP)
MESSAGE(FATAL_ERROR "Could not find dlltool command")
ENDIF ()
- SET(LIBWINHTTP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp")
+ SET(LIBWINHTTP_PATH "${CMAKE_CURRENT_BINARY_DIR}/deps/winhttp")
+ FILE(MAKE_DIRECTORY ${LIBWINHTTP_PATH})
ADD_CUSTOM_COMMAND(
OUTPUT ${LIBWINHTTP_PATH}/libwinhttp.a
- COMMAND ${DLLTOOL} -d winhttp.def -k -D winhttp.dll -l libwinhttp.a
- DEPENDS ${LIBWINHTTP_PATH}/winhttp.def
+ COMMAND ${DLLTOOL} -d ${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp.def -k -D winhttp.dll -l libwinhttp.a
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp.def
WORKING_DIRECTORY ${LIBWINHTTP_PATH}
)
@@ -178,7 +179,8 @@ IF (WIN32 AND WINHTTP)
)
INCLUDE_DIRECTORIES(deps/winhttp)
- LINK_DIRECTORIES(deps/winhttp)
+ LINK_DIRECTORIES(${LIBWINHTTP_PATH})
+ LINK_LIBRARIES(crypt32)
ENDIF ()
LINK_LIBRARIES(winhttp rpcrt4)