Commit fdd06874 by Etienne Samson

cmake: use FeatureSummary to display which features we end up using

parent 99d6ebb3
...@@ -28,6 +28,7 @@ INCLUDE(CheckStructHasMember) ...@@ -28,6 +28,7 @@ INCLUDE(CheckStructHasMember)
INCLUDE(AddCFlagIfSupported) INCLUDE(AddCFlagIfSupported)
INCLUDE(FindPkgConfig) INCLUDE(FindPkgConfig)
INCLUDE(FindThreads) INCLUDE(FindThreads)
INCLUDE(FeatureSummary)
# Build options # Build options
# #
...@@ -334,3 +335,10 @@ ENDIF () ...@@ -334,3 +335,10 @@ ENDIF ()
IF (BUILD_EXAMPLES) IF (BUILD_EXAMPLES)
ADD_SUBDIRECTORY(examples) ADD_SUBDIRECTORY(examples)
ENDIF () ENDIF ()
IF(CMAKE_VERSION VERSION_GREATER 3)
FEATURE_SUMMARY(WHAT ENABLED_FEATURES DISABLED_FEATURES)
ELSE()
PRINT_ENABLED_FEATURES()
PRINT_DISABLED_FEATURES()
ENDIF()
IF(DEBUG_POOL) IF(DEBUG_POOL)
SET(GIT_DEBUG_POOL 1) SET(GIT_DEBUG_POOL 1)
ENDIF() ENDIF()
ADD_FEATURE_INFO(debugpool GIT_DEBUG_POOL "debug pool allocator")
# Add the features.h file as a dummy. This is required for Xcode # Add the features.h file as a dummy. This is required for Xcode
# to successfully build the libgit2 library when using only # to successfully build the libgit2 library when using only
...@@ -50,6 +51,7 @@ ENDIF(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR}) ...@@ -50,6 +51,7 @@ ENDIF(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR})
IF (ENABLE_TRACE STREQUAL "ON") IF (ENABLE_TRACE STREQUAL "ON")
SET(GIT_TRACE 1) SET(GIT_TRACE 1)
ENDIF() ENDIF()
ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support")
CHECK_SYMBOL_EXISTS(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L) CHECK_SYMBOL_EXISTS(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L)
IF (HAVE_REGCOMP_L) IF (HAVE_REGCOMP_L)
...@@ -93,6 +95,7 @@ IF(THREADSAFE) ...@@ -93,6 +95,7 @@ IF(THREADSAFE)
LIST(APPEND LIBGIT2_LIBS ${CMAKE_THREAD_LIBS_INIT}) LIST(APPEND LIBGIT2_LIBS ${CMAKE_THREAD_LIBS_INIT})
LIST(APPEND LIBGIT2_PC_LIBS ${CMAKE_THREAD_LIBS_INIT}) LIST(APPEND LIBGIT2_PC_LIBS ${CMAKE_THREAD_LIBS_INIT})
ENDIF() ENDIF()
ADD_FEATURE_INFO(threadsafe THREADSAFE "threadsafe support")
IF (SECURITY_FOUND) IF (SECURITY_FOUND)
IF (SECURITY_HAS_SSLCREATECONTEXT) IF (SECURITY_HAS_SSLCREATECONTEXT)
...@@ -150,21 +153,26 @@ ELSE () ...@@ -150,21 +153,26 @@ ELSE ()
LIST(APPEND LIBGIT2_LIBS ${CURL_LIBRARIES}) LIST(APPEND LIBGIT2_LIBS ${CURL_LIBRARIES})
LIST(APPEND LIBGIT2_PC_LIBS ${CURL_LDFLAGS}) LIST(APPEND LIBGIT2_PC_LIBS ${CURL_LDFLAGS})
ENDIF() ENDIF()
ADD_FEATURE_INFO(cURL GIT_CURL "cURL for HTTP proxy support")
ENDIF() ENDIF()
# Specify sha1 implementation # Specify sha1 implementation
IF (USE_SHA1DC) IF (USE_SHA1DC)
ADD_FEATURE_INFO(SHA ON "using SHA1DC")
SET(GIT_SHA1_COLLISIONDETECT 1) SET(GIT_SHA1_COLLISIONDETECT 1)
ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1) ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1)
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\") ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\")
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\") ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\")
FILE(GLOB SRC_SHA1 hash/hash_collisiondetect.c hash/sha1dc/*) FILE(GLOB SRC_SHA1 hash/hash_collisiondetect.c hash/sha1dc/*)
ELSEIF (WIN32 AND NOT MINGW) ELSEIF (WIN32 AND NOT MINGW)
ADD_FEATURE_INFO(SHA ON "using SHA1_WIN32")
SET(GIT_SHA1_WIN32 1) SET(GIT_SHA1_WIN32 1)
FILE(GLOB SRC_SHA1 hash/hash_win32.c) FILE(GLOB SRC_SHA1 hash/hash_win32.c)
ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ADD_FEATURE_INFO(SHA ON "using CommonCrypto")
SET(GIT_SHA1_COMMON_CRYPTO 1) SET(GIT_SHA1_COMMON_CRYPTO 1)
ELSEIF (OPENSSL_FOUND) ELSEIF (OPENSSL_FOUND)
ADD_FEATURE_INFO(SHA ON "using OpenSSL")
SET(GIT_SHA1_OPENSSL 1) SET(GIT_SHA1_OPENSSL 1)
IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
LIST(APPEND LIBGIT2_PC_LIBS "-lssl") LIST(APPEND LIBGIT2_PC_LIBS "-lssl")
...@@ -172,6 +180,7 @@ ELSEIF (OPENSSL_FOUND) ...@@ -172,6 +180,7 @@ ELSEIF (OPENSSL_FOUND)
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl") SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl")
ENDIF () ENDIF ()
ELSE() ELSE()
ADD_FEATURE_INFO(SHA ON "using generic")
FILE(GLOB SRC_SHA1 hash/hash_generic.c) FILE(GLOB SRC_SHA1 hash/hash_generic.c)
ENDIF() ENDIF()
...@@ -189,11 +198,13 @@ IF (USE_EXT_HTTP_PARSER AND HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUA ...@@ -189,11 +198,13 @@ IF (USE_EXT_HTTP_PARSER AND HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUA
LIST(APPEND LIBGIT2_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS}) LIST(APPEND LIBGIT2_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS})
LIST(APPEND LIBGIT2_LIBS ${HTTP_PARSER_LIBRARIES}) LIST(APPEND LIBGIT2_LIBS ${HTTP_PARSER_LIBRARIES})
LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
ADD_FEATURE_INFO(http-parser ON "http-parser support")
ELSE() ELSE()
MESSAGE(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.") MESSAGE(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.")
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/http-parser" "${libgit2_BINARY_DIR}/deps/http-parser") ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/http-parser" "${libgit2_BINARY_DIR}/deps/http-parser")
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/http-parser") LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/http-parser")
LIST(APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:http-parser>") LIST(APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:http-parser>")
ADD_FEATURE_INFO(http-parser ON "http-parser support (bundled)")
ENDIF() ENDIF()
# Optional external dependency: zlib # Optional external dependency: zlib
...@@ -207,11 +218,13 @@ IF (ZLIB_FOUND) ...@@ -207,11 +218,13 @@ IF (ZLIB_FOUND)
ELSE() ELSE()
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib") SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib")
ENDIF() ENDIF()
ADD_FEATURE_INFO(zlib ON "Zlib support")
ELSE() ELSE()
MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." ) MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." )
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/zlib" "${libgit2_BINARY_DIR}/deps/zlib") ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/zlib" "${libgit2_BINARY_DIR}/deps/zlib")
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/zlib") LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/zlib")
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>) LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
ADD_FEATURE_INFO(zlib ON "Zlib support (bundled)")
ENDIF() ENDIF()
# Optional external dependency: libssh2 # Optional external dependency: libssh2
...@@ -233,6 +246,7 @@ IF (LIBSSH2_FOUND) ...@@ -233,6 +246,7 @@ IF (LIBSSH2_FOUND)
ELSE() ELSE()
MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
ENDIF() ENDIF()
ADD_FEATURE_INFO(SSH GIT_SSH "SSH transport support")
# Optional external dependency: libgssapi # Optional external dependency: libgssapi
IF (USE_GSSAPI) IF (USE_GSSAPI)
...@@ -242,6 +256,7 @@ IF (GSSAPI_FOUND) ...@@ -242,6 +256,7 @@ IF (GSSAPI_FOUND)
SET(GIT_GSSAPI 1) SET(GIT_GSSAPI 1)
LIST(APPEND LIBGIT2_LIBS ${GSSAPI_LIBRARIES}) LIST(APPEND LIBGIT2_LIBS ${GSSAPI_LIBRARIES})
ENDIF() ENDIF()
ADD_FEATURE_INFO(SPNEGO GIT_GSSAPI "SPNEGO authentication support")
# Optional external dependency: iconv # Optional external dependency: iconv
IF (USE_ICONV) IF (USE_ICONV)
...@@ -253,6 +268,7 @@ IF (ICONV_FOUND) ...@@ -253,6 +268,7 @@ IF (ICONV_FOUND)
LIST(APPEND LIBGIT2_LIBS ${ICONV_LIBRARIES}) LIST(APPEND LIBGIT2_LIBS ${ICONV_LIBRARIES})
LIST(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES}) LIST(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
ENDIF() ENDIF()
ADD_FEATURE_INFO(iconv GIT_USE_ICONV "iconv encoding conversion support")
IF (SECURITY_FOUND) IF (SECURITY_FOUND)
SET(GIT_SECURE_TRANSPORT 1) SET(GIT_SECURE_TRANSPORT 1)
......
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