From: Michael Wallner Date: Wed, 28 Jul 2021 08:46:41 +0000 (+0200) Subject: cmake: change artifacts directory structure X-Git-Tag: 1.1.1~13 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4cd1833334c9d1aaeb4a37c2d9b26a50f571b126;p=awesomized%2Flibmemcached cmake: change artifacts directory structure --- diff --git a/CPack.txt b/CPack.txt index eca05503..1a4d77dc 100644 --- a/CPack.txt +++ b/CPack.txt @@ -38,11 +38,7 @@ set(CPACK_PACKAGE_DESCRIPTION for the memcached server (http://memcached.org/). It has been designed to be light on memory usage, thread safe, and provide full access to server side methods.") -if(CMAKE_VERSION VERSION_LESS 3.12) - string(REPLACE ";" "-" CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/${PROJECT_CONFIG}") -else() - list(JOIN PROJECT_CONFIG "-" CPACK_PACKAGE_DIRECTORY) -endif() +set(CPACK_PROJECT_CONFIG ${PROJECT_CONFIG}) set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPack/ProjectConfig.txt") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}/${PROJECT_VERSION}") @@ -50,6 +46,7 @@ set(CPACK_PACKAGE_CHECKSUM SHA1) set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") set(CPACK_CHANGELOG_FILE "${CMAKE_SOURCE_DIR}/ChangeLog-1.1.md") +set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}") execute_process( COMMAND git describe --tags --match [0-9]*.* @@ -63,8 +60,10 @@ endif() string(STRIP "${PROJECT_TAG}" PROJECT_TAG) if(PROJECT_TAG) set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_TAG}) + set(CPACK_PACKAGE_VERSION ${PROJECT_TAG}) else() set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION}) + set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) endif() # dependencies @@ -100,13 +99,13 @@ include(CPack) set(PUSH_ARTIFACTS_SH "${CMAKE_SOURCE_DIR}/scripts/push-artifacts.sh") if(WIN32) - set(PUSH_ARTIFACTS_CMD msys2 -c '${PUSH_ARTIFACTS_SH} ${CPACK_PACKAGE_DIRECTORY}/') + set(PUSH_ARTIFACTS_CMD msys2 -c '${PUSH_ARTIFACTS_SH} ${CPACK_PACKAGE_VERSION}') else() - set(PUSH_ARTIFACTS_CMD ${PUSH_ARTIFACTS_SH} ${CPACK_PACKAGE_DIRECTORY}/) + set(PUSH_ARTIFACTS_CMD ${PUSH_ARTIFACTS_SH} ${CPACK_PACKAGE_VERSION}) endif() add_custom_target(push-artifacts COMMAND ${PUSH_ARTIFACTS_CMD} - WORKING_DIRECTORY ${CPACK_BINARY_DIR} + WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY} ) diff --git a/CPack/ProjectConfig.txt b/CPack/ProjectConfig.txt index 2b80cac1..4e4e3e19 100644 --- a/CPack/ProjectConfig.txt +++ b/CPack/ProjectConfig.txt @@ -1 +1 @@ -string(APPEND CPACK_PACKAGE_DIRECTORY "/${CPACK_GENERATOR}") +string(REPLACE ";" "-" CPACK_PACKAGE_DIRECTORY "${CPACK_PACKAGE_DIRECTORY}/${CPACK_PACKAGE_VERSION}/${CPACK_GENERATOR}/${CPACK_PROJECT_CONFIG}")