From db4487b798acd760a47f0b112072a35c4821a334 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Wed, 16 Oct 2019 18:51:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BA=D0=B0=D0=B7=20=D0=BE=D1=82?= =?UTF-8?q?=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=20org?= =?UTF-8?q?anization.txt=20=D0=B8=20cpack=5Fignore.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCPackSources.cmake | 3 --- CMLibCommon.cmake | 4 +--- CMLibConfigHPPGenerate.cmake | 1 - CMLibRequiredVariables.cmake | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 CMLibRequiredVariables.cmake diff --git a/CMLibCPackSources.cmake b/CMLibCPackSources.cmake index 1b64724..cc8e693 100644 --- a/CMLibCPackSources.cmake +++ b/CMLibCPackSources.cmake @@ -1,8 +1,5 @@ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) set(CPACK_SOURCE_GENERATOR TXZ) set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") -set(CPACK_IGNORE_FILE "cmake/etc/cpack_ignore.txt") -file(STRINGS ${CPACK_IGNORE_FILE} CPACK_SOURCE_IGNORE_FILES) -set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CPACK_IGNORE_FILE}) include(CPack) add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) diff --git a/CMLibCommon.cmake b/CMLibCommon.cmake index 2ed57d7..49fbb06 100644 --- a/CMLibCommon.cmake +++ b/CMLibCommon.cmake @@ -18,9 +18,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) include(CMLibProjectVersion) set_project_version() -include(CMLibOrganizationName) -set_organization_name() - +include(CMLibRequiredVariables) include(CMLibGlobalVariables) include(CMLibLSBInfo) include(CMLibCompiler) diff --git a/CMLibConfigHPPGenerate.cmake b/CMLibConfigHPPGenerate.cmake index a51577e..0675ff6 100644 --- a/CMLibConfigHPPGenerate.cmake +++ b/CMLibConfigHPPGenerate.cmake @@ -3,7 +3,6 @@ function(cmlib_config_hpp_generate) cmlib_test_large_files(HAVE_LARGEFILES) get_property(PROJECT_VERSION_INT GLOBAL PROPERTY PROJECT_VERSION_INT) - get_property(ORGANIZATION_NAME GLOBAL PROPERTY ORGANIZATION_NAME) string(TOLOWER ${ORGANIZATION_NAME} ORGANIZATION_NAME_LOWER) string(TOUPPER ${ORGANIZATION_NAME} ORGANIZATION_NAME_UPPER) string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_LOWER) diff --git a/CMLibRequiredVariables.cmake b/CMLibRequiredVariables.cmake new file mode 100644 index 0000000..f938974 --- /dev/null +++ b/CMLibRequiredVariables.cmake @@ -0,0 +1,35 @@ +if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/etc/Variables.cmake") + message(FATAL_ERROR "Required file cmake/etc/Variables.cmake does not exist") +endif() + +include("${CMAKE_SOURCE_DIR}/cmake/etc/Variables.cmake") + +if(NOT ORGANIZATION_NAME) + message(FATAL_ERROR "Required variable ORGANIZATION_NAME is not defined") +endif() + +set(CPACK_PACKAGE_VENDOR ${ORGANIZATION_NAME}) + +if(NOT CPACK_GENERATOR) + message(FATAL_ERROR "Required variable CPACK_GENERATOR is not defined") +endif() + +if(NOT CPACK_PACKAGE_CONTACT) + message(FATAL_ERROR "Required variable CPACK_PACKAGE_CONTACT is not defined") +endif() + +if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) + message(FATAL_ERROR "Required variable CPACK_PACKAGE_DESCRIPTION_SUMMARY is not defined") +endif() + +if(NOT CPACK_DEBIAN_PACKAGE_SECTION) + message(FATAL_ERROR "Required variable CPACK_DEBIAN_PACKAGE_SECTION is not defined") +endif() + +if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY) + message(FATAL_ERROR "Required variable CPACK_DEBIAN_PACKAGE_PRIORITY is not defined") +endif() + +if(NOT CPACK_SOURCE_IGNORE_FILES) + message(FATAL_ERROR "Required variable CPACK_SOURCE_IGNORE_FILES is not defined") +endif()