@@ -18,8 +18,8 @@ SET(LIBGIT2_PC_LIBS "")
1818
1919SET (LIBGIT2_INCLUDES
2020 "${CMAKE_CURRENT_BINARY_DIR} "
21- "${CMAKE_SOURCE_DIR } /src"
22- "${CMAKE_SOURCE_DIR } /include" )
21+ "${libgit2_SOURCE_DIR } /src"
22+ "${libgit2_SOURCE_DIR } /include" )
2323SET (LIBGIT2_LIBS "" )
2424SET (LIBGIT2_LIBDIRS "" )
2525
@@ -129,9 +129,9 @@ IF (WIN32 AND WINHTTP)
129129 # Since MinGW does not come with headers or an import library for winhttp,
130130 # we have to include a private header and generate our own import library
131131 IF (MINGW)
132- ADD_SUBDIRECTORY ("${CMAKE_SOURCE_DIR } /deps/winhttp" "${CMAKE_BINARY_DIR } /deps/winhttp" )
132+ ADD_SUBDIRECTORY ("${libgit2_SOURCE_DIR } /deps/winhttp" "${libgit2_BINARY_DIR } /deps/winhttp" )
133133 LIST (APPEND LIBGIT2_LIBS winhttp)
134- LIST (APPEND LIBGIT2_INCLUDES "${CMAKE_SOURCE_DIR } /deps/winhttp" )
134+ LIST (APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR } /deps/winhttp" )
135135 LIST (APPEND LIBGIT2_LIBDIRS ${LIBWINHTTP_PATH} )
136136 ELSE ()
137137 LIST (APPEND LIBGIT2_LIBS "winhttp" )
@@ -184,8 +184,8 @@ ENDIF()
184184
185185# Include POSIX regex when it is required
186186IF (WIN32 OR AMIGA OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)" )
187- ADD_SUBDIRECTORY ("${CMAKE_SOURCE_DIR } /deps/regex" "${CMAKE_BINARY_DIR } /deps/regex" )
188- LIST (APPEND LIBGIT2_INCLUDES "${CMAKE_SOURCE_DIR } /deps/regex" )
187+ ADD_SUBDIRECTORY ("${libgit2_SOURCE_DIR } /deps/regex" "${libgit2_BINARY_DIR } /deps/regex" )
188+ LIST (APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR } /deps/regex" )
189189 LIST (APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:regex >)
190190ENDIF ()
191191
@@ -197,8 +197,8 @@ IF (USE_EXT_HTTP_PARSER AND HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUA
197197 LIST (APPEND LIBGIT2_PC_LIBS "-lhttp_parser" )
198198ELSE ()
199199 MESSAGE (STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources." )
200- ADD_SUBDIRECTORY ("${CMAKE_SOURCE_DIR } /deps/http-parser" "${CMAKE_BINARY_DIR } /deps/http-parser" )
201- LIST (APPEND LIBGIT2_INCLUDES "${CMAKE_SOURCE_DIR } /deps/http-parser" )
200+ ADD_SUBDIRECTORY ("${libgit2_SOURCE_DIR } /deps/http-parser" "${libgit2_BINARY_DIR } /deps/http-parser" )
201+ LIST (APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR } /deps/http-parser" )
202202 LIST (APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:http-parser>" )
203203ENDIF ()
204204
@@ -215,8 +215,8 @@ IF (ZLIB_FOUND)
215215 ENDIF ()
216216ELSE ()
217217 MESSAGE (STATUS "zlib was not found; using bundled 3rd-party sources." )
218- ADD_SUBDIRECTORY ("${CMAKE_SOURCE_DIR } /deps/zlib" "${CMAKE_BINARY_DIR } /deps/zlib" )
219- LIST (APPEND LIBGIT2_INCLUDES "${CMAKE_SOURCE_DIR } /deps/zlib" )
218+ ADD_SUBDIRECTORY ("${libgit2_SOURCE_DIR } /deps/zlib" "${libgit2_BINARY_DIR } /deps/zlib" )
219+ LIST (APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR } /deps/zlib" )
220220 LIST (APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
221221ENDIF ()
222222
@@ -299,9 +299,9 @@ ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
299299
300300# Collect sourcefiles
301301FILE (GLOB SRC_H
302- "${CMAKE_SOURCE_DIR } /include/git2.h"
303- "${CMAKE_SOURCE_DIR } /include/git2/*.h"
304- "${CMAKE_SOURCE_DIR } /include/git2/sys/*.h" )
302+ "${libgit2_SOURCE_DIR } /include/git2.h"
303+ "${libgit2_SOURCE_DIR } /include/git2/*.h"
304+ "${libgit2_SOURCE_DIR } /include/git2/sys/*.h" )
305305
306306# On Windows use specific platform sources
307307IF (WIN32 AND NOT CYGWIN )
@@ -346,7 +346,7 @@ IF (${CMAKE_VERSION} VERSION_LESS 2.8.12)
346346ELSE ()
347347 TARGET_INCLUDE_DIRECTORIES (git2internal
348348 PRIVATE ${LIBGIT2_INCLUDES}
349- PUBLIC ${CMAKE_SOURCE_DIR } /include )
349+ PUBLIC ${libgit2_SOURCE_DIR } /include )
350350ENDIF ()
351351
352352SET (LIBGIT2_OBJECTS ${LIBGIT2_OBJECTS} PARENT_SCOPE)
@@ -359,9 +359,9 @@ LINK_DIRECTORIES(${LIBGIT2_LIBDIRS})
359359ADD_LIBRARY (git2 ${WIN_RC} ${LIBGIT2_OBJECTS} )
360360TARGET_LINK_LIBRARIES (git2 ${LIBGIT2_LIBS} )
361361
362- SET_TARGET_PROPERTIES (git2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR } )
363- SET_TARGET_PROPERTIES (git2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR } )
364- SET_TARGET_PROPERTIES (git2 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR } )
362+ SET_TARGET_PROPERTIES (git2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR } )
363+ SET_TARGET_PROPERTIES (git2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR } )
364+ SET_TARGET_PROPERTIES (git2 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR } )
365365
366366# Workaround for Cmake bug #0011240 (see http://public.kitware.com/Bug/view.php?id=11240)
367367# Win64+MSVC+static libs = linker error
@@ -382,7 +382,7 @@ IF (SONAME)
382382 ENDIF ()
383383ENDIF ()
384384STRING (REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} " )
385- CONFIGURE_FILE (${CMAKE_SOURCE_DIR } /libgit2.pc.in ${CMAKE_BINARY_DIR } /libgit2.pc @ONLY)
385+ CONFIGURE_FILE (${libgit2_SOURCE_DIR } /libgit2.pc.in ${libgit2_BINARY_DIR } /libgit2.pc @ONLY)
386386
387387IF (MSVC_IDE )
388388 # Precompiled headers
@@ -396,6 +396,6 @@ INSTALL(TARGETS git2
396396 LIBRARY DESTINATION ${LIB_INSTALL_DIR}
397397 ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
398398)
399- INSTALL (FILES ${CMAKE_BINARY_DIR } /libgit2.pc DESTINATION ${LIB_INSTALL_DIR} /pkgconfig )
400- INSTALL (DIRECTORY ${CMAKE_SOURCE_DIR } /include /git2 DESTINATION ${INCLUDE_INSTALL_DIR} )
401- INSTALL (FILES ${CMAKE_SOURCE_DIR } /include /git2.h DESTINATION ${INCLUDE_INSTALL_DIR} )
399+ INSTALL (FILES ${libgit2_BINARY_DIR } /libgit2.pc DESTINATION ${LIB_INSTALL_DIR} /pkgconfig )
400+ INSTALL (DIRECTORY ${libgit2_SOURCE_DIR } /include /git2 DESTINATION ${INCLUDE_INSTALL_DIR} )
401+ INSTALL (FILES ${libgit2_SOURCE_DIR } /include /git2.h DESTINATION ${INCLUDE_INSTALL_DIR} )
0 commit comments