set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${CMAKE_PROJECT_VERSION}${PROJECT_VERSION_STABILITY}${PROJECT_VERSION_BUILD_META}")
set(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_PROJECT_VERSION_PATCH}")

if(NOT DEFINED CPACK_SYSTEM_NAME)
    if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN")
        set(CPACK_SYSTEM_NAME cygwin)
    else()
        string(TOLOWER ${CMAKE_SYSTEM_NAME} CMAKE_SYSTEM_NAME_LOWER)
        set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME_LOWER}-${CMAKE_SYSTEM_PROCESSOR})
    endif()
endif()
if(${CPACK_SYSTEM_NAME} MATCHES windows)
    if(CMAKE_CL_64)
        set(CPACK_SYSTEM_NAME windows-x86_64)
    else()
        set(CPACK_SYSTEM_NAME windows-x86_32)
    endif()
endif()
