Commit 71d33382 by Vicent Marti

Move the external includes folder from `src` to `include`

Signed-off-by: Vicent Marti <tanoku@gmail.com>
parent 584f49a5
......@@ -14,7 +14,7 @@
PROJECT(libgit2 C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
FILE(STRINGS "src/git2.h" GIT2_HEADER REGEX "^#define LIBGIT2_VERSION \"[^\"]*\"$")
FILE(STRINGS "include/git2.h" GIT2_HEADER REGEX "^#define LIBGIT2_VERSION \"[^\"]*\"$")
STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"([0-9]+).*$" "\\1" LIBGIT2_VERSION_MAJOR "${GIT2_HEADER}")
STRING(REGEX REPLACE "^.*LIBGIT2_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_MINOR "${GIT2_HEADER}")
......@@ -73,7 +73,7 @@ ENDIF ()
FILE(GLOB SRC src/*.c src/backends/*.c)
FILE(GLOB SRC_SHA1 src/block-sha1/*.c)
FILE(GLOB SRC_PLAT src/unix/*.c)
FILE(GLOB SRC_H src/git/*.h)
FILE(GLOB SRC_H include/git2/*.h)
# On Windows use specific platform sources
IF (WIN32 AND NOT CYGWIN)
......@@ -107,8 +107,8 @@ INSTALL(TARGETS git2
LIBRARY DESTINATION ${INSTALL_LIB}
ARCHIVE DESTINATION ${INSTALL_LIB}
)
INSTALL(DIRECTORY src/git2 DESTINATION ${INSTALL_INC} )
INSTALL(FILES src/git2.h DESTINATION ${INSTALL_INC} )
INSTALL(DIRECTORY include/git2 DESTINATION ${INSTALL_INC} )
INSTALL(FILES include/git2.h DESTINATION ${INSTALL_INC} )
# Tests
IF (BUILD_TESTS)
......
......@@ -132,7 +132,7 @@ def build_library(bld, build_type):
sources = directory.ant_glob('src/*.c')
# Find the version of the library, from our header file
version = get_libgit2_version(directory.find_node("src/git2.h").abspath())
version = get_libgit2_version(directory.find_node("include/git2.h").abspath())
# Compile platform-dependant code
# E.g. src/unix/*.c
......@@ -153,7 +153,7 @@ def build_library(bld, build_type):
BUILD[build_type](
source=sources,
target='git2',
includes='src',
includes=['src', 'include'],
install_path='${LIBDIR}',
use=ALL_LIBS,
vnum=version,
......@@ -168,8 +168,8 @@ def build_library(bld, build_type):
)
# Install headers
bld.install_files('${PREFIX}/include', directory.find_node('src/git2.h'))
bld.install_files('${PREFIX}/include/git2', directory.ant_glob('src/git2/*.h'))
bld.install_files('${PREFIX}/include', directory.find_node('include/git2.h'))
bld.install_files('${PREFIX}/include/git2', directory.ant_glob('include/git2/*.h'))
# On Unix systems, let them know about installation
if bld.env.PLATFORM == 'unix' and bld.cmd == 'install-shared':
......@@ -191,7 +191,7 @@ def build_test(bld):
bld.program(
source=sources,
target='libgit2_test',
includes=['src', 'tests'],
includes=['src', 'tests', 'include'],
defines=['TEST_RESOURCES="%s"' % resources_path],
use=['git2'] + ALL_LIBS
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment