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)
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)