Commit 9e449e52 by Patrick Steinhardt

cmake: move regex build instructions into subdirectory

Extract code required to build the regex library into its own
CMakeLists.txt, which is included as required.
parent 43248500
......@@ -453,8 +453,9 @@ ENDIF()
# Include POSIX regex when it is required
IF(WIN32 OR AMIGA OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
LIST(APPEND LBIGIT2_INCLUDES "${CMAKE_SOURCE_DIR}/deps/regex")
SET(SRC_REGEX "${CMAKE_SOURCE_DIR}/deps/regex/regex.c")
ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/deps/regex" "${CMAKE_BINARY_DIR}/deps/regex")
LIST(APPEND LIBGIT2_INCLUDES "${CMAKE_SOURCE_DIR}/deps/regex")
LIST(APPEND LIBGIT2_LIBS regex)
ENDIF()
# Optional external dependency: http-parser
......@@ -599,7 +600,7 @@ ENDIF()
CONFIGURE_FILE(src/features.h.in git2/sys/features.h)
SET(GIT2INTERNAL_OBJECTS ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1})
SET(GIT2INTERNAL_OBJECTS ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_SSH} ${SRC_SHA1})
LIST(APPEND LIBGIT2_INCLUDES ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/include")
......
INCLUDE_DIRECTORIES(".")
ADD_LIBRARY(regex STATIC "regex.c" "regex.h")
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