From: dota17 Date: Fri, 21 Feb 2020 04:16:51 +0000 (+0800) Subject: Increase distcheck target in cmake X-Git-Tag: json-c-0.14-20200419~54^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77d7a99c752f18cdd8ee88dac0bfea14f38b2169;p=json-c Increase distcheck target in cmake --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0008cbb..b1f6f69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,14 @@ set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") set(JSON_C_BUGREPORT "json-c@googlegroups.com") +set(CPACK_SOURCE_IGNORE_FILES + ${PROJECT_SOURCE_DIR}/build + ${PROJECT_SOURCE_DIR}/cmake-build-debug + ${PROJECT_SOURCE_DIR}/pack + ${PROJECT_SOURCE_DIR}/.idea + ${PROJECT_SOURCE_DIR}/.DS_Store + ${PROJECT_SOURCE_DIR}/.git + ${PROJECT_SOURCE_DIR}/.vscode) include(CheckSymbolExists) include(CheckIncludeFile) @@ -51,6 +59,17 @@ include(CMakePackageConfigHelpers) option(BUILD_SHARED_LIBS "Default to building shared libraries" ON) +# Generate a release merge and test it to verify the correctness of republishing the package. +ADD_CUSTOM_TARGET(distcheck +COMMAND make package_source + COMMAND tar -xvf "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source.tar.gz" + COMMAND mkdir "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build" + COMMAND cmake "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/" -B"./${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build/" + COMMAND make -C "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build" + COMMAND make test -C "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build" + COMMAND rm -rf "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source" +) + # Enable or disable features. By default, all features are turned off. option(ENABLE_RDRAND "Enable RDRAND Hardware RNG Hash Seed" OFF) option(ENABLE_THREADING "Enable partial threading support." OFF)