Отказ от использования файлов organization.txt и cpack_ignore.txt

This commit is contained in:
Andrei Astafev 2019-10-16 18:51:48 +03:00
parent 156d74f581
commit db4487b798
4 changed files with 36 additions and 7 deletions

View File

@ -1,8 +1,5 @@
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_SOURCE_GENERATOR TXZ) set(CPACK_SOURCE_GENERATOR TXZ)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") 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) include(CPack)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)

View File

@ -18,9 +18,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(CMLibProjectVersion) include(CMLibProjectVersion)
set_project_version() set_project_version()
include(CMLibOrganizationName) include(CMLibRequiredVariables)
set_organization_name()
include(CMLibGlobalVariables) include(CMLibGlobalVariables)
include(CMLibLSBInfo) include(CMLibLSBInfo)
include(CMLibCompiler) include(CMLibCompiler)

View File

@ -3,7 +3,6 @@ function(cmlib_config_hpp_generate)
cmlib_test_large_files(HAVE_LARGEFILES) cmlib_test_large_files(HAVE_LARGEFILES)
get_property(PROJECT_VERSION_INT GLOBAL PROPERTY PROJECT_VERSION_INT) 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(TOLOWER ${ORGANIZATION_NAME} ORGANIZATION_NAME_LOWER)
string(TOUPPER ${ORGANIZATION_NAME} ORGANIZATION_NAME_UPPER) string(TOUPPER ${ORGANIZATION_NAME} ORGANIZATION_NAME_UPPER)
string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_LOWER) string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_LOWER)

View File

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